PhoenixPerpetualsDocs API v1
Get an API key

API reference

Streams⁠.

Every frame of the account stream and of market data, with every field, as the AsyncAPI document describes them. How to use them: the Streams guide.

Account stream

wss://api.phoenixperpsfunding.com/v1/stream
wss://sandbox-api.phoenixperpsfunding.com/v1/stream

Orders, fills, positions, strategies and live risk of your accounts as they change: a snapshot of each account, then every event once, with resume.

What the server sends

type: hello

First, on every connection: the accounts your key reaches.

  • typestringrequired

    The frame.

    One ofhello

  • sessionstringrequired

    This connection.

  • environmentstringrequired

    The environment of the host you called.

    One oflivesandbox

  • heartbeat_msintegerrequired

    How often a heartbeat comes.

  • accountsarray of stringrequired

    Account numbers.

type: snapshot

An account as it stands, once per account you subscribe to: build your state from it.

  • typestringrequired

    The frame.

    One ofsnapshot

  • account_idstringrequired

    The account number.

  • ordersarray of Orderrequired

    Its working orders.

    Show 26 fields
    • idstringrequired

      The order.

    • client_order_idstring or nullrequired

      Your own id for it, when it was placed through the API.

    • account_idstringrequired

      The account number.

    • marketstringrequired

      A market id: the asset and USD; an option adds its venue or hours after a dot.

    • sidestring or nullrequired

      The order's side; null for an order placed elsewhere before the API saw it.

      One ofbuysell

    • typestring or nullrequired

      The order's type.

      One ofmarketlimitstop_marketstop_limittake_markettake_limit

    • statusstringrequired

      unconfirmed: the engine has not confirmed its last state yet.

      One ofpendingworkingfilledcanceledrejectedexpiredunconfirmed

    • sizedecimal string or nullrequired

      The size, in the base asset.

    • filled_sizedecimal string or nullrequired

      How much filled.

    • limit_pricedecimal string or nullrequired

      Its limit price.

    • stop_pricedecimal string or nullrequired

      Its trigger price.

    • average_fill_pricedecimal string or nullrequired

      The average fill price.

    • feedecimal string or nullrequired

      The fee its fill paid.

    • reduce_onlyboolean or nullrequired

      It may only reduce a position; null when not known (placed elsewhere).

    • time_in_forcestringrequired

      How long it rests.

      One ofgtcgtdiocfok

    • expires_atinteger, Unix ms or nullrequired

      A gtd order: when it expires (it ends expired then); null otherwise.

    • post_onlyboolean or nullrequired

      It may only rest, never fill at once; null when not known (placed elsewhere).

    • sourcestringrequired

      Where it was placed: this API, an AI assistant (the MCP server), a trading platform, a strategy, a TradingView alert, or the system (a liquidation).

      One ofapimcpplatformstrategytradingviewsystem

    • strategy_idstring or nullrequired

      The strategy that placed it (source strategy).

    • exitsobject or nullrequired

      Exits attached to it (orders placed through the API).

    • cancel_reasonstring or nullrequired

      Why it was canceled.

      One ofusercancel_allflattenclose_allposition_closedposition_reversedclose_assistocoreplacedstrategykey_loss_stoprisk_rulesystem_restartexternal

    • rejectobject or nullrequired
      Show 2 fields
      • codestringrequired

        The error code.

      • messagestring or nullrequired

        What happened.

    • created_atinteger, Unix ms or nullrequired

      When it was placed.

    • filled_atinteger, Unix ms or nullrequired

      When it filled.

    • canceled_atinteger, Unix ms or nullrequired

      When it was canceled.

    • updated_atinteger, Unix ms or null

      Its latest change.

  • positionsarray of Positionrequired

    Its open positions.

    Show 18 fields
    • idstringrequired

      This position, while it stays open on the same side.

    • marketstringrequired

      A market id: the asset and USD; an option adds its venue or hours after a dot.

    • sidestringrequired

      Long or short.

      One oflongshort

    • sizedecimal stringrequired

      The size, in the base asset.

    • entry_pricedecimal string or nullrequired

      The average entry price.

    • mark_pricedecimal string or nullrequired

      The market price it is valued at.

    • notionaldecimal string or nullrequired

      Its value at that price.

    • unrealized_pnldecimal string or nullrequired

      Its open P&L.

    • leverageintegerrequired

      Its leverage.

    • margin_modestringrequired

      Its margin mode.

      One ofisolatedcross

    • initial_margindecimal string or nullrequired

      The margin it took at entry.

    • added_margindecimal string or nullrequired

      Margin you added to it.

    • margindecimal string or nullrequired

      What it holds of the balance.

    • liquidationobject or nullrequired
      Show 3 fields
      • pricedecimal string or nullrequired

        The price at which it is liquidated; null when there is none or it depends on several positions.

      • distance_pctdecimal string or nullrequired

        How far the market price is from it, in percent.

      • account_widebooleanrequired

        Cross margin on several markets: no single price, every one of them moves it.

    • breach_pricesobjectrequired
      Show 2 fields
      • daily_lossdecimal string or nullrequired

        The price at which this position alone would breach the daily loss limit.

      • max_drawdowndecimal string or nullrequired

        The price at which it alone would breach the max drawdown.

    • exitsobjectrequired
      Show 2 fields
      • take_profitarray of ExitLegrequired

        Limit orders on the closing side.

        Show 4 fields
        • order_idstringrequired

          The working order.

        • typestringrequired

          The order's type.

          One ofmarketlimitstop_marketstop_limittake_markettake_limit

        • pricedecimal string or nullrequired

          Its trigger or limit price.

        • sizedecimal string or nullrequired

          Its size.

      • stop_lossarray of ExitLegrequired

        Stop orders on the closing side.

        Show 4 fields
        • order_idstringrequired

          The working order.

        • typestringrequired

          The order's type.

          One ofmarketlimitstop_marketstop_limittake_markettake_limit

        • pricedecimal string or nullrequired

          Its trigger or limit price.

        • sizedecimal string or nullrequired

          Its size.

    • protectedbooleanrequired

      At least one stop loss rests on it.

    • opened_atinteger, Unix ms or nullrequired

      When it opened.

  • riskAccountRiskOrNull or nullrequired

    The live risk; null while the account is being opened.

    Show 19 fields
    • as_ofinteger, Unix msrequired

      When the oldest figure here was read.

    • stalebooleanrequired

      Some figures are older than usual (the engine was busy).

    • balancedecimal stringrequired

      The balance.

    • equitydecimal stringrequired

      The balance plus the open P&L at the market price.

    • unrealized_pnldecimal stringrequired

      The open P&L.

    • pnl_todaydecimal stringrequired

      The equity change since midnight New York, open positions included: what the daily loss rule counts.

    • realized_todaydecimal stringrequired

      The P&L closed today.

    • fees_todaydecimal stringrequired

      The fees paid today.

    • trades_todayintegerrequired

      Trades closed today.

    • margin_useddecimal stringrequired

      The margin your positions hold.

    • margin_availabledecimal string or nullrequired

      What is left of the balance for new positions.

    • exposureobjectrequired
      Show 5 fields
      • grossdecimal stringrequired

        The value of every open position.

      • longdecimal stringrequired

        The value of the long ones.

      • shortdecimal stringrequired

        The value of the short ones.

      • effective_leveragedecimal string or nullrequired

        Gross exposure over equity.

      • marketsarray of objectrequired

        Per market, largest first.

        Show 5 fields
        • marketstringrequired

          A market id: the asset and USD; an option adds its venue or hours after a dot.

        • notionaldecimal stringrequired

          The value held on it.

        • leveragedecimal string or nullrequired

          That value over equity.

        • capdecimal string or nullrequired

          The exposure cap of the market.

        • cap_used_pctdecimal string or nullrequired

          How much of the cap is used, counting your other accounts on the same rule, in percent.

    • daily_lossLimit or nullrequired

      A loss limit and the room left to it.

      Show 10 fields
      • limitdecimal string

        The limit, in USD.

      • floordecimal string

        The equity at which it is breached.

      • roomdecimal string

        How much more the account may lose before it.

      • used_pctdecimal string or null

        How much of it is used, in percent.

      • resets_atinteger, Unix ms

        Daily loss only: when it resets (midnight New York).

      • on_breachstring

        Daily loss only: what happens when it is reached.

        One offail_accountflattenflatten_and_pause

      • estimatedboolean

        Daily loss only: the day's start is estimated (the engine does not publish it).

      • modestring

        Max drawdown only: how the reference moves.

        One ofend_of_dayend_of_tradestaticintraday_equity

      • at_leastboolean

        Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).

      • liftedbooleanrequired

        The rule no longer applies this limit (its cut-off was reached).

    • max_drawdownLimit or nullrequired

      A loss limit and the room left to it.

      Show 10 fields
      • limitdecimal string

        The limit, in USD.

      • floordecimal string

        The equity at which it is breached.

      • roomdecimal string

        How much more the account may lose before it.

      • used_pctdecimal string or null

        How much of it is used, in percent.

      • resets_atinteger, Unix ms

        Daily loss only: when it resets (midnight New York).

      • on_breachstring

        Daily loss only: what happens when it is reached.

        One offail_accountflattenflatten_and_pause

      • estimatedboolean

        Daily loss only: the day's start is estimated (the engine does not publish it).

      • modestring

        Max drawdown only: how the reference moves.

        One ofend_of_dayend_of_tradestaticintraday_equity

      • at_leastboolean

        Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).

      • liftedbooleanrequired

        The rule no longer applies this limit (its cut-off was reached).

    • profit_targetobject or nullrequired
      Show 4 fields
      • goal_balancedecimal stringrequired

        The balance that reaches it.

      • remainingdecimal stringrequired

        Still to make.

      • progress_pctdecimal string or nullrequired

        How far, in percent.

      • requires_flatbooleanrequired

        Positions must be closed when it is reached.

    • trading_daysobjectrequired
      Show 2 fields
      • countinteger or nullrequired

        Days with a trade so far.

      • requiredinteger or nullrequired

        Days the rule needs.

    • nearest_liquidationobject or nullrequired
      Show 3 fields
      • marketstringrequired

        A market id: the asset and USD; an option adds its venue or hours after a dot.

      • pricedecimal stringrequired

        Its liquidation price.

      • distance_pctdecimal stringrequired

        How far the price is from it, in percent.

    • trading_day_ends_atinteger, Unix msrequired

      When the trading day ends (midnight New York).

    • warningsarray of Warningrequired

      What needs your attention, most serious first.

      Show 4 fields
      • codestringrequired

        What it is about.

        One ofdaily_loss_usedmax_drawdown_usedliquidation_nearno_stop_lossmargin_usedorder_without_position

      • levelstringrequired

        How serious.

        One ofinfowarningcritical

      • marketstring

        The market it is about.

      • valuedecimal string

        The figure behind it, in percent.

  • errorstring

    Why the account could not be read now (orders, positions and risk are then empty): read it again by REST.

