This repo contains
- 4 individual snapshots as defined by the eligibility criteria
- The final airdrop allocation calculated from these snapshots in this notebook.
- Export 16 monthly snapshot CSVs (first snapshot 15.10.2022, last snapshot 15.02.2024) using the above Dune query to generate a list of addresses that had locked Celo until the snapshot time
- ❗ Note that the balances from the Dune query results on their own are incorrect as they do not factor in accrued yield from locking over time ❗
- Dune only indexes emitted
GoldLocked
andGoldUnlocked
events, but not emitted yield. Hence, Dune balances are lower than the actual on-chain balance
- Given the list of Dune-generated addresses, fetch the actual
LockedCelo
balance at the snapshot time from a Celo archive node viayarn generate:lockedCeloBalances
- Sum up actual LockedCelo balances at all monthly snapshots
- Calculate the average LockedCelo over all monthly snapshots
- Filter out addresses with less than $10 USD worth of LockedCelo on average
- Map addresses that belong (or belonged in case they were self-destructed) to
ReleaseGold
vesting contracts to their respective beneficiaries viayarn lockedCelo:mapReleaseGold
The total cStable volume (cUSD + cEUR + cREAL) across a the snapshot period from 15.10.2022 until 15.02.2024.
Volume is defined as all cStable transfers from an address + all cStable transfers to an address.
- Final Snapshot - cStable Volume
- Dune Query used to export cStable Volumes
- Validator Addresses Snapshot
- Validator Addresses Dune Query
- Validator Group Addresses Snapshot
- Validator Group Addresses were fetched from explorer.celo.org via this query:
{celoValidatorGroups{address}}
- Bob sent 100 cUSD on day 1 of the snapshot period
- Bob received 50 cUSD on day 100 of the snapshot period
- Bob has sent 100 cEUR at day 365 of the snapshot period
- The average cEUR/USD exchange rate over the 365 days snapshot period was 1.05
- Bob has a total volume of 100 cUSD (spent) + 50 cUSD (received) + (100 cEUR * 1.05 exchange rate = 105 cUSD) = $255 total volume
- Take 1 snapshot of the total cStables volume per address over a 1-year timeframe from 15.10.2022 12:00 pm UTC to 15.10.2023 12:00 pm UTC
- Sum up volume across all cStables:
cUSD volume + cEUR volume + cREAL volume
- Denominate volume in USD using the average exchange rate over 365 days between 15.11.2022 and 15.10.2023
- Sort by total volume in USD
- Filter out addresses with less than $100 of total volume
- Filter out validator and validator group addresses and double their cUSD volume
- Key Assumption: Validator addresses and validator group addresses barely received cUSD from outside sources but only from epoch rewards
- Epoch rewards paid out in cUSD to validator and validator groups aren't captured by Dune, so as a rough heuristic, we're assuming that all cUSD outflows must have had original inflows via epoch rewards. Therefore multiplying cUSD outflows by 2 should give a good approximation of their real volume, albeit not perfect.
The average cStable balance (cUSD/cEUR/cREAL) denominated in USD across 16 monthly snapshots from 15.11.2022 through 15.02.2024.
- Final Snapshot - cStable Balances
- Dune Query that was used to export 16 snapshot CSVs at different dates
- Before snapshot 1 (15.11.2022 12 pm UTC), Alice had received 75 cUSD and spent 5 cUSD
- Therefore, Alice's balance at snapshot 1 was 70 cUSD (75 - 5)
- She doesn't send or receive any further transactions until one day before the last snapshot
- One day before the last snapshot, Alice receives 100 cEUR
- On the day of the last snapshot, cEUR had an exchange rate of 1.06 USD, so Alice's 100 cEUR were valued at $106 USD
- Her total average cStable balance across all 16 snapshots would be
- ($70 (cUSD balance) + $106 (cEUR balance)) / 16 snapshots = $11 average combined cStable balance
- Alice would be eligible for the airdrop because she has more than $10 in average cStable value across all snapshots
- Take 16 monthly snapshots, 1 per month from November 15, 2022, to February 15, 2024, of addresses that held any cStables on the date of the snapshot
- Filter out addresses with less than 10 cUSD or cEUR or cREAL at the time of snapshot
- Convert the cStables balances into USD using the exchange rate at the time of the respective monthly snapshot
- Calculate the average cStable balance in USD over all monthly snapshots
- Filter out addresses with less than $10 USD in average cStable balances across all snapshots
- Filter out validator and validator group addresses because their cUSD balances can't be correctly calculated by indexers.
- The epoch rewards paid in cUSD to validators do not emit
Transfer
events that indexers pick up. Therefor, we must calculate them manually.
- The epoch rewards paid in cUSD to validators do not emit
- Fetch actual cStable balances for all validator and validator group addresses via
balanceOf(address, blockNumber)
from an archive node for each monthly snapshot - Integrate average validator and validator group balances into final snapshot
- Copy the
.env.example
file into.env
and add a valid Infura API key - Delete all snapshot CSV files from: (don't worry, they're under version control)
./src/snapshots/cstable-balances/individual-monthly-snapshots
./src/snapshots/cstable-balances/validator-balances/monthly-snapshots-validators
./src/snapshots/cstable-balances/validator-balances/monthly-snapshots-validator-groups
- Export monthly snapshot CSVs via this Dune Query, one for every snapshot date
- First snapshot: 15.11.2022 12:00 pm UTC
- Last snapshot: 15.02.2024 12:00 pm UTC
- Name the CSVs according to schema
2022-11-15 12pm.csv
and place them into the./src/snapshots/cstable-balances/individual-monthly-snapshots
folder - Run
npm run generate:cstableBalances
which should create or update./src/snapshots/cstable-balances/total-average-across-all-snapshots-excluding-validators.csv
- Run
npm run generate:cstableBalancesForValidators
which should fetch validator balances from an archive node and create monthly snapshot CSVs in./src/snapshots/cstable-balances/validator/balances/monthly-snapshots-validators/
- Run
npm run generate:cstableBalancesForValidatorGroups
which should fetch validator group balances from an archive node and create monthly snapshot CSVs in./src/snapshots/cstable-balances/validator/balances/monthly-snapshots-validator-groups/
- Run
npm run generate:cstableBalances:merge
which should merge the results of the prior 3 commands into./final-snapshots/cstable-balances.csv
- Check the git diffs to see you get the same results
The average stCELO balance, denominated in USD, across 16 monthly snapshots from 15.11.2022 through 15.02.2024.
- Final Snapshot - cStable Balances
- Dune Query that was used to export 16 snapshot CSVs at different dates
- Take 16 monthly snapshots, 1 per month from November 15, 2022, to February 15, 2024, of addresses that held stCELO on the date of the snapshot
- Filter out addresses with less than 10 stCELO at the time of snapshot
- Convert the stCELO balances into USD using the CELO/USD exchange rate at the time of the respective monthly snapshot
- NOTE: We know stCELO<>CELO isn't 1:1 but there were no stCELO price feeds available on Dune and the deviation should be small enough for 1:1 to be ok for our purposes
- Calculate the average balance over all monthly snapshots
- Filter out addresses with less than $10 USD worth of stCELO on average