API

Market data

Public reads. Prices, rules, depth, the tape, funding and rankings.

Nothing on this page needs a key. Every route here is cached server-side and shared across callers, so the answer you get is the answer the app's own screens are rendering.

Symbols are always PERP_<BASE>_USDC. A bare ETH is rejected with invalid_request. Resolve a name against /api/prep/markets before anything else.

GET/api/prep/markets

The moving half of the market data: prices, 24h statistics, funding and open interest. Active markets only, sorted by 24h quote volume, descending. Cached for five seconds.

Response
{
  "markets": [
    {
      "symbol": "PERP_ETH_USDC",
      "display_symbol_name": "ETH",
      "status": "ACTIVE",
      "index_price": 2412.55,
      "mark_price": 2412.61,
      "sum_unitary_funding": 12.4471,
      "est_funding_rate": 0.0000125,
      "last_funding_rate": 0.0000098,
      "next_funding_time": 1717174800000,
      "open_interest": 18422.4,
      "24h_open": 2380.1,
      "24h_close": 2412.61,
      "24h_high": 2440.0,
      "24h_low": 2361.2,
      "24h_volume": 91422.5,
      "24h_amount": 220144821.3,
      "base": "ETH",
      "change24hPct": 1.3659
    }
  ]
}

base and change24hPct are computed here; everything else is the upstream row. change24hPct is a percentage, not a fraction, and is zero when the open was zero.

GET/api/prep/market-rules

The static half: tick sizes, notional limits, precision and maximum leverage. Cached for an hour, because these change when a market is relisted and almost never otherwise. Join it to the prices on your side rather than re-downloading it on a poll.

Response
{
  "rules": [
    {
      "symbol": "PERP_ETH_USDC",
      "maxLeverage": 50,
      "info": {
        "symbol": "PERP_ETH_USDC",
        "display_symbol_name": "ETH",
        "quote_min": 0,
        "quote_max": 100000,
        "quote_tick": 0.01,
        "base_min": 0.001,
        "base_max": 1000,
        "base_tick": 0.0001,
        "min_notional": 10,
        "price_range": 0.03,
        "price_scope": 0.4,
        "funding_period": 8,
        "cap_funding": 0.0075,
        "floor_funding": -0.0075,
        "base_imr": 0.02,
        "base_mmr": 0.01
      }
    }
  ]
}
  • base_tick is the quantity step. An order size that is not a multiple of it is rejected.
  • quote_tick is the price step for a limit order.
  • min_notional is the smallest order value. Size times price must clear it.
  • maxLeverage is derived here as the reciprocal of base_imr, rounded, because the leverage is not published directly.

GET/api/prep/orderbook

ParameterTypeRequiredNotes
symbolstringyesPERP_<BASE>_USDC. Anything else is invalid_request.

Never cached: a stale book is worse than no book. Prices and quantities are strings, not numbers.

Response
{
  "symbol": "PERP_ETH_USDC",
  "mid_price": "2412.58",
  "spread": "0.06",
  "asks": [{ "price": "2412.61", "quantity": "4.2" }],
  "bids": [{ "price": "2412.55", "quantity": "6.8" }],
  "ts": 1717171717171
}
mid_price and spread are null when either side of the book is empty, which happens on a thin market and is not an error. Test them before formatting; treating null as a number prints a mid price of 0 and a spread of 0 on a one-sided book, which reads as a real quote. ts is the snapshot's own timestamp in milliseconds, so a caller can tell a fresh book from one it has already drawn.

GET/api/prep/candles

ParameterTypeRequiredNotes
symbolstringyesPERP_<BASE>_USDC.
intervalstringnoOne of 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w. Defaults to 1h. Anything else is invalid_request.
limitnumbernoClamped to 1 to 500. Defaults to 100.
Response
{
  "rows": [
    {
      "open": "2380.10",
      "high": "2440.00",
      "low": "2361.20",
      "close": "2412.61",
      "volume": "91422.5",
      "timestamp": 1717171200000
    }
  ]
}