type: snapshot_end

Every snapshot of a subscribe was sent.

  • typestringrequired

    The frame.

    One ofsnapshot_end

  • accountsarray of stringrequired

    Account numbers.

type: event

An event of an account you follow, once: as GET /v1/events answers it.

  • typestringrequired

    The frame.

    One ofevent

  • seqintegerrequired

    Counts this connection's events, without a gap.

  • eventEventrequired
    Show 6 fields
    • idstringrequired

      The event; pass it as after (GET /v1/events) or resume (the stream) to continue from it.

    • typestringrequired

      What happened (GET /v1/webhook-event-types says what each type means).

      One oforder.createdorder.editedorder.filledorder.canceledorder.rejectedorder.expiredfill.createdposition.openedposition.changedposition.closedstrategy.createdstrategy.leg_placedstrategy.leg_modifiedstrategy.leg_filledstrategy.leg_canceledstrategy.leg_rejectedstrategy.orphan_repairedstrategy.slicestrategy.triggeredstrategy.endedtradingview.alert_executedtradingview.alert_refusedaccount.updatedaccount.passedaccount.failedaccount.payout_eligibleaccount.disabledaccount.removedkey.loss_stopkey.expiringsystem.restartedrisk.warningrisk.clearedalert.triggered

    • account_idstringrequired

      The account number.

    • timeinteger, Unix msrequired

      When it happened.

    • sourcestringrequired

      Where it came from: an order placed through this API or by an AI assistant (the MCP server), one placed on a trading platform, the engine itself (positions), a strategy of this API, or a TradingView alert.

      One ofapimcpplatformenginestrategytradingview

    • dataobjectrequired

      order or fill (the objects REST answers), with changes or close_reason when they apply. A position.* event carries position { market, side, size, average_price } as the engine reported it, and previous_size: read GET .../positions/{market} for its margin, P&L and liquidation.

  • replayedboolean

    Sent again after a resume.

