Skip to content

UpVote Election Backend API

Nikolaus Heger edited this page Oct 11, 2023 · 7 revisions

Graph Model

Overview

A DAO can have an upvote election, which can be in one of 3 states - upcoming, ongoing, previous

All elections (historic) can be found with the edge "election"

When there is an upcoming election, members can sign up for it by signing up for the "Delegate" badge.

All members with delegate badge participate in the start round of the upcoming election.

Winners are given either chief delegate badges (1 - 10) or a head delegate badge (1)

Election Model

An election has rounds - start round, current round

And these fields

  • seed
  • start date
  • end date
  • duration - how long until the next election, e.g. 13 weeks
  • status (finished or not)

Election Round

Election round has groups - 3 - N groups

  • start date
  • end date

Winners of each group advance to the next

Election Group

Election group has between 4 and 6 members And between 0 and 6 votes.

Members vote for a winner

Winner is updated dynamically as votes are added.

winner == -1 - no winner

  • winner

Vote

A vote stores

  • voter_id
  • voted_id

Last round

In the last round, defined by there being 11 or fewer members, the system randomly chooses a head delegate.

Then assigns chief delegate badges to all chief delegate members, and head delegate badge to the head delegate.

These badges expire in the duration of the election, meaning, if the election has a 13 week duration these badges will expire in 13 weeks.

Diagrams

Upvote Hypha