GET/api/prep/trades

ParameterTypeRequiredNotes
symbolstringyesPERP_<BASE>_USDC.
limitnumbernoClamped to 1 to 200. Defaults to 50.
Response
{
  "trades": [
    {
      "symbol": "PERP_ETH_USDC",
      "side": "BUY",
      "executed_price": 2412.61,
      "executed_quantity": 0.4,
      "executed_timestamp": 1717171717171
    }
  ]
}

The public tape. It carries no identity: there is no address on a fill and no way to attribute one.

GET/api/prep/funding

ParameterTypeRequiredNotes
symbolstringyesPERP_<BASE>_USDC.
Response
{
  "symbol": "PERP_ETH_USDC",
  "est_funding_rate": 0.0000125,
  "last_funding_rate": 0.0000098,
  "next_funding_time": 1717174800000,
  "sum_unitary_funding": 12.4471
}

A positive rate means longs pay shorts. Every market carries est_funding_rate on /api/prep/markets too, so ranking the whole board takes one call rather than one per symbol.

GET/api/prep/config

No parameters. The account-level leverage ladder, parsed into numbers and cached for an hour.

{ "leverageSteps": [1, 2, 3, 4, 5, 10, 20, 50] }

GET/api/prep/tokens

No parameters. Collateral assets and their per-chain details, cached for an hour.

Response
{
  "rows": [
    {
      "token": "USDC",
      "decimals": 6,
      "chain_details": [
        { "chain_id": "42161", "withdraw_fee": 1.0, "decimals": 6 }
      ]
    }
  ]
}
This is a forwarded upstream payload and the code declares only the three fields shown per chain. The rows also carry a contract_address, which /api/prep/deposit-chains reads to build its own answer, and may carry more. Do not treat the declared subset as the full shape.

GET/api/prep/deposit-chains

No parameters. Chains this venue accepts settlement-asset deposits on, joined with the USDC address on each. A chain with no USDC address is dropped, because it cannot be deposited from whatever the vault list says.

Response
{
  "rows": [
    {
      "chainId": 42161,
      "name": "Arbitrum",
      "vault": "0x<20 byte address>",
      "usdc": "0x<20 byte address>",
      "explorer": "https://arbiscan.io",
      "nativeSymbol": "ETH",
      "withdrawalFee": 1.0,
      "decimals": 6
    }
  ]
}
decimals is per chain and never assumed. BNB Chain's USDC is 18 decimals where most are 6. Reading the wrong one is a thousand-fold error in an amount.

GET/api/prep/insurance-fund

No parameters. The balance of the fund that backstops liquidations. The handler forwards the upstream object without reshaping it and the code declares it only as an object, so the field names are not documented here rather than guessed at. Call it once and read what comes back.

GET/api/prep/liquidations

ParameterTypeRequiredNotes
sizenumbernoClamped to 1 to 100. Defaults to 20.

The exchange-wide liquidation feed, as { "rows": [...] }. The row shape is the upstream's and the code declares it only as an object, so it is not written out here.

GET/api/prep/leaderboard

ParameterTypeRequiredNotes
windowstringno24h, 7d or 30d. Anything else falls back to 24h.
sortstringnovolume, pnl or notional. Anything else falls back to volume.
limitnumbernoDefaults to 50, clamped to 1 to 200.

An invalid parameter falls back rather than failing: a leaderboard is a browsing surface, and refusing to render one because a query string was mistyped serves nobody. window applies to volume and pnl only — open notional is the book as it stands now, so sorting by notional ignores the window rather than quietly meaning something by it.

Response
{
  "rows": [
    {
      "address": "0x1234…abcd",
      "rank": 1,
      "volume": 91422533.1,
      "pnl": 184221.7,
      "notional": 4210044.9
    }
  ],
  "total": 50,
  "updatedAt": 1717171717171
}