type: risk

An account's risk changed (subscribed with risk).

  • typestringrequired

    The frame.

    One ofrisk

  • account_idstringrequired

    The account number.

  • dataAccountRiskrequired
    Show 19 fields
    • as_ofinteger, Unix msrequired

      When the oldest figure here was read.

    • stalebooleanrequired

      Some figures are older than usual (the engine was busy).

    • balancedecimal stringrequired

      The balance.

    • equitydecimal stringrequired

      The balance plus the open P&L at the market price.

    • unrealized_pnldecimal stringrequired

      The open P&L.

    • pnl_todaydecimal stringrequired

      The equity change since midnight New York, open positions included: what the daily loss rule counts.

    • realized_todaydecimal stringrequired

      The P&L closed today.

    • fees_todaydecimal stringrequired

      The fees paid today.

    • trades_todayintegerrequired

      Trades closed today.

    • margin_useddecimal stringrequired

      The margin your positions hold.

    • margin_availabledecimal string or nullrequired

      What is left of the balance for new positions.

    • exposureobjectrequired
      Show 5 fields
      • grossdecimal stringrequired

        The value of every open position.

      • longdecimal stringrequired

        The value of the long ones.

      • shortdecimal stringrequired

        The value of the short ones.

      • effective_leveragedecimal string or nullrequired

        Gross exposure over equity.

      • marketsarray of objectrequired

        Per market, largest first.

        Show 5 fields
        • marketstringrequired

          A market id: the asset and USD; an option adds its venue or hours after a dot.

        • notionaldecimal stringrequired

          The value held on it.

        • leveragedecimal string or nullrequired

          That value over equity.

        • capdecimal string or nullrequired

          The exposure cap of the market.

        • cap_used_pctdecimal string or nullrequired

          How much of the cap is used, counting your other accounts on the same rule, in percent.

    • daily_lossLimit or nullrequired

      A loss limit and the room left to it.

      Show 10 fields
      • limitdecimal string

        The limit, in USD.

      • floordecimal string

        The equity at which it is breached.

      • roomdecimal string

        How much more the account may lose before it.

      • used_pctdecimal string or null

        How much of it is used, in percent.

      • resets_atinteger, Unix ms

        Daily loss only: when it resets (midnight New York).

      • on_breachstring

        Daily loss only: what happens when it is reached.

        One offail_accountflattenflatten_and_pause

      • estimatedboolean

        Daily loss only: the day's start is estimated (the engine does not publish it).

      • modestring

        Max drawdown only: how the reference moves.

        One ofend_of_dayend_of_tradestaticintraday_equity

      • at_leastboolean

        Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).

      • liftedbooleanrequired

        The rule no longer applies this limit (its cut-off was reached).

    • max_drawdownLimit or nullrequired

      A loss limit and the room left to it.

      Show 10 fields
      • limitdecimal string

        The limit, in USD.

      • floordecimal string

        The equity at which it is breached.

      • roomdecimal string

        How much more the account may lose before it.

      • used_pctdecimal string or null

        How much of it is used, in percent.

      • resets_atinteger, Unix ms

        Daily loss only: when it resets (midnight New York).

      • on_breachstring

        Daily loss only: what happens when it is reached.

        One offail_accountflattenflatten_and_pause

      • estimatedboolean

        Daily loss only: the day's start is estimated (the engine does not publish it).

      • modestring

        Max drawdown only: how the reference moves.

        One ofend_of_dayend_of_tradestaticintraday_equity

      • at_leastboolean

        Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).

      • liftedbooleanrequired

        The rule no longer applies this limit (its cut-off was reached).

    • profit_targetobject or nullrequired
      Show 4 fields
      • goal_balancedecimal stringrequired

        The balance that reaches it.

      • remainingdecimal stringrequired

        Still to make.

      • progress_pctdecimal string or nullrequired

        How far, in percent.

      • requires_flatbooleanrequired

        Positions must be closed when it is reached.

    • trading_daysobjectrequired
      Show 2 fields
      • countinteger or nullrequired

        Days with a trade so far.

      • requiredinteger or nullrequired

        Days the rule needs.

    • nearest_liquidationobject or nullrequired
      Show 3 fields
      • marketstringrequired

        A market id: the asset and USD; an option adds its venue or hours after a dot.

      • pricedecimal stringrequired

        Its liquidation price.

      • distance_pctdecimal stringrequired

        How far the price is from it, in percent.

    • trading_day_ends_atinteger, Unix msrequired

      When the trading day ends (midnight New York).

    • warningsarray of Warningrequired

      What needs your attention, most serious first.

      Show 4 fields
      • codestringrequired

        What it is about.

        One ofdaily_loss_usedmax_drawdown_usedliquidation_nearno_stop_lossmargin_usedorder_without_position

      • levelstringrequired

        How serious.

        One ofinfowarningcritical

      • marketstring

        The market it is about.

      • valuedecimal string

        The figure behind it, in percent.

