Astro Aggregator App is responsible for synchronization historical data from DAO Contracts with the Database.
After starting microservice runs initial aggregation for all DAOs:
- Get list of all DAOs.
- For each DAO run aggregation that sync DAO data from NEAR RPC with the Database.
- Save all transactions that has been aggregated.
When initial aggregation finished, schedule next aggregations with intervals defined in env variables:
- Get last saved transaction timestamp.
- Get list of all receipts from Indexer DB by Sputnik contract name.
- For each update call Transaction Handler to update service Database depending on method name and arguments (If needed sync required data with Near RPC).
Interval configured by AGGREGATOR_POLLING_INTERVAL
env variable in milliseconds (2 seconds by default).
- Get last FT token update timestamp.
- Get list of all likely token updates (token id + DAO) by Sputnik contract name.
- For each Token + DAO pair get DAO token balance from RPC and update token balances in service Database.
- Get last NFT token update timestamp.
- Get list of all NFT events made after last update filtered by Sputnik contract.
- For each NFT + DAO pair get DAO NFTs from RPC and update NFT owners in service Database.
Interval configured by AGGREGATOR_TOKEN_POLLING_INTERVAL
env variable in milliseconds.
- Get current token prices from RefFinance API
- Update token prices in service Database.
- Update DAO balances due to token prices update.
Interval configured by AGGREGATOR_TOKEN_PRICES_POLLING_INTERVAL
env variable in milliseconds.