Create a pool analytics view that gives users a clear picture of a pool's health and activity — reserves, fee tier, TVL, and volume
statistics. Inspired by the https://app.uniswap.org/explore/pools/ethereum/0x21b8065d10f73EE2e260e5B47D3344d3Ced7596E.
Volume and transaction history are not stored on-chain but can be derived by indexing the sequence of Swap, AddLiquidity, and NewDefinition instructions submitted to the pool over time.
View Layout
Pool header
- Token pair name and fee tier badge (e.g. TOKEN_A / TOKEN_B — 0.30%)
- Pool PDA address
- Quick-action buttons: Swap (links to Swap view with pair pre-filled) and Add Liquidity (links to New Position view with pair + fee tier
pre-filled)
Reserve breakdown
- Current reserve amounts for Token A and Token B
- Reserve ratio / current exchange rate (Token A per Token B and inverse)
Volume chart
- Bar chart of swap volume over time (default: 1D buckets over the last 30 days; toggle between 1D / 1W / 1M views)
- Hover/tap on a bar shows the volume and fee revenue for that period
TVL chart
- Line chart of TVL over time, driven by snapshots of reserve_a + reserve_b captured at each liquidity event (NewDefinition, AddLiquidity,
RemoveLiquidity)
- Same time-range toggles as the volume chart
Technical Notes
- Volume, fees, and TVL history require an indexing layer that replays submitted instructions in order; this may be a separate backend
concern — the view should be designed to consume a simple API or query interface that this indexer exposes
- TVL expressed purely in token units is always available on-chain; fiat/USD conversion is optional and depends on price feed availability
- The pool is identified by its PDA, derivable via compute_pool_pda(amm_program_id, token_a_definition_id, token_b_definition_id)
References
Create a pool analytics view that gives users a clear picture of a pool's health and activity — reserves, fee tier, TVL, and volume
statistics. Inspired by the https://app.uniswap.org/explore/pools/ethereum/0x21b8065d10f73EE2e260e5B47D3344d3Ced7596E.
Volume and transaction history are not stored on-chain but can be derived by indexing the sequence of Swap, AddLiquidity, and NewDefinition instructions submitted to the pool over time.
View Layout
Pool header
pre-filled)
Reserve breakdown
Volume chart
TVL chart
RemoveLiquidity)
Technical Notes
concern — the view should be designed to consume a simple API or query interface that this indexer exposes
References