type: heartbeat

The connection is alive. Three missed: reconnect.

  • typestringrequired

    The frame.

    One ofheartbeat

  • timeinteger, Unix msrequired

    The time on the server.

type: pong

The answer to a ping.

  • typestringrequired

    The frame.

    One ofpong

  • timeinteger, Unix msrequired

    The time on the server.

type: unsubscribed

Those accounts are no longer followed.

  • typestringrequired

    The frame.

    One ofunsubscribed

  • accountsarray of stringrequired

    Account numbers.

type: notice

Something to know about this connection, before the snapshot.

  • typestringrequired

    The frame.

    One ofnotice

  • codestringrequired

    resume_gap: the resume could not be covered (an unknown event, or one older than the replay window): events after it may be missing here.

    One ofresume_gap

  • afterstringrequired

    The resume asked: read GET /v1/events?after= it for what was missed.

type: error

A message of yours that could not be done. The connection stays open; the SDKs end the stream on it, since it would follow less than they asked.

  • typestringrequired

    The frame.

    One oferror

  • codestringrequired

    What went wrong.

    One ofinvalid_jsontoo_many_accountsaccount_not_found

  • The account it is about.

  • detailsobject

    More about it.

What you send

op: subscribe

Follow accounts: a snapshot of each, then their events. Without accounts, every account your key reaches, and those opened later (each with its snapshot).

  • opstringrequired

    What you ask.

    One ofsubscribe

  • accountsarray of string

    The accounts to follow; without it, every account your key reaches.

  • riskboolean

    Risk frames too (none by default; the snapshot carries the risk either way).

