Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pacifica-fi/docs-migrate/llms.txt

Use this file to discover all available pages before exploring further.

Subscriptions are the mechanism for streaming live data over a Pacifica WebSocket connection. After sending a subscribe message, the server pushes events to your client as they occur — no polling required. This page documents every available channel, the subscribe message format, and the shape of each data event. Market data channels (prices, book, BBO, trades, candle, mark price candle) are open to anyone. Account data channels (account_margin, account_leverage, account_info, account_positions, account_order_updates, account_trades, account_transfers) stream private data and require you to provide the account address in the subscription params.
Account data channels do not require a cryptographic signature to subscribe — you provide only your wallet address in params.account. However, you should only subscribe to your own account. Trading operations that modify state (placing or cancelling orders) do require a full Ed25519 signature; see Trading Operations.

Prices

Streams live price information for all symbols on Pacifica, including mark price, oracle price, funding rate, open interest, and 24-hour volume. The stream updates whenever any symbol’s price data changes. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "prices"
    }
}
Event
{
    "channel": "prices",
    "data": [
        {
            "funding": "0.0000125",
            "mark": "105473",
            "mid": "105476",
            "next_funding": "0.0000125",
            "open_interest": "0.00524",
            "oracle": "105473",
            "symbol": "BTC",
            "timestamp": 1749051612681,
            "volume_24h": "63265.87522",
            "yesterday_price": "955476"
        }
    ]
}
funding
decimal string
Current funding rate.
mark
decimal string
Mark price.
mid
decimal string
Mid price (midpoint of best bid and best ask).
next_funding
decimal string
Predicted next funding rate.
open_interest
decimal string
Total open interest amount.
oracle
decimal string
Oracle price.
symbol
string
Asset symbol, e.g. BTC.
timestamp
number
Event timestamp in milliseconds.
volume_24h
decimal string
Rolling 24-hour trading volume in USD.
yesterday_price
decimal string
Previous day’s closing price.

Orderbook

Streams aggregated order book snapshots for a single symbol at a configurable price aggregation level. The stream updates every 250 ms. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "book",
        "symbol": "SOL",
        "agg_level": 1
    }
}
source
string
required
Must be "book".
symbol
string
required
The market symbol to subscribe to, e.g. "SOL".
agg_level
integer
required
Price aggregation level. Accepted values: 1, 10, 100, 1000, 10000.
Event
{
    "channel": "book",
    "data": {
        "l": [
            [
                { "a": "37.86", "n": 4, "p": "157.47" }
            ],
            [
                { "a": "12.7",  "n": 2, "p": "157.49" },
                { "a": "44.45", "n": 3, "p": "157.5"  }
            ]
        ],
        "s": "SOL",
        "t": 1749051881187,
        "li": 1559885104
    }
}
l
array
Two-element array [bids, asks]. Each element is an array of aggregated price levels.
l[n].a
decimal string
Total amount at this aggregation level.
l[n].n
integer
Number of individual orders within this aggregation level.
l[n].p
decimal string
In the bids array: the highest price in the aggregation level. In the asks array: the lowest price in the aggregation level.
s
string
Symbol.
t
number
Timestamp in milliseconds.
li
number
Exchange-wide nonce. Sequential, not subject to clock drift. Use this to reliably determine the ordering of exchange events.

Best Bid / Offer (BBO)

Streams real-time updates to the best bid and ask prices and amounts for a single symbol. An event is sent whenever the top of book changes. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "bbo",
        "symbol": "BTC"
    }
}
source
string
required
Must be "bbo".
symbol
string
required
The market symbol to subscribe to, e.g. "BTC".
Event
{
    "channel": "bbo",
    "data": {
        "s": "BTC",
        "i": 1234567890,
        "li": 1325476098,
        "t": 1764133203991,
        "b": "87185",
        "B": "1.234",
        "a": "87186",
        "A": "0.567"
    }
}
s
string
Symbol.
i
integer
Order ID of the top-of-book order that triggered this update.
li
integer
Exchange-wide nonce (last order ID). Sequential, not subject to clock drift.
t
integer
Timestamp in milliseconds.
b
decimal string
Best bid price.
B
decimal string
Best bid amount (in token units).
a
decimal string
Best ask price.
A
decimal string
Best ask amount (in token units).

