_gammadocs
API Reference

API overview

Programmatic access to the _gamma protocol — read vault and portfolio data and build unsigned deposit/withdraw transactions.

The _gamma API gives partners programmatic access to the protocol: read vault directories, NAV, statistics, allocations, and per-wallet portfolio data, and build unsigned deposit and withdraw transactions that your own wallet signs and submits.

Base URL

All endpoints live under /api.

Environment Base URL
Production https://app.gma.fi
Beta https://beta.gma.fi

Examples in this reference use https://app.gma.fi.

Response envelope

Every JSON endpoint returns the same envelope. On success:

{
  "success": true,
  "data": { }
}

On error:

{
  "success": false,
  "error": "Human-readable message",
  "details": "optional, dev-only extra context"
}

Always branch on success rather than inferring status from the HTTP code alone.

Tiers

The API has two tiers:

  • Keyless (public)GET /api/circulating-supply and GET /api/oracle. No credential; Access-Control-Allow-Origin: *; cached at the edge (~60s). See Public endpoints.
  • Partner (API-key gated) — everything else. Requires an Authorization: Bearer gma_api_... header. Keys carry a read or write scope and may be restricted to specific vaults and a single wallet. See Authentication.

Rate limits

  • Keyless endpoints are rate limited per client IP at roughly 20 requests / 5 seconds.
  • Partner endpoints are rate limited per API key using the key's configured per-minute limit (RPM), keyed by the key ID.

Rate-limited responses return HTTP 429 with X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After headers. Successful partner responses also carry the X-RateLimit-* headers so you can pace requests. Be a good citizen and back off on 429.

Units

Token amounts are returned in Solana-style objects ({ mint, symbol, amount, decimals, uiAmount }) where amount is raw lamports (smallest unit) and uiAmount is the human value.

APY and PnL fields are fractional decimals (0.0824 = 8.24%) unless a page states otherwise. Two endpoints return percent values instead — portfolio-history and the pnlPct field of pnl-history — and both call this out explicitly. Read the unit notes on Vault endpoints before charting anything.

Next: Authentication