op: unsubscribe

Stop following accounts.

  • opstringrequired

    What you ask.

    One ofunsubscribe

  • accountsarray of stringrequired

    Account numbers.

op: ping

Ask for a pong.

  • opstringrequired

    What you ask.

    One ofping

Market data

wss://stream.phoenixperpsfunding.com/v1/market-data

The connection for market data: subscribe to channels, list them, ping. Any key or app token of either environment.

What the server sends

type: hello

First, on every connection: what it offers, and its limits.

  • typestringrequired

    The frame.

    One ofhello

  • sessionstringrequired

    This connection.

  • heartbeat_msintegerrequired

    How often a heartbeat comes.

  • channelsarray of stringrequired

    The channels you can subscribe to.

  • intervalsarray of stringrequired

    The candle intervals.

  • limitsobjectrequired
    Show 3 fields
    • subscriptionsintegerrequired

      Subscriptions one connection holds at most (a market on a channel; each candle interval counts).

    • symbols_per_subscribeintegerrequired

      Markets one subscribe names at most.

    • messages_per_sintegerrequired

      Messages a second you may send; beyond, the connection closes 4009.

type: subscribed

A subscribe was done: then the channel's current state, then snapshot_end.

  • typestringrequired

    The frame.

    One ofsubscribed

  • idinteger

    Your id for the request, echoed in its answers.

  • channelstringrequired

    The channel.

    One oftickerbooktradescandlesstatsstatus

  • symbolsarray of stringrequired

    Market ids.

  • rejectedarray of objectrequired

    The markets refused, each with why.

    Show 2 fields
    • symbolstringrequired

      A market id: the asset and USD; an option adds its venue or hours after a dot.

    • codestringrequired

      Why.

      One ofmarket_not_foundtoo_many_subscriptions

  • intervalstring

    The candle interval (candles).

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

type: snapshot_end

The current state of a subscribe was sent: live frames follow.

  • typestringrequired

    The frame.

    One ofsnapshot_end

  • idinteger

    Your id for the request, echoed in its answers.

  • channelstringrequired

    The channel.

    One oftickerbooktradescandlesstatsstatus

type: unsubscribed

An unsubscribe was done: what it ended, and what it named that was not followed.

  • typestringrequired

    The frame.

    One ofunsubscribed

  • idinteger

    Your id for the request, echoed in its answers.

  • channelstringrequired

    The channel.

    One oftickerbooktradescandlesstatsstatus

  • symbolsarray of stringrequired

    The markets no longer followed.

  • rejectedarray of objectrequired

    The markets named that were not followed.

    Show 2 fields
    • symbolstringrequired

      A market id: the asset and USD; an option adds its venue or hours after a dot.

    • codestringrequired

      Why.

      One ofnot_subscribed

  • intervalstring

    The candle interval named (candles).

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

type: list

The answer to list.

  • typestringrequired

    The frame.

    One oflist

  • idinteger

    Your id for the request, echoed in its answers.

  • subscriptionsarray of objectrequired

    Your subscriptions.

    Show 3 fields
    • channelstringrequired

      The channel.

      One oftickerbooktradescandlesstatsstatus

    • symbolstringrequired

      The market id, or * for every market.

    • intervalstring

      The candle interval.

      One of1m3m5m15m30m1h2h4h6h12h1d1w1M

type: heartbeat

The connection is alive.

  • typestringrequired

    The frame.

    One ofheartbeat

  • timeinteger, Unix msrequired

    The time on the server.

type: pong

The answer to a ping.

  • typestringrequired

    The frame.

    One ofpong

  • idinteger

    Your id for the request, echoed in its answers.

  • timeinteger, Unix msrequired

    The time on the server.

type: error

A message of yours that could not be done. The connection stays open.

  • typestringrequired

    The frame.

    One oferror

  • idinteger

    Your id for the request, echoed in its answers.

  • codestringrequired

    What went wrong.

    One ofinvalid_jsoninvalid_requestinvalid_parameterstate_unavailable

  • detailsobject

    The field at fault, or the market.

What you send

op: subscribe

Follow markets on a channel. An option out of its range, or one the channel does not take, is refused with invalid_parameter.

  • opstringrequired

    What you ask.

    One ofsubscribe

  • idinteger

    Your id for the request, echoed in its answers.

  • channelstringrequired

    The channel.

    One oftickerbooktradescandlesstatsstatus

  • symbolsarray of string

    Market ids, 1 to 50 (stats: ["*"] for every market; status: none).

  • ticker: the shortest time between frames (default 250).

    One of1002505001000

  • depthinteger

    book: levels on each side (default 10).

    One of151020

  • historyinteger

    trades: recent trades sent first, 0 to 200 (default 20). candles: closed candles sent first, 0 to 500 (default 100), then the forming one.

  • intervalstring

    candles: the interval.

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

op: unsubscribe

Stop following markets on a channel.

  • opstringrequired

    What you ask.

    One ofunsubscribe

  • idinteger

    Your id for the request, echoed in its answers.

  • channelstringrequired

    The channel.

    One oftickerbooktradescandlesstatsstatus

  • symbolsarray of string

    The markets to stop following; none, or an empty list, for every one of the channel (status: none).

  • intervalstring

    candles: the interval to stop; none for every interval of those markets.

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

op: list

Ask for your subscriptions.

  • opstringrequired

    What you ask.

    One oflist

  • idinteger

    Your id for the request, echoed in its answers.

op: ping

Ask for a pong.

  • opstringrequired

    What you ask.

    One ofping

  • idinteger

    Your id for the request, echoed in its answers.

Market data channels

ticker Ticker

The latest prices, at most once per interval_ms.