total is how many ranked rows this response carries, not how many traders the platform has. There is no grand total to report, so none is invented.

The ranking is a snapshot that is rebuilt periodically, not a live feed, and it can be around half an hour behind. updatedAt is when it was last rebuilt, in milliseconds, and is null if the upstream did not say. Show it rather than presenting the board as live: a trader looking for a fill they just made will otherwise conclude it is missing.
Addresses are shortened before they leave the server and the full value is never sent. There is no parameter that returns it, and rows cannot be joined back to an identity.

GET/api/prep/whales

ParameterTypeRequiredNotes
limitnumbernoDefaults to 25, clamped to 1 to 200.

The same rows and the same shape as the leaderboard, fixed to a 24h window and sorted by open notional. Size is what moves a market, and it is the one of the two that a lucky week cannot fake.

GET/api/prep/points

ParameterTypeRequiredNotes
addressstringyes0x and 40 hex characters. Anything else is invalid_address.

Merits earned by one address, plus the epoch dates. The rewards module is enabled per operator and is not switched on for this one, so this answers 200 with enabled false rather than an error: a feature that is off is a configuration state, not a fault.

Response while the module is off
{ "enabled": false, "merits": null, "epochs": null }

When it is switched on, merits and epochs carry the upstream payloads and enabled becomes true. A timeout or a rate limit still surfaces as an error, because reporting an outage as a feature flag would hide it.

GET/api/prep/op/{id}

One dispatcher for every catalogued read. Path parameters are supplied in the query string, substituted into the upstream path and encoded, so a value cannot escape its segment. Only the parameters listed for an operation are forwarded; anything else is dropped rather than passed along.

  • An unknown id is not_found, because the catalogue is published and asking for something absent from it is a stale client.
  • A missing required parameter is invalid_request naming the parameter.
  • broker_id, where an operation takes one, is always set to this operator's. A caller cannot ask about another.
  • Named routes win over this one. /api/prep/markets keeps its own shaped response; everything else falls through to here.
Example
curl 'https://swapmos.com/api/prep/op/funding.history?symbol=PERP_ETH_USDC&size=50'

The response is the upstream payload for that operation, scrubbed, at the top level. These are pass-throughs, so their field names are the upstream's and are not restated here. Cache-control is set from the operation's own cache lifetime, or no-store when it is zero.

markets

idParametersCache
markets.listEvery listed market with its 24h statistics.None5s
markets.getOne market's current statistics.symbolRequired5s
markets.rulesOrder rules and precision limits for every market.None3600s
markets.rulesForOrder rules and precision limits for one market.symbolRequired3600s
markets.priceChangesPrice change over several windows for every market.None15s
markets.openInterestTrader open interest across every market.None30s
markets.historyChartsHistorical price series for every market.time_intervalRequired60s
markets.tradesRecent public fills for one market.symbolRequiredlimitOptionalNo store
markets.indexSourcesWhich exchanges feed each index price.None3600s
markets.leverageMaximum leverage available per market.None3600s

funding

idParametersCache
funding.predictedPredicted funding rate for every market.None30s
funding.getPredicted funding rate for one market.symbolRequired30s
funding.historyHistorical funding rates for one market.symbolRequiredstart_tOptionalend_tOptionalpageOptionalsizeOptional60s
funding.marketHistoryFunding rate history across every market.None60s

platform

idParametersCache
platform.statusWhether the exchange is in maintenance.None30s
platform.tokensCollateral assets and their per-chain addresses.None3600s
platform.chainsNetworks deposits and withdrawals are supported on.broker_idOptional3600s
platform.leverageConfigThe account-level leverage ladder.None3600s
platform.insuranceFundBalance of the fund backing liquidations.None60s
platform.vaultBalanceCollateral held in settlement vaults per chain.None60s
platform.announcementsExchange-wide notices.None300s
platform.tvlTotal value locked.None300s
platform.volumeTraded volume over time.None300s
platform.announcementsV2Active platform notices with localized translations.None30s
platform.ipInfoDetected IP address and coarse location of the caller.NoneNo store

