Pacifica
  • Getting Started
    • Closed Alpha Guide
      • Link To Guide PDF
    • Closed Alpha Trading Competition
  • Trading on Pacifica
    • Overview
    • Contract Specifications
      • Oracle Price & Mark Price
      • Settlement Mechanism
    • Order Types
      • Market Order
      • Limit Order
      • Order Rules & Constraints
    • Margin & Leverage
    • Funding Rates
    • Liquidations
  • API Documentation
    • API
      • REST API
        • Markets
          • Get market info
          • Get prices
          • Get kline (candle) data
          • Get recent trades
        • Account
          • Get account info
          • Get account settings
          • Update leverage
          • Update margin mode
          • Get positions
          • Get trade history
          • Get funding history
          • Get account equity history
          • Create subaccount
          • Request withdrawal
        • Orders
          • Get open orders
          • Get order history
          • Get order history by ID
          • Create order
          • Create stop order
          • Create position TP/SL
          • Cancel order
          • Cancel all orders
          • Cancel stop order
          • Batch orders
      • Websocket
        • Subscriptions
          • Prices
          • Orderbook
          • Trades
          • Candle
          • Order updates
          • Account balance
          • Account margin
          • Account leverage
          • Account positions
          • Account orders
          • Account order updates
          • Account trades
        • Trading operations
          • Create order
          • Cancel order
          • Cancel all orders
      • Signing
      • Rate limits
    • Specification
  • Other
    • Audits
    • Brand Assets
    • Contact Us
    • Glossary of Terms
Powered by GitBook
On this page
  • Params
  • Stream
  1. API Documentation
  2. API
  3. Websocket
  4. Subscriptions

Account positions

Streams all changes made to an account's positions in any market. A position that has been fully closed will be streamed and return empty.

PreviousAccount leverageNextAccount orders

Last updated 1 day ago

Refer to for establishing the websocket connection.

Params

{
    "method": "subscribe",
    "params": {
        "source": "account_positions",
        "account": "42trU9A5..."
    }
}

Stream

{
    "channel": "position",
    "data": [
        {
            "a": "3.1",
            "d": "ask",
            "f": "0",
            "i": false,
            "m": "0",
            "p": "14.156000000000",
            "s": "LINK",
            "t": 1749051466633
        },
        {
            "a": "1.3",
            "d": "ask",
            "f": "0",
            "i": false,
            "m": "0",
            "p": "3.226700000000",
            "s": "SUI",
            "t": 1749051466633
        },
        // ... other positions
    ]
}
Field
Type
Description

's'

string

Symbol

'a'

decimal string

Position amount

'p'

decimal string

Average entry price

't'

number

Timestamp in milliseconds

'd'

string

Position side (bid, ask)

'm'

decimal string

Position margin

'f'

decimal string

Position funding rate

'i'

bool

Is position isolated?

Websocket