Subscribe with

  • The shortest time between frames (default 250).

    One of1002505001000

  • typestringrequired

    The frame.

    One ofticker

  • symbolstringrequired

    A market id: the asset and USD; an option adds its venue or hours after a dot.

  • dataobjectrequired
    Show 4 fields
    • biddecimal string or nullrequired

      The best bid.

    • askdecimal string or nullrequired

      The best ask.

    • lastdecimal string or nullrequired

      The last trade.

    • timeinteger, Unix ms or nullrequired

      When it was last updated.

book Order book

The top of the book to the depth asked, whole every time (replace what you hold), at most every 250 ms.

Subscribe with

  • depthinteger

    Levels on each side (default 10).

    One of151020

  • typestringrequired

    The frame.

    One ofbook

  • symbolstringrequired

    A market id: the asset and USD; an option adds its venue or hours after a dot.

  • dataobjectrequired
    Show 3 fields
    • bidsarray of array of decimal stringrequired

      Bids, best first.

    • asksarray of array of decimal stringrequired

      Asks, best first.

    • timeinteger, Unix ms or nullrequired

      When the book was read.

trades Trades

Trades as they print, batched every 100 ms; first the history asked.

Subscribe with

  • historyinteger

    Recent trades sent first, 0 to 200 (default 20).

  • typestringrequired

    The frame.

    One oftrades

  • symbolstringrequired

    A market id: the asset and USD; an option adds its venue or hours after a dot.

  • dataarray of objectrequired

    Trades, oldest first.

    Show 5 fields
    • idstringrequired

      The trade.

    • pricedecimal string or nullrequired

      Its price.

    • sizedecimal string or nullrequired

      Its size.

    • sidestringrequired

      The side that took liquidity.

      One ofbuysell

    • timeinteger, Unix msrequired

      When it traded.

candles Candles

Candles: first the history asked, then the forming candle as it changes and each closed one.

Subscribe with

  • intervalstring

    The candle interval (required).

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

  • historyinteger

    Closed candles sent first, 0 to 500 (default 100); the forming one follows in a frame of its own.

  • typestringrequired

    The frame.

    One ofcandles

  • symbolstringrequired

    A market id: the asset and USD; an option adds its venue or hours after a dot.

  • intervalstringrequired

    The candle interval.

    One of1m3m5m15m30m1h2h4h6h12h1d1w1M

  • dataarray of objectrequired

    Candles, oldest first.

    Show 8 fields
    • timeinteger, Unix msrequired

      When the candle starts.

    • opendecimal string or nullrequired

      The first price.

    • highdecimal string or nullrequired

      The highest.

    • lowdecimal string or nullrequired

      The lowest.

    • closedecimal string or nullrequired

      The last.

    • volumedecimal string or nullrequired

      The size traded.

    • finalbooleanrequired

      false: still forming, it comes again as it changes.

    • revisedboolean

      A closed candle sent again with its final figures.

stats Stats

24-hour figures and open interest, every 5 seconds (GET /v1/markets/stats answers the same for every market).

  • typestringrequired

    The frame.

    One ofstats

  • symbolstringrequired

    A market id: the asset and USD; an option adds its venue or hours after a dot.

  • dataobjectrequired
    Show 9 fields
    • lastdecimal string or nullrequired

      The last trade.

    • change_24hdecimal string or nullrequired

      The change over 24 hours.

    • change_24h_pctdecimal string or nullrequired

      That change in percent.

    • high_24hdecimal string or nullrequired

      The highest in 24 hours.

    • low_24hdecimal string or nullrequired

      The lowest in 24 hours.

    • volume_24hdecimal string or nullrequired

      The size traded in 24 hours.

    • notional_volume_24hdecimal string or nullrequired

      The value traded in 24 hours, in USD.

    • open_interestdecimal string or nullrequired

      The market's open interest: the size held open in positions.

    • notional_open_interestdecimal string or nullrequired

      That open interest in USD, at the last price.

status Market status

The price feed's state, when it changes.

  • typestringrequired

    The frame.

    One ofstatus

  • dataobjectrequired
    Show 1 fields
    • feedobjectrequired
      Show 2 fields
      • statestringrequired

        live: prices are flowing.

        One oflivedegradeddown

      • age_msinteger or nullrequired

        Milliseconds since the last price.

Guides, endpoints, fields and error codes.