Endpoints Overview
Read-Only Endpoints (GET)
/health
Health check with account counts
/tokens
All supported tokens with metadata
/prices
Current prices for all tokens
/prices/{symbol}
Current price for a single token
/perpetuals
All perpetuals config accounts
/perpetuals/{pubkey}
Single perpetuals account
/pools
All pools
/pools/{pubkey}
Single pool
/custodies
All custodies
/custodies/{pubkey}
Single custody
/markets
All markets
/markets/{pubkey}
Single market
/positions
All positions (optional ?owner= filter)
/positions/{pubkey}
Single position — raw data
/orders
All orders (optional ?owner= filter)
/orders/{pubkey}
Single order — raw data
/positions/owner/{owner}
Enriched positions for a wallet
/orders/owner/{owner}
Enriched orders for a wallet
/pool-data
All pool snapshots (cached, 15s refresh)
/pool-data/{pool_pubkey}
Single pool snapshot
/pool-data/status/initialized
Cache initialization status
Transaction Builder Endpoints (POST)
/transaction-builder/open-position
Preview + build open position transaction
/transaction-builder/close-position
Preview + build close position transaction
/transaction-builder/add-collateral
Preview + build add collateral transaction
/transaction-builder/remove-collateral
Preview + build remove collateral transaction
/transaction-builder/reverse-position
Preview + build reverse (flip) position transaction
Preview Endpoints (POST)
/preview/limit-order-fees
Preview fees for a limit order
/preview/exit-fee
Preview exit fee for closing a position
/preview/tp-sl
Preview take-profit / stop-loss calculations
/preview/margin
Preview adding or removing margin
Health & Tokens
GET /health
bash
json
GET /tokens
Returns all supported tokens with metadata: symbol, mint address, decimals, and price feed IDs.
bash
json
Prices
GET /prices
bash
json
price
Raw integer from the oracle
exponent
Decimal shift — divide by 10^abs(exponent)
price_ui
Human-readable price — use this for display
timestamp_us
Last update time in microseconds since epoch
GET /prices/{symbol}
bash
Symbol is case-insensitive: SOL, BTC, ETH, etc.
Raw Account Data
These endpoints return on-chain account data as JSON. Useful for building custom UIs or running your own calculations.
Each supports /{pubkey} for a single account lookup.
Positions (Raw)
Orders (Raw)
Enriched Positions
Returns computed, human-readable position data with PnL, leverage, liquidation prices, and more. Use this for building trading UIs.
owner
yes
Wallet pubkey (base58)
includePnlInLeverageDisplay
yes
Include PnL in leverage calculation (true or false)
Example response:
json
Field notes:
sideUi,marketSymbol, and other enriched fields may benullif enrichment fails (e.g., market delisted or price unavailable).keyandpositionAccountDataare always present for fallback raw decoding.positionAccountDatais base64-encoded raw Anchor account bytes — decode withprogram.coder.accounts.decode('position', data)in JS/TS.sizeAmountUiKmbformats large numbers:1500→"1.50K",2500000→"2.50M".isDegenistruefor degen mode positions, otherwise omitted.pnl.profitUsd/pnl.lossUsdare raw native values (6 decimals). UsepnlWithFeeUsdUifor display.Positions are sorted by size, largest first.
Enriched Orders
owner
yes
Wallet pubkey (base58)
Returns limit orders, take-profit orders, and stop-loss orders grouped by order account.
Example response:
json
Field notes:
limitTakeProfitPriceUiandlimitStopLossPriceUiare"-"when not set.typeis"TP"for take-profit,"SL"for stop-loss.leverageis an empty string""for TP/SL orders.
Pool Data
Pre-computed pool metrics including AUM, LP stats, and custody utilization. Cached and refreshed every 15 seconds.
Last updated
Was this helpful?

