You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
Circulating Supply = Total Supply - Tokens locked in the Lockup contracts
Implementation Notes
Here is how to compute the value:
Total Supply is available though RPC block method (see header->total_supply)
Tokens locked in the lockup contracts needs to be queried individually:
2.1. Query Indexer for Explorer database for all the lockup accounts: SELECT account_id FROM accounts WHERE account_id LIKE '%.lockup.near'
2.2. Use account-lookup code to query the still locked balance
Sum up all the locked balances and subtract it from the Total Supply
NOTE: Make sure you pin a specific block height when you query the Total Supply and every individual contract state (through the account-lookup)
Compute the value every 2 hours on the backend and store the value in memory (if the computation takes too long, consider storing it in SQLite). Expose the precomputed value via WAMP get-circulating-supply method.
Acceptance Criteria
The value is computed correctly (compare with the projection)
Non-mainnet networks return undefined
The value is re-computed every 2 hours (note: adjust the number if necessary)
The text was updated successfully, but these errors were encountered:
This is only applicable to mainnet
This issue is blocked on #478
Circulating Supply = Total Supply - Tokens locked in the Lockup contracts
Implementation Notes
Here is how to compute the value:
block
method (seeheader->total_supply
)2.1. Query Indexer for Explorer database for all the lockup accounts:
SELECT account_id FROM accounts WHERE account_id LIKE '%.lockup.near'
2.2. Use account-lookup code to query the still locked balance
NOTE: Make sure you pin a specific block height when you query the Total Supply and every individual contract state (through the account-lookup)
Compute the value every 2 hours on the backend and store the value in memory (if the computation takes too long, consider storing it in SQLite). Expose the precomputed value via WAMP
get-circulating-supply
method.Acceptance Criteria
The text was updated successfully, but these errors were encountered: