REST API/Protocol stats
Protocol stats
GET /v1/stats aggregates open offer counts, fill counts, and rolled-up
fee + volume totals by payment mint. Useful for landing-page widgets,
internal dashboards, and external trackers.
GET /v1/stats
Response
{
"totalOffers": 312,
"openOffers": 47,
"filledOffers": 248,
"expiredOffers": 17,
"totalFills": 692,
"feesByMint": {
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "12340000",
"So11111111111111111111111111111111111111112": "920000000"
},
"volumeByMint": {
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "6170000000",
"So11111111111111111111111111111111111111112": "460000000000"
}
}feesByMint and volumeByMint are keyed by the payment mint of the
underlying offer and report the cumulative raw amount accrued at the
treasury (fees) and traded between maker and taker (volume).
Caching
The endpoint sets cache-control: public, max-age=10. Browsers and edge
caches will reuse a result for ten seconds; SDK consumers polling for
dashboards should respect that cadence.
Decoding
To convert these raw amounts to human numbers in TypeScript:
import { fmtTokenAmount, PAYMENT_OPTIONS } from "@invia-app/sdk";
const stats = await invia.api.getStats();
for (const [mint, raw] of Object.entries(stats.volumeByMint)) {
const opt = PAYMENT_OPTIONS.find((p) => p.mint.toBase58() === mint);
if (!opt) continue;
console.log(opt.label, fmtTokenAmount(raw, opt.decimals));
}