liquidations

idParametersCache
liquidations.openPositions currently being liquidated.symbolOptionalpageOptionalsizeOptional5s
liquidations.historyPositions that have been liquidated.symbolOptionalstart_tOptionalend_tOptionalpageOptionalsizeOptional30s

charts

idParametersCache
charts.configCharting library configuration.None3600s
charts.symbolsCharting symbol metadata.groupRequired3600s
charts.historyCharting history bars.symbolRequiredresolutionRequiredfromOptionaltoOptionalcountbackOptional10s
charts.klineHistoryCandle history for one market.symbolRequiredtypeOptionalresolutionRequiredfromRequiredtoRequired10s

rewards

idParametersCache
rewards.epochsStart and end dates of every epoch.None3600s
rewards.stagesReward stages and their status.broker_idOptionalstage_idOptionalstatusOptional300s
rewards.rankingsRankings within a reward stage.broker_idOptionalstageRequiredperiodRequiredpageOptionalsizeOptional60s
rewards.userMeritsMerits earned by one address.addressRequired60s

referral

idParametersCache
referral.verifyWhether a referral code exists.referral_codeRequired60s
referral.checkWhether an account already holds a referral code.account_idRequired60s

campaigns

idParametersCache
campaigns.listTrading campaigns that have run.None300s
campaigns.statsStatistics for one campaign.campaign_idRequired60s
campaigns.rankingStandings within one campaign.campaign_idRequiredpageOptionalsizeOptionalsort_byOptional60s
campaigns.userOne address's standing in a campaign.campaign_idRequiredaddressRequired60s
campaigns.statsDetailsTrading volume and participant counts for one campaign, optionally grouped.campaign_idRequiredbroker_idOptionalsymbolsOptionalgroup_byOptional60s
campaigns.checkChecks whether a wallet meets a campaign metric threshold.campaign_idRequiredtypeRequiredaddressRequiredlower_boundaryRequiredcmpOptional30s

staking

idParametersCache
staking.overviewStaking totals and current rates.None300s
staking.poolInfoReward pool details.None300s
staking.batchInfoReward distribution batches.None300s
staking.buybackRevenue directed to buybacks.None300s
staking.balanceTotal staked balance for one wallet, split by liquid and escrowed token.addressRequired30s
staking.unstakeDetailsPending unstake amount and unlock time for one wallet.addressRequired30s
staking.vestingListVesting schedule entries for escrowed rewards held by one wallet.addressRequiredis_vestingRequired30s
staking.valorBatchInfoSettlement batch windows for the revenue-share program.None30s
staking.valorPoolInfoTreasury pool size, point price and next settlement date for revenue share.None30s
staking.valorRedeemPending and available USDC redemption amounts per chain for one wallet.addressRequired30s
staking.valorRedeemV2Per-batch redemption amounts and escrowed token balance for one wallet.addressRequired30s

account

idParametersCache
account.existsWhether an account has been created for an address.addressRequiredbroker_idOptionalchain_typeOptionalNo store
account.keyInfoWhether a trading key is still active on an account.account_idRequiredkeyRequiredaddressOptionalbroker_idOptionalkey_statusOptionalNo store
account.existsByAccountIdCheck whether an account id is registered and which builder owns it.account_idOptionalNo store
account.registeredBuildersWhich builders a wallet address is already registered with.addressRequiredchain_typeOptional30s

builder

