Skip to content

mento-protocol/airdrop-snapshot

Repository files navigation

Airdrop Snapshots

This repo contains

1. Locked CELO

Calculation Method Explanation

  1. 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 and GoldUnlocked events, but not emitted yield. Hence, Dune balances are lower than the actual on-chain balance
  2. Given the list of Dune-generated addresses, fetch the actual LockedCelo balance at the snapshot time from a Celo archive node via yarn generate:lockedCeloBalances
  3. Sum up actual LockedCelo balances at all monthly snapshots
  4. Calculate the average LockedCelo over all monthly snapshots
  5. Filter out addresses with less than $10 USD worth of LockedCelo on average
  6. Map addresses that belong (or belonged in case they were self-destructed) to ReleaseGold vesting contracts to their respective beneficiaries via yarn lockedCelo:mapReleaseGold

2. cStables Volume

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.

Results

Example

  • 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

Calculation Method Explanation

  1. 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
  2. Sum up volume across all cStables: cUSD volume + cEUR volume + cREAL volume
  3. Denominate volume in USD using the average exchange rate over 365 days between 15.11.2022 and 15.10.2023
  4. Sort by total volume in USD
  5. Filter out addresses with less than $100 of total volume
  6. 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.

3. cStables Balances

The average cStable balance (cUSD/cEUR/cREAL) denominated in USD across 16 monthly snapshots from 15.11.2022 through 15.02.2024.

Example

  • 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

Calculation Method Explanation

  1. 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
  2. Filter out addresses with less than 10 cUSD or cEUR or cREAL at the time of snapshot
  3. Convert the cStables balances into USD using the exchange rate at the time of the respective monthly snapshot
  4. Calculate the average cStable balance in USD over all monthly snapshots
  5. Filter out addresses with less than $10 USD in average cStable balances across all snapshots
  6. 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.
  7. Fetch actual cStable balances for all validator and validator group addresses via balanceOf(address, blockNumber) from an archive node for each monthly snapshot
  8. Integrate average validator and validator group balances into final snapshot

How To Recalculate Yourself

  1. Copy the .env.example file into .env and add a valid Infura API key
  2. Delete all snapshot CSV files from: (don't worry, they're under version control)
    1. ./src/snapshots/cstable-balances/individual-monthly-snapshots
    2. ./src/snapshots/cstable-balances/validator-balances/monthly-snapshots-validators
    3. ./src/snapshots/cstable-balances/validator-balances/monthly-snapshots-validator-groups
  3. 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
  4. Name the CSVs according to schema 2022-11-15 12pm.csv and place them into the ./src/snapshots/cstable-balances/individual-monthly-snapshots folder
  5. Run npm run generate:cstableBalances which should create or update ./src/snapshots/cstable-balances/total-average-across-all-snapshots-excluding-validators.csv
  6. 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/
  7. 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/
  8. Run npm run generate:cstableBalances:merge which should merge the results of the prior 3 commands into ./final-snapshots/cstable-balances.csv
  9. Check the git diffs to see you get the same results

4. stCELO Balances

The average stCELO balance, denominated in USD, across 16 monthly snapshots from 15.11.2022 through 15.02.2024.

Calculation Method Explanation

  1. 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
  2. Filter out addresses with less than 10 stCELO at the time of snapshot
  3. 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
  4. Calculate the average balance over all monthly snapshots
  5. Filter out addresses with less than $10 USD worth of stCELO on average

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •