Skip to content

invariant-labs/stats

Repository files navigation

Historical data

The historical data is available inside the /data directory. The content of these files is described below:

Pool data is stored in the files below, depending on the network's location:

  • Solana: mainnet.json
  • Solana devnet: devnet.json
  • Eclipse devnet: eclipse/devnet.json
  • Aleph Zero testnet: a0/testnet.json
  • Aleph Zero mainnet: a0/mainnet.json
  • Alephium testnet: a0/testnet.json
  • Alephium mainnet: alph/mainnet.json

All of this data has the same JSON structure:

 {
    [address: string]: {
        snapshots: [
            {
               timestamp: number, // ASC
               volumeX: TokenAmount,
               volumeY: TokenAmount,
               liquidityX: TokenAmount,
               liquidityY: TokenAmount,
               feeX: TokenAmount,
               feeY: TokenAmount,
            }
        ]
        tokenX: TokenInfo
        tokenY: TokenInfo
    }
}

interface TokenInfo {
    address: string,
    decimals: number

}

interface TokenAmount {
    tokenBNFromBeginning: string, // token amount (program format)
    usdValue24: number
}

Generated data

List of snapshot files:

  • data/a0/testnet.json
  • data/a0/mainnet.json
  • data/alph/testnet.json
  • data/devnet.json
  • data/input_mainnet_pool_apy.json
  • data/mainnet.json
  • data/pool_apy_archive_devnet.json
  • data/pool_apy_archive_mainnet.json
  • data/pool_apy_devnet.json
  • data/pool_apy_mainnet.json
  • data/ticks
    • devnet
      • [tick_address.json]
      • ...
    • mainnet
      • [tick_address.json]
      • ...

Querying archive data

There is an API that allows querying historical data for specific pools

https://stats.invariant.app/[*UNDERLYING_VM]/pool_daily_data/[NETWORK]/aggregated/[**POOL_ADDRESS]?{limit=N}

*solana, alph or a0 **for Aleph Zero and Alephium POOL_ADDRESS is stringified PoolKey

Below is an example of a query:

https://stats.invariant.app/svm/pool_daily_data/mainnet/aggregated/BRt1iVYDNoohkL1upEb8UfHE8yji6gEDAmuN9Y4yekyc?limit=10

Scripts

Cumulative Stats

Usage:

npm run get-cumulative-stats -- <chain> <network> <startTimestamp> <endTimestamp>

Possible chains: solana, eclipse, aleph-zero, alephium, vara Possible networks: mainnet, testnet, devnet

Most popular pool addresses

Token X Token Y Fee Address
USDC USDT 0.001% BRt1iVYDNoohkL1upEb8UfHE8yji6gEDAmuN9Y4yekyc
stSOL mSOL 0.01% HbMbeaDH8xtB1a8WpwjNqcXBBGraKJjJ2xFkXEdAy1rY
SNY USDC 0.3% AvNeVrKZy1FaEG9suboRXNPgmnMwomiU5EvkF6jGxGrX

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages