爆发 BaofaBaofa Documentation
中文 Open the App

Indexer API

The read-only JSON API behind the app's market, candles, holders and ledgers, with every route, its parameters and the response envelope.

Updated 2026-11-04Contracts baofa-rewrite-2026-11-04-a727bfe

The app reads lists, candles, holders, creator ledgers and the Frenzy programme's records from Baofa's indexer, a read-only service that follows the core's and the Frenzy diamond's events, the PancakeSwap pair of every graduated coin and coin transfers. Anything the indexer shows can be recomputed from the chain; the indexer exists so that a browser does not have to.

Conventions#

Convention Detail
Method GET only
Envelope { "data": ..., "indexed": { "block", "headBlock", "at" } }
Caching every response carries an ETag; If-None-Match is answered with 304
Cross-origin Access-Control-Allow-Origin: *
Amounts decimal strings; BNB in quote units (1e9 wei), coins in base units (6 decimals)
Pagination limit with offset (lists) or before (time cursors); the response reports the values used

Routes#

Route Returns
/v1/health chain id, deployment label, core address, indexed and head block, last error, failure and reorganisation counters
/v1/stats totals of coins, graduations, trades and volume
/v1/stats/series?interval=&limit= market-wide volume, fills and creations per time bucket (limit 1 to 400)
/v1/coins?sort=&stage=&q=&creator=&limit=&offset= the coin list with reserves, price, market cap, progress, 24 hour volume and change, holders, metadata and a sparkline. sort is one of new, cap, volume, change, graduated; stage is all, live or graduated; limit 1 to 200
/v1/coins/:coin one coin
/v1/coins/:coin/trades?limit=&before= trades, newest first; before is a timestamp cursor
/v1/coins/:coin/candles?interval=&limit= OHLC candles from one-minute buckets; interval in seconds, one of 60, 300, 900, 3600, 14400, 86400
/v1/coins/:coin/holders?limit= balances, with the curve custody, the pair and the creator labelled
/v1/accounts/:address/positions an account's balances with the net BNB spent per coin
/v1/accounts/:address/trades?limit=&before= an account's trades
/v1/accounts/:address/coins coins created by an account
/v1/accounts/:address/ledger?limit= creator fee accruals on the curve and claims
/v1/leaderboard?limit= creators by volume and traders by seven-day volume (limit 1 to 100)
/v1/frenzy/summary the Frenzy programme's totals: coins and open windows, programme trades and volume, net deployed BNB after the latest trade, burned second supplies, swept and withdrawn amounts, and whether the latest switch event paused trading
/v1/frenzy/coins?status=&limit=&offset= Frenzy coins with their window, net deployed BNB, net coins held, programme trade counts and the burn; status is all, active or ended (limit 1 to 200)
/v1/frenzy/coins/:coin one Frenzy coin's window and programme state
/v1/frenzy/trades?mint=&limit=&before= the programme's own trades, newest first, with the vault and curve state after each
/v1/frenzy/ledger?limit= vault sweeps to fee recipients, admin withdrawals and the pause and resume switches

Freshness and Reorganisations#

The indexer records progress after each bounded span of blocks and resumes after a restart. It keeps the hashes of recent blocks; when the hash of the last indexed block changes it rolls back to the newest block that still matches, resets the coins touched above it (their Frenzy rows included) and replays them from its stored events. indexed.block against indexed.headBlock in every response tells you how far behind the chain it is, and /v1/health exposes the back-off state when the RPC is failing.

Post-Graduation Data#

After graduation, trades come from the pair's Swap and Sync events. The pair names the router as the sender, so the indexer attributes each trade to the transaction's sender. Reserves from Sync are stored in quote units so the price series is continuous across graduation.

Graduation Keeper#

The indexer can run a keeper: after each sync pass it selects complete curves without a pool, simulates migrate(coin), sends it and settles the receipt on the next pass. The keeper pays only gas. A curve graduated by someone else first is skipped. Whether the keeper is running on mainnet is visible from the graduations themselves, which anyone can also trigger from the coin page.

Running Your Own#

The indexer needs an RPC URL and the deployment manifest, stores to SQLite and serves the routes above. Its source ships with the protocol repository; npm ci, a .env with RPC_URL and DEPLOYMENT, and npm start are the whole procedure.

Baofa Documentation. Built from the launch contracts package baofa-rewrite-2026-11-04-a727bfe · 2026-11-04

baofa.fun · X @baofadotfun