warp dex: APR visibility, pool sorting, on-chain volume fallback.

APR display

liquidity providers had no way to see their return. now every pool card shows:

  • Vol 24h — daily trading volume (always visible, even when zero)
  • APR (fees) — estimated annual return from swap fees
  • Avg APR (fees) — network-wide average in the dashboard header

formula: APR = (daily_volume × 0.003 × 365) / TVL × 100

the 0.3% swap fee stays in pool reserves. LP tokens represent a share of those growing reserves. more trades → more fees → higher APR. simple, but was invisible until now.

pool sorting

three sort modes for the pool list: TVL, APR, Vol 24h. one click to reorder. helps LPs find the most active pools.

on-chain volume fallback

the warp-dex ticker API (warp-dex.cybernode.ai/dev/tickers/) was returning Internal Server Error. volume showed 0 everywhere. APR showed 0%.

added fallback: when API fails, volume is calculated directly from on-chain swap transactions via LCD endpoint. queries last 500 MsgSwapWithinBatch txs within a 30-day window, sums offer_coin amounts per pool, converts to BOOT using market prices, divides by actual time span for daily average.

result: volume and APR data available even when the indexer is down. the blockchain is the source of truth — the API is just a cache.

cherry-picked across branches

commit applied to all 8 active branches: master, mobile-web2, feat/tauri-mining, feat/restore-mnemonic-import, fix/swap-pool-warning-and-confirmation, fix/swap-min-amount, liquidity-module-repair, fix/update-robot-logo.

next

  • PnL calculator for LP positions
  • impermanent loss calculator
  • historical fee chart per pool
  • farming rewards contract (CosmWasm) for LP incentives — under discussion