Trades

Streams all executed trades from the taker side as they occur in a chosen market. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "trades",
        "symbol": "SOL"
    }
}
source
string
required
Must be "trades".
symbol
string
required
The market symbol to subscribe to, e.g. "SOL".
Event
{
    "channel": "trades",
    "data": [
        {
            "h": 80062522,
            "s": "BTC",
            "a": "0.00001",
            "p": "89471",
            "d": "close_short",
            "tc": "normal",
            "t": 1765018379085,
            "li": 1559885104
        }
    ]
}
h
integer
History ID.
s
string
Symbol.
a
decimal string
Trade amount.
p
decimal string
Trade price.
d
string
Trade side. One of: open_long, open_short, close_long, close_short.
tc
string
Trade cause. One of: normal, market_liquidation, backstop_liquidation, settlement.
t
number
Timestamp in milliseconds.
li
number
Exchange-wide nonce. Sequential, not subject to clock drift.

Candle

Streams live candlestick data for a specific symbol and time interval. A new event is emitted each time a candle is updated within the current period. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "candle",
        "symbol": "SOL",
        "interval": "1m"
    }
}
source
string
required
Must be "candle".
symbol
string
required
The market symbol to subscribe to, e.g. "SOL".
interval
string
required
Candle interval. Accepted values: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d.
Event
{
    "channel": "candle",
    "data": {
        "t": 1749052260000,
        "T": 1749052320000,
        "s": "SOL",
        "i": "1m",
        "o": "157.3",
        "c": "157.32",
        "h": "157.32",
        "l": "157.3",
        "v": "1.22",
        "n": 8
    }
}
t
number
Candle start time in milliseconds.
T
number
Candle end time in milliseconds.
s
string
Symbol.
i
string
Candle interval.
o
decimal string
Open price.
c
decimal string
Close price.
h
decimal string
High price.
l
decimal string
Low price.
v
decimal string
Volume for the period.
n
number
Number of trades in the period.

Mark Price Candle

Streams real-time mark price candlestick data for a specific symbol and time interval. The shape is identical to the trade price candle but reflects the mark price series rather than last trade price. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "mark_price_candle",
        "symbol": "BTC",
        "interval": "1m"
    }
}
source
string
required
Must be "mark_price_candle".
symbol
string
required
The market symbol to subscribe to, e.g. "BTC".
interval
string
required
Candle interval. Accepted values: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d.
Event
{
    "channel": "mark_price_candle",
    "data": {
        "t": 1748954160000,
        "T": 1748954220000,
        "s": "BTC",
        "i": "1m",
        "o": "105376.500000",
        "c": "105380.250000",
        "h": "105385.750000",
        "l": "105372.000000",
        "v": "0",
        "n": 0
    }
}
t
number
Candle start time in milliseconds.
T
number
Candle end time in milliseconds.
s
string
Symbol.
i
string
Candle interval.
o
decimal string
Open mark price.
c
decimal string
Close mark price.
h
decimal string
High mark price.
l
decimal string
Low mark price.
v
decimal string
Volume. Always "0" for mark price candles.
n
number
Number of trades in the period. Always 0 for mark price candles.

Account Margin

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all changes made to an account’s margin mode across any market. An event is emitted each time the margin mode is toggled between cross and isolated for a symbol. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_margin",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_margin".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_margin",
    "data": {
        "u": "42trU9A5...",
        "s": "ETH",
        "i": true,
        "t": 1234567890
    }
}
u
string
Account address.
s
string
Symbol for which the margin mode changed.
i
boolean
New margin mode. true = isolated; false = cross.
t
number
Timestamp in milliseconds.

Account Leverage

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all changes made to an account’s maximum leverage setting for any market. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_leverage",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_leverage".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_leverage",
    "data": {
        "u": "42trU9A5...",
        "s": "BTC",
        "l": "12",
        "t": 1234567890
    }
}
u
string
Account address.
s
string
Symbol for which leverage changed.
l
integer string
New leverage setting.
t
number
Timestamp in milliseconds.