idParametersCache
builder.dailyRevenueDaily fee revenue settlement history for a builder.broker_idRequiredstart_dateRequiredend_dateRequired60s
builder.listList onboarded builders, or look up one by id.broker_idOptional3600s
builder.statsPer-builder statistics including connected user counts.broker_idOptional60s
builder.marketVolumeMarket-level volume and stats, filterable by market or builder.symbolOptionalbroker_idOptional30s
builder.listOrderTagsList the order tag configurations for a brokerbroker_idRequiredsymbolOptionalenum_idOptionalinclude_archivedOptional30s
builder.getOrderTagOne order tag configuration for a brokerbroker_idRequiredenum_idRequired30s

vault

idParametersCache
vault.strategyNonceFetch the next nonce for a strategy vault operationNoneNo store
vault.infoDetails for one strategy vault, or all of themvault_idOptionalstatusOptionalbroker_idsOptional30s
vault.overallStatsAggregate statistics across all strategy vaultsbroker_idsOptional30s
vault.userOverallStatsOne wallet's combined position across every strategy vaultwallet_addressRequired30s
vault.performancePerformance metrics for one strategy vault across standard time rangesvault_idRequired60s
vault.performanceChartTVL or PnL history series for one strategy vaultvault_idRequiredtypeRequiredtime_rangeRequired60s
vault.positionsOpen positions currently held by one strategy vaultvault_idRequiredNo store
vault.openOrdersOpen orders, standard and algo, for one strategy vaultvault_idRequiredsymbolOptionalsort_byOptionalpageOptionalsizeOptionalNo store
vault.orderHistoryPaginated order history for one strategy vault, including algo ordersvault_idRequiredsymbolOptionalsort_byOptionalpageOptionalsizeOptional60s
vault.tradeHistoryPaginated executed-trade history for one strategy vaultvault_idRequiredsymbolOptionalsort_byOptionalpageOptionalsizeOptional60s
vault.liquidatorHistoryPaginated liquidation events assigned to one strategy vaultvault_idRequiredsymbolOptionalpageOptionalsizeOptional60s
vault.lpInfoLiquidity provider holdings and share balances for a wallet, per vaultwallet_addressRequiredvault_idOptional30s
vault.lpPerformanceLiquidity provider PnL and drawdown over 24h, 7d, 30d and all timevault_idRequiredwallet_addressRequired60s
vault.lpPerformanceChartLiquidity provider TVL or PnL time series for a chartvault_idRequiredwallet_addressRequiredtypeRequiredtime_rangeRequired60s
vault.lpTransactionHistoryPaginated deposit and withdrawal history for a liquidity providervault_idRequiredwallet_addressRequiredtypeOptionalchain_idOptionalsourceOptionalpageOptionalsizeOptional60s
vault.lpClaimInfoAmount a liquidity provider can currently claim on one chainvault_idRequiredwallet_addressRequiredchain_idRequired30s
vault.lpFeesHistoryPaginated performance-fee charges against a liquidity providervault_idRequiredwallet_addressRequiredpageOptionalsizeOptional60s
vault.strategyProviderInfoStrategy provider NAV, share split, reserved collateral and lifetime PnLvault_idRequiredwallet_addressRequired30s
vault.providerTransactionHistoryPaged deposit/withdrawal history for one strategy provider in a vaultvault_idRequiredwallet_addressRequiredtypeOptionalchain_idOptionalsourceOptionalpageOptionalsizeOptional60s
vault.providerClaimInfoClaimable amount for one strategy provider on a given chainvault_idRequiredwallet_addressRequiredchain_idRequired30s
vault.providerFeesHistoryPaged performance-fee history for one strategy provider in a vaultvault_idRequiredwallet_addressRequiredpageOptionalsizeOptional60s
vault.fundInfoStrategy fund details: NAV, lifetime PnL, share price, current period, fee ratevault_idRequiredwallet_addressRequired30s
vault.fundPeriodInfoPaged period history and per-period instructions for a strategy fundvault_idRequiredwallet_addressRequiredperiod_numberOptionalpageOptionalsizeOptional60s
vault.fundPendingTransactionsPreview of pending user deposits and withdrawals for a strategy fundvault_idRequiredwallet_addressRequired30s