Elections
GET /explorer/election/{head,hash,number}
On-chain elections can be queried by proposal hash
or sequence number
. An election contains a complete set of data on a past or the currently ongoing (head
) on-chain voting process, including up to four voting periods. Voting periods may be empty when no proposal has been published. Only the last voting period of the last election can be in state open. Ballots represent the individual ballot operations sent by bakers during votes or the up-votes to a proposal during the first voting period.
- Schema
- Period
- Proposal
- Sample
- Example
Field | Description |
---|---|
election_id int64 | Sequence number of the election. |
num_periods int64 | Number of voting periods activated during this election (min 1, max 4) |
num_proposals int64 | Total number of submitted proposals. |
start_time int64 | Time of the first block in the election. |
end_time int64 | Time of the last block in the election (when open this is an approximation of the latest possible end assuming all voting periods are used and all remaining blocks are produced at priority zero). |
start_height int64 | First block of the election period. |
end_height bool | Last block of the election (when open this is an approximation of the full duration assuming all voting periods are used). |
is_empty bool | Flag indicating the election has not seen and proposal being submitted. |
is_open bool | Flag indicating the election is ongoing. |
is_failed bool | Flag indicating the election has failed to select or activate a new protocol. |
no_quorum bool | Flag indicating the election has failed because no quorum could be reached. |
no_majority bool | Flag indicating the election has failed because no majority could be reached. |
no_proposal bool | Flag indicating the election has failed because no proposal has been submitted. |
voting_period enum | Period kind proposal , exploration , cooldown , promotion , adoption . |
proposal object | Vote object for the proposal period 1 (see below). |
exploration object | Vote object for the exploration period 2 (see below). |
cooldown object | Vote object for the cooldown period 3 (see below). |
promotion object | Vote object for the promotion vote period 4 (see below). |
adoption object | Vote object for the adoption vote period 5 (see below). |
Voting Schema​
Field | Description |
---|---|
voting_period int64 | Protocol-level voting period counter. |
voting_period_kind enum | Period kind proposal , exploration , cooldown , promotion , adoption . |
period_start_time datetime | Time of the first block in the voting period. |
period_end_time datetime | Time of the last block in the voting period (when open this is an approximation of the latest possible end assuming all remaining blocks are produced at priority zero). |
period_start_block int64 | First block of the voting period. |
period_end_block int64 | Last block of the voting period. |
eligible_stake money | |
eligible_voters int64 | Number of eligible voters (delegates) snapshot at start of the voting period. |
quorum_pct float | Required quorum in percent. |
quorum_stake money | Required stake to reach quorum. |
turnout_stake money | Actual voting stake. |
turnout_voters int64 | Actual voters who voted. |
turnout_pct float | Actual participation in percent. |
turnout_ema float | Moving average for Babylon v005 quorum algorithm. |
yay_stake money | Amount of Yay stake. |
yay_voters int64 | Number of Yay voters. |
nay_stake money | Amount of Nay stake. |
nay_voters int64 | Number of Nay voters. |
pass_stake money | Amount of Pass stake. |
pass_voters int64 | Number of Pass voters. |
is_open bool | Flag indicating the voting period is currently open. |
is_failed bool | Flag indicating the voting period has failed to select or activate a new protocol. |
is_draw bool | Flag indication the reason for failure was a draw between two proposals in the proposal period. |
no_proposal bool | Flag indication the reason for failure was no submitted proposal in the proposal period. |
no_quorum bool | Flag indication the reason for failure was participation below the required quorum. |
no_majority bool | Flag indication the reason for failure was acceptance below the required supermajority. |
proposals array | List of submitted proposals (in proposal period) or the selected proposal. |
Proposal Schema​
Field | Description |
---|---|
hash hash | Protocol hash. |
source hash | Sender account. |
block_hash hash | Proposal operation block hash. |
op_hash hash | Proposal operation hash. |
height int64 | Proposal operation submission height. |
time datetime | Proposal operation submission time. |
stake money | Amount of stake voting for this proposal. |
voters int64 | Count of voters voting for this proposal during the proposal period. |
{
"election_id": 39,
"start_height": 2285569,
"start_time": "2022-04-16T09:50:14Z",
"end_height": 2490368,
"end_time": "2022-06-28T14:48:14Z",
"voting_period": "adoption",
"is_empty": false,
"is_failed": false,
"is_open": true,
"max_periods": 5,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"num_periods": 5,
"num_proposals": 4,
"proposal": {
"eligible_stake": 685418342.568226,
"eligible_voters": 385,
"is_draw": false,
"is_failed": false,
"is_open": false,
"nay_stake": 0,
"nay_voters": 0,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"pass_stake": 0,
"pass_voters": 0,
"period_end_block": 2326528,
"period_end_time": "2022-05-01T02:05:29Z",
"period_start_block": 2285569,
"period_start_time": "2022-04-16T09:50:14Z",
"proposals": [
{
"block_hash": "BLrcxiWFjAWf3E1KyPAQyPGfRSqTVSofZ1936ERT3nWxJC9j9dH",
"hash": "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw",
"height": 2286604,
"op_hash": "ooNVwjdBEuFEcCr6Qjvj4ZmsaboAqxQxEc1JYvsXPQy63of9Z2z",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-16T18:46:59Z",
"voters": 47
},
{
"block_hash": "BLXGQGX1suCSsSF7Kx8ch2idKGSyJ5vJztA214TmgrMJ97VMiGN",
"hash": "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
"height": 2313783,
"op_hash": "ongHcJPpjJmnReoNwxQQqiuZKr9ZxvSGFRfq1ZiJcvWYAN6bp3F",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-26T12:34:44Z",
"voters": 85
},
{
"block_hash": "BKrxpNphA3mJRBJtwc41SBVR29rHd1j8KsorzEbygcRi89QkyLR",
"hash": "PtSEBSEBSEBSEBSEBSEBSEBSEBSEBSEBSEBSEBSEBSEBS5VTrmo",
"height": 2323914,
"op_hash": "oojxUhKQrEp3kHqpjt3J2MSyvLu7KGieU1xQgangsPZfWNyMfSj",
"source": "tz1R664EP6wjcM1RSUVJ7nrJisTpBW9QyJzP",
"stake": 0,
"time": "2022-04-30T03:53:29Z",
"voters": 1
},
{
"block_hash": "BKrxpNphA3mJRBJtwc41SBVR29rHd1j8KsorzEbygcRi89QkyLR",
"hash": "PtGXSEBUHXFARMxDEXxNFTxRPCxSEBxSEBxSEBxSEBxSE3GRJJC",
"height": 2323914,
"op_hash": "oojxUhKQrEp3kHqpjt3J2MSyvLu7KGieU1xQgangsPZfWNyMfSj",
"source": "tz1R664EP6wjcM1RSUVJ7nrJisTpBW9QyJzP",
"stake": 0,
"time": "2022-04-30T03:53:29Z",
"voters": 1
}
],
"quorum_pct": 500,
"quorum_stake": 34270917.128411,
"turnout_ema": 0,
"turnout_pct": 2668,
"turnout_stake": 182912224.998332,
"turnout_voters": 96,
"voting_period": 70,
"voting_period_kind": "proposal",
"yay_stake": 0,
"yay_voters": 0
},
"exploration": {
"eligible_stake": 687620221.226926,
"eligible_voters": 380,
"is_draw": false,
"is_failed": false,
"is_open": false,
"nay_stake": 0,
"nay_voters": 0,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"pass_stake": 165617666.478757,
"pass_voters": 20,
"period_end_block": 2367488,
"period_end_time": "2022-05-15T16:51:14Z",
"period_start_block": 2326529,
"period_start_time": "2022-05-01T02:05:59Z",
"proposals": [
{
"block_hash": "BLXGQGX1suCSsSF7Kx8ch2idKGSyJ5vJztA214TmgrMJ97VMiGN",
"hash": "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
"height": 2313783,
"op_hash": "ongHcJPpjJmnReoNwxQQqiuZKr9ZxvSGFRfq1ZiJcvWYAN6bp3F",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-26T12:34:44Z",
"voters": 0
}
],
"quorum_pct": 5224,
"quorum_stake": 359212803.568946,
"turnout_ema": 6448,
"turnout_pct": 5854,
"turnout_stake": 402585743.698669,
"turnout_voters": 141,
"voting_period": 71,
"voting_period_kind": "exploration",
"yay_stake": 236968077.219912,
"yay_voters": 121
},
"cooldown": {
"eligible_stake": 679602809.899885,
"eligible_voters": 383,
"is_draw": false,
"is_failed": false,
"is_open": false,
"nay_stake": 0,
"nay_voters": 0,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"pass_stake": 0,
"pass_voters": 0,
"period_end_block": 2408448,
"period_end_time": "2022-05-30T04:12:14Z",
"period_start_block": 2367489,
"period_start_time": "2022-05-15T16:51:44Z",
"proposals": [
{
"block_hash": "BLXGQGX1suCSsSF7Kx8ch2idKGSyJ5vJztA214TmgrMJ97VMiGN",
"hash": "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
"height": 2313783,
"op_hash": "ongHcJPpjJmnReoNwxQQqiuZKr9ZxvSGFRfq1ZiJcvWYAN6bp3F",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-26T12:34:44Z",
"voters": 0
}
],
"quorum_pct": 0,
"quorum_stake": 0,
"turnout_ema": 0,
"turnout_pct": 0,
"turnout_stake": 0,
"turnout_voters": 0,
"voting_period": 72,
"voting_period_kind": "cooldown",
"yay_stake": 0,
"yay_voters": 0
},
"promotion": {
"eligible_stake": 690148163.099879,
"eligible_voters": 386,
"is_draw": false,
"is_failed": false,
"is_open": false,
"nay_stake": 0,
"nay_voters": 0,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"pass_stake": 212384627.309411,
"pass_voters": 20,
"period_end_block": 2449408,
"period_end_time": "2022-06-14T04:26:29Z",
"period_start_block": 2408449,
"period_start_time": "2022-05-30T04:13:14Z",
"proposals": [
{
"block_hash": "BLXGQGX1suCSsSF7Kx8ch2idKGSyJ5vJztA214TmgrMJ97VMiGN",
"hash": "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
"height": 2313783,
"op_hash": "ongHcJPpjJmnReoNwxQQqiuZKr9ZxvSGFRfq1ZiJcvWYAN6bp3F",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-26T12:34:44Z",
"voters": 0
}
],
"quorum_pct": 5164,
"quorum_stake": 356392511.424777,
"turnout_ema": 6329,
"turnout_pct": 6251,
"turnout_stake": 431431747.515176,
"turnout_voters": 134,
"voting_period": 73,
"voting_period_kind": "promotion",
"yay_stake": 219047120.205765,
"yay_voters": 114
},
"adoption": {
"eligible_stake": 693473356.445228,
"eligible_voters": 387,
"is_draw": false,
"is_failed": false,
"is_open": true,
"nay_stake": 0,
"nay_voters": 0,
"no_majority": false,
"no_proposal": false,
"no_quorum": false,
"pass_stake": 0,
"pass_voters": 0,
"period_end_block": 2490368,
"period_end_time": "2022-06-28T14:47:44Z",
"period_start_block": 2449409,
"period_start_time": "2022-06-14T04:26:59Z",
"proposals": [
{
"block_hash": "BLXGQGX1suCSsSF7Kx8ch2idKGSyJ5vJztA214TmgrMJ97VMiGN",
"hash": "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY",
"height": 2313783,
"op_hash": "ongHcJPpjJmnReoNwxQQqiuZKr9ZxvSGFRfq1ZiJcvWYAN6bp3F",
"source": "tz1S5WxdZR5f9NzsPXhr7L9L1vrEb5spZFur",
"stake": 0,
"time": "2022-04-26T12:34:44Z",
"voters": 0
}
],
"quorum_pct": 0,
"quorum_stake": 0,
"turnout_ema": 0,
"turnout_pct": 0,
"turnout_stake": 0,
"turnout_voters": 0,
"voting_period": 74,
"voting_period_kind": "adoption",
"yay_stake": 0,
"yay_voters": 0
}
}
curl https://api.tzpro.io/explorer/election/head
List Voters​
GET /explorer/election/{hash,number,head}/{stage}/voters
Lists all eligible voters for the current voting period where stage
is the sequence number of the voting period [1..4]
. The voter list supports pagination with limit
, offset
and cursor
. To change the order of returned calls use the optional order
(asc|desc) parameter.
Voter Schema​
Field | Description |
---|---|
row_id int64 | Internal account id for use with cursor . |
address hash | Voter address. |
stake money | Staking balance the voter had at the beginning of this voting period. |
has_voted bool | Flag indicating if the account has already voted. |
ballot enum | Ballot cast by the voter, either yay , nay or pass . |
proposals array | List of proposals (as hashes) the voter voted for. |
List Ballots​
GET /explorer/election/{hash,number,head}/{stage}/ballots
Lists all ballots cast during the current voting period where stage
is the sequence number of the voting period [1..4]
. The voter list supports pagination with limit
, offset
and cursor
. To change the order of returned calls use the optional order
(asc|desc) parameter.
Ballot Schema​
Field | Description |
---|---|
row_id int64 | Internal account id for use with cursor . |
sender hash | Voter address. |
height int64 | Operation submission height. |
time datetime | Operation submission time. |
election_id int64 | Sequence number of the election. |
voting_period int64 | Protocol-level voting period counter. |
voting_period_kind enum | Period kind proposal , exploration , cooldown , promotion , adoption . |
proposal hash | Hash of the proposal the voter voted for. If the vote happened during the proposal period and the voter used to vote for multiple proposals either in a single proposals operation or with multiple proposals operations, multiple ballots exist. |
op hash | Operation hash. |
ballot enum | Ballot cast by the voter, either yay , nay or pass . During proposal period the ballot is always yay to describe the only choice. |
stake money | Amount of stake the voter had during this voting period. |