Account Info

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all changes to an account’s overall financial state, including equity, balance, margin usage, order counts, and spot asset balances. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_info",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_info".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_info",
    "data": {
        "ae": "2000",
        "as": "1500",
        "aw": "1400",
        "b": "2000",
        "f": 1,
        "mu": "500",
        "cm": "400",
        "oc": 10,
        "pb": "0",
        "pc": 2,
        "sc": 2,
        "sb": [
            {
                "s": "SOL",
                "a": "1.50000000",
                "lr": "0.80",
                "aw": "1.00000000",
                "pb": "0.00",
                "dw": "250.000000",
                "dd": "50000.000000",
                "wd": "250000.000000"
            }
        ],
        "t": 1234567890
    }
}
ae
string
Account equity.
as
string
Available to spend.
aw
string
Available to withdraw.
b
string
Account balance.
f
integer
Account fee tier.
mu
string
Total margin in use.
cm
string
Maintenance margin required in cross mode.
oc
integer
Open orders count.
pb
string
Pending balance.
pc
integer
Open positions count.
sc
integer
Stop order count.
sb
array
Spot asset balances. Each entry contains:
FieldTypeDescription
sstringSpot asset symbol
astringTotal amount held
lrstringLoan-to-value ratio
awstringAvailable to withdraw
pbstringPending balance
dwstringDaily withdrawal amount (USD)
ddstringEffective daily deposit limit (USD)
wdstringEffective daily withdrawal limit (USD)
t
number
Timestamp in milliseconds.

Account Positions

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all changes to an account’s open positions across any market. Upon subscription, the server immediately delivers a full snapshot of current positions before streaming incremental updates. A position that has been fully closed is streamed with an empty data array. For the most reliable position state, use account_positions to seed initial state and account_trades to apply subsequent changes. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_positions",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_positions".
account
string
required
The wallet address to subscribe to.
Events The subscription confirmation, initial snapshot, an incremental update, and a close event look like this:
{
    "channel": "subscribe",
    "data": {
        "source": "account_positions",
        "account": "BrZp5..."
    }
}
{
    "channel": "account_positions",
    "data": [
        {
            "s": "BTC",
            "d": "bid",
            "a": "0.00022",
            "p": "87185",
            "m": "0",
            "f": "-0.00023989",
            "i": false,
            "l": null,
            "t": 1764133203991
        }
    ],
    "li": 1559395580
}
{
    "channel": "account_positions",
    "data": [
        {
            "s": "BTC",
            "d": "bid",
            "a": "0.00044",
            "p": "87285.5",
            "m": "0",
            "f": "-0.00023989",
            "i": false,
            "l": "-95166.79231",
            "t": 1764133656974
        }
    ],
    "li": 1559412952
}
{
    "channel": "account_positions",
    "data": [],
    "li": 1559438203
}
s
string
Symbol.
d
string
Position side: bid (long) or ask (short).
a
decimal string
Position size.
p
decimal string
Average entry price.
m
decimal string
Position margin.
f
decimal string
Accumulated funding fee for this position.
i
boolean
Whether the position is in isolated margin mode.
l
decimal string
Liquidation price in USD. null if not applicable.
t
number
Timestamp in milliseconds.
li
number
Exchange-wide nonce. Sequential, not subject to clock drift.

