Endpoints Overview

Read-Only Endpoints (GET)

Path
Description

/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)

Path
Description

/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)

Path
Description

/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

Field
Description

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.

Parameter
Required
Description

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 be null if enrichment fails (e.g., market delisted or price unavailable). key and positionAccountData are always present for fallback raw decoding.

  • positionAccountData is base64-encoded raw Anchor account bytes — decode with program.coder.accounts.decode('position', data) in JS/TS.

  • sizeAmountUiKmb formats large numbers: 1500"1.50K", 2500000"2.50M".

  • isDegen is true for degen mode positions, otherwise omitted.

  • pnl.profitUsd / pnl.lossUsd are raw native values (6 decimals). Use pnlWithFeeUsdUi for display.

  • Positions are sorted by size, largest first.


Enriched Orders

Parameter
Required
Description

owner

yes

Wallet pubkey (base58)

Returns limit orders, take-profit orders, and stop-loss orders grouped by order account.

Example response:

json

Field notes:

  • limitTakeProfitPriceUi and limitStopLossPriceUi are "-" when not set.

  • type is "TP" for take-profit, "SL" for stop-loss.

  • leverage is 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?