Start here

API reference

A keyless, CORS-open JSON API over the same reads the app uses. Base URL https://tangent.it.com. Every response carries chainId, deployed, rpc and ts (server read time, ms). Big integers are serialised as decimal strings; E6 means USDC base units, E8 means USD × 1e8, E18 means 18-decimal fixed point.

The machine-readable version of this page is GET /api/openapi.json (OpenAPI 3.1). Agents should start from GET /skill.md or the MCP server at POST /mcp.

Conventions

  • Caching. Market-data routes are served from an in-process stale-while-revalidate cache that is refreshed in the background every second; a warm response takes ~20 ms of server time. Headers: x-cache: fresh | stale, x-cache-age: <ms>, cache-control: public, max-age=1, stale-while-revalidate=4. ts in the body is when the data was read from chain, not when it was served.
  • Errors. JSON { "error": string, ...extra } with a meaningful status: 400 bad input, 404 not deployed on this chain, 409 on-chain revert (decoded; see /api/quote), 422 quoter refused (caps, eligibility), 503 upstream quoter / Hyperliquid unreachable.
  • Tokens are accepted by address or by symbol (USDC, WHYPE, UBTC, UETH, USOL, PURR). Amounts are integers in the token's base units.
  • Rate limits. None enforced today; be reasonable (the cache makes polling at 1–2 s cheap for everyone).
  • CORS *; OPTIONS returns 204.

Market data

GET /api/markets

Every market with parameters, inventory, hedge, oracle and Hyperliquid context. The primary pre-trade feed for routers.

FieldTypeMeaning
pausedboolpool-wide pause
protocolShareBpsnumbershare of spread accrued to the protocol
markets[].id / token / symbol / name / decimals / perpIndex / coinidentity
markets[].paramsbaseSpreadBps, skewSpreadBps, maxSpreadBps (number) · maxInventoryUsdE6, maxTradeUsdE6, targetInventory (string)
markets[].enabled / buyPaused / sellPausedbooltradability per direction
markets[].inventorytokenBalance (token units) · deltaTokens, deltaUsdE6 (signed, vs target) · netDeltaUsdE6 (inventory + hedge)
markets[].hedgehedgeSize (signed token units on HL) · updatedAt · ageSec
markets[].oraclemidE8 · ageSec · source (posted / native) · error
markets[].hlHyperliquid markPx, midPx, oraclePx, prevDayPx, change24hPct, funding, openInterest, dayNtlVlm, szDecimals
markets[].utilisation.inventoryPctnumberabs(deltaUsd) / maxInventoryUsd × 100
feeds[]HIP-3 price feeds the oracle also posts (equity index, gold, …) with trading hours, status and deviation

GET /api/quote

?tokenIn=&tokenOut=&amountIn= → the on-chain quote().

{ "tokenIn": { "address": "0xb47c…", "symbol": "USDC", "decimals": 6 },
  "tokenOut": { "address": "0xbA87…", "symbol": "WHYPE", "decimals": 18 },
  "amountIn": "1000000", "amountOut": "15447123456789012", "midE8": "6460100000",
  "spreadBps": "20", "protocolFeeUsdE6": "4", "executionPrice": 64.73 }

On a pool revert the route answers 409 with { error, revert, explanation?, hint? } where revert is the custom error name (TradeTooLarge, InventoryLimit, InsufficientLiquidity, ReduceOnly, DirectionPaused, StalePrice, …). Not cached: each call is a fresh eth_call.

GET /api/risk

Status board: status (ok / warning / critical), warnings[] (human-readable), paused, hedge (equityUsdE6, updatedAt, ageSec, stale, staleSec, capitalOutUsdE6, maxCapitalBps), hlAccount, riskMode (mode normal / reduce-only, worstNetDeltaUsdE6, hedgeStale), riskPolicy, and per market inventoryUsdE6, netDeltaUsdE6, maxInventoryUsdE6, maxTradeUsdE6, inventoryUtilisationPct, hedgeAgeSec, buyPaused, sellPaused.

GET /api/oracle

Oracle configuration (address, maxAgeSec, maxDeviationBps, owner), one entry per perp index with midE8, ageSec, source, posted, native, hlMarkPx, deviationBps, twap1h, twap24h ({ pxE8, coveredSec, windowSec } or null), and lastPost (tx hash, block, poster).

GET /api/pool

NAV breakdown nav { usdcE6, inventoryUsdE6, hedgeEquityUsdE6, totalE6 }, sharePriceE18, totalSupply, totalAssets, freeUsdc, protocolFeesAccrued, protocolShareBps, hedge freshness, paused, roles { owner, operator, guardian, treasury, oracle }, treasury { address, usdcBalance }, optionsLiabilityUsdE6.

GET /api/candles

?coin=HYPE&interval=1m|5m|15m|1h&hours=24 → Hyperliquid candles [{ t, o, h, l, c, v }] for the market's perp (proxied, cached 20 s).

Activity

GET /api/swaps

?blocks=2000 (100–20,000) → Swap and SwapRFQ events from the last N blocks: fromBlock, toBlock, swaps[] with txHash, blockNumber, logIndex, sender, to, tokenIn, tokenOut, amountIn, amountOut, midE8, spreadBps, protocolFeeUsdE6, venue (amm / rfq), timestamp (omit with &ts=0 for speed). For history beyond that use /api/stats.

GET /api/stats

Indexed activity from the hedger's swap index (?limit=50, max 200): day / week / all buckets with swaps, volumeUsd, spreadUsd, feeUsd, wallets, routers, buys, sells, viaHookPct; hourly[]; hl { fills, feeUsd, notionalUsd, lastFillAt, medianLagSec } (hedge execution stats); recent[] fills with txHash, block, ts, wallet, router, via, venue, token, side, usd, spreadBps, spreadUsd, feeUsd, mid; byToken. Cached 5 s.

GET /api/health

ok, rpc { ok, latencyMs, blockNumber }, hyperliquid { ok }, addresses (full address book incl. market tokens), explorer, hlAccount, cache (SWR cache status). Suitable as an uptime probe. GET /api/live is the minimal { ok, ts } variant.

RFQ

POST /api/rfq/quote

Body { "tokenIn", "tokenOut", "amountIn", "taker"? } → forwarded to the quoter.

{ "quote": { "taker": "0x…", "tokenIn": "0x…", "tokenOut": "0x…", "amountIn": "100000000000000000000",
             "amountOut": "6441000000", "spreadBps": "18", "expiry": "1796064300", "nonce": "0x…" },
  "signature": "0x…", "midE8": "6460100000", "slippageBps": 6, "spreadBps": 18, "fairOut": "6460100000",
  "expiresAt": 1796064300, "rfqAddress": "0x04d2…", "chainId": 99901, "poolAddress": "0x63E9…" }

Fill with TangentRFQ.fill(quote, signature) after approving tokenIn to rfqAddress. 503 RFQ quoter offline when the quoter is unreachable; 422 with a reason when the size breaches a cap.

GET /api/rfq/info

available, rfqAddress, quoterStatus, quoterAddress, the quoter's self-description (ttlSec, bufferBps, domain, types, minRfqSpreadBps, rfqMaxTradeUsdE6, riskMode, markets), and the on-chain configuration for cross-checking.

LP & structured products

GET /api/tranche

available, trancheAddress, tranche { seniorToken, juniorToken, seniorRateBps, minJuniorBps, totalValueUsdE6, seniorValueUsdE6, juniorValueUsdE6, seniorEntitlementUsdE6, seniorSharePriceE18, juniorSharePriceE18, seniorSupply, juniorSupply, juniorBufferBps, juniorThin }.

Options

EndpointReturns
GET /api/options/seriesactive series (seriesId, expiry, strikeE8, isCall, openInterestE18, maxOpenInterestE18, mark { … }), expiries[], liability and caps
POST /api/options/quote{ seriesId, amountE18, isBuy, trader? } → signed option quote (503 quoter offline, 422 caps)
GET /api/options/positions?address=ERC-1155 balances, cost basis, mark value, payout previews
GET /api/options/bookbook liability (intrinsic, model mark), cap utilisation, delta / gamma / vega

Rewards

EndpointReturns
GET /api/rewards/infocontract version, params, budget, Montra index counters
GET /api/rewards/status?wallet=one wallet's eligibility, claim state and payout preview
GET /api/rewards/attest?wallet=signed attestation (503 when the attestor is down)
POST /api/rewards/quote{ wallet, isCall? } → signed option quote for the rewards contract (422 when not eligible)
GET /api/rewards/montra-statsMontra swap-index counters

Calldata helpers (MCP)

The MCP server at POST /mcp (stateless streamable-HTTP, no keys, no sessions) exposes the read tools above plus calldata builders that return { to, data, value } for you to sign: swap_calldata, deposit_calldata, withdraw_calldata, rfq_quote + rfq_fill_calldata, tranche_calldata, options_quote + options_buy_calldata + options_exercise_calldata. The server never holds keys.

# quote 1,000 USDC -> WHYPE
curl -s 'https://tangent.it.com/api/quote?tokenIn=USDC&tokenOut=WHYPE&amountIn=1000000000'

# status board
curl -s https://tangent.it.com/api/risk | jq '{status, warnings, riskMode}'

# firm RFQ quote for 100 WHYPE -> USDC
curl -s https://tangent.it.com/api/rfq/quote -H 'content-type: application/json' \
  -d '{"tokenIn":"WHYPE","tokenOut":"USDC","amountIn":"100000000000000000000","taker":"0xYourFiller"}'

# MCP: list tools
curl -s https://tangent.it.com/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Versioning

Fields are only added, never renamed or removed, without a dated note on the Changelog. New markets appear in /api/markets automatically when the owner lists them on-chain.