Account Order Updates

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all changes to an account’s open orders across any market — including order placement, partial fills, full fills, edits, cancellations, and rejections. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_order_updates",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_order_updates".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_order_updates",
    "data": [
        {
            "i": 1559665358,
            "I": null,
            "u": "BrZp5bidJ3WUvceSq7X78bhjTfZXeezzGvGEV4hAYKTa",
            "s": "BTC",
            "d": "bid",
            "p": "89501",
            "ip": "89501",
            "lp": "89501",
            "a": "0.00012",
            "f": "0.00012",
            "oe": "fulfill_limit",
            "os": "filled",
            "ot": "limit",
            "sp": null,
            "si": null,
            "tp": null,
            "r": false,
            "ct": 1765017049008,
            "ut": 1765017219639,
            "li": 1559696133
        }
    ]
}
i
integer
Order ID.
I
string
Client order ID (full UUID), or null if not provided.
u
string
Account address (base58 encoded).
s
string
Symbol.
d
string
Order side: bid or ask.
p
decimal string
Average filled price.
ip
decimal string
Initial (submitted) price.
lp
decimal string
Last filled price.
a
decimal string
Original order amount.
f
decimal string
Amount filled so far.
oe
string
Order event that triggered this update. Possible values:
ValueMeaning
makeOrder placed on the book
stop_createdStop order created
fulfill_marketFilled by a market order
fulfill_limitFilled by a limit order
adjustOrder modified
stop_parent_order_filledParent order was filled
stop_triggeredStop order activated
stop_upgradeStop order upgraded
cancelCancelled by user
force_cancelCancelled by the system
expiredTime-in-force expired
post_only_rejectedALO order would have crossed
self_trade_preventedSelf-trade prevention triggered
os
string
Order status. One of: open, partially_filled, filled, cancelled, rejected.
ot
string
Order type. One of: limit, market, stop_limit, stop_market, take_profit_limit, stop_loss_limit, take_profit_market, stop_loss_market.
sp
string
Stop price (for stop orders), or null.
si
string
Stop parent order ID, or null.
tp
string
Stop trigger price type: last_trade_price, mark_price, or mid_price. null if not a stop order.
r
boolean
Whether the order is reduce-only.
ct
integer
Order creation time in milliseconds.
ut
integer
Last update time in milliseconds.
li
integer
Exchange-wide nonce. Sequential, not subject to clock drift.

Account Trades

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams all trade executions for an account, including the fill price, PnL, fee, and trade cause. Use this channel together with account_positions to maintain an accurate real-time view of open positions. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_trades",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_trades".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_trades",
    "data": [
        {
            "h": 80063441,
            "i": 1559912767,
            "I": null,
            "u": "BrZp5bidJ3WUvceSq7X78bhjTfZXeezzGvGEV4hAYKTa",
            "s": "BTC",
            "p": "89477",
            "o": "89505",
            "a": "0.00036",
            "te": "fulfill_taker",
            "ts": "close_long",
            "tc": "normal",
            "f": "0.012885",
            "n": "-0.022965",
            "t": 1765018588190,
            "li": 1559912767
        }
    ]
}
h
integer
History ID.
i
integer
Order ID associated with this trade.
I
string
Client order ID (full UUID), or null.
u
string
Account address.
s
string
Symbol.
p
decimal string
Fill price.
o
decimal string
Position entry price.
a
decimal string
Trade amount.
te
string
Trade execution role: fulfill_maker (provided liquidity) or fulfill_taker (took liquidity).
ts
string
Trade side: open_long, open_short, close_long, or close_short.
tc
string
Trade cause: normal, market_liquidation, backstop_liquidation, or settlement.
f
decimal string
Trading fee charged.
n
decimal string
Realised PnL for this trade.
t
number
Timestamp in milliseconds.
li
number
Exchange-wide nonce. Sequential, not subject to clock drift.

Account Transfers

This is an account data channel. Pass your wallet address in params.account. Events are scoped to that account only.
Streams deposit, withdrawal, and sub-account transfer events for an account. Subscribe
{
    "method": "subscribe",
    "params": {
        "source": "account_transfers",
        "account": "42trU9A5..."
    }
}
source
string
required
Must be "account_transfers".
account
string
required
The wallet address to subscribe to.
Event
{
    "channel": "account_transfers",
    "data": {
        "u": "42trU9A5...",
        "e": "deposit",
        "a": "USDC",
        "am": "1000.000000",
        "t": 1716200000000,
        "tx": "5xGk...",
        "s": null,
        "r": null,
        "bn": 42,
        "ra": "1000.000000",
        "f": "0.500000"
    }
}
u
string
Account address.
e
string
Transfer event type: deposit, subaccount_transfer, withdrawal_pending, or withdrawal_confirmed.
a
string
Asset symbol (e.g. USDC).
am
string
Transfer amount.
t
number
Timestamp in milliseconds.
tx
string
On-chain transaction ID, or null if not yet confirmed.
s
string
Source address, or null if not applicable.
r
string
Receiver address, or null if not applicable.
bn
integer
Batch nonce (used for withdrawals), or null.
ra
string
Requested amount before fees, or null.
f
string
Fee amount deducted, or null.

Build docs developers (and LLMs) love