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
  1. API Documentation
  2. API
  3. REST API
  4. Account

Get trade history

GET /api/v1/positions/history

Query Parameters

Field
Type
Need
Description
Example

"account"

string

required

User's wallet address

42trU9A5...

"symbol"

string

optional

Market symbol to filter by

BTC

"start_time"

integer

optional

Start time in milliseconds

1625097600000

"end_time"

integer

optional

End time in milliseconds

1625184000000

"limit"

integer

optional

Maximum number of records to return, defaults to system defined limit

100

"offset"

integer

optional

Number of records to skip

0

/api/v1/positions/history?account=42trU9A5...&start_time=1625097600000&end_time=1625184000000&granularity_in_minutes=60&limit=100"

Response

  • Status 200: Successfully retrieved portfolio position history

  [
    {
      "history_id": 1370,
      "order_id": 42347,
      "client_order_id": null,
      "symbol": "BTC",
      "amount": "0.00259000",
      "price": "106093.000000",
      "entry_price": "104004.521434",
      "fee": "0.192347",
      "pnl": "5.216813",
      "event_type": "fulfill_taker",
      "side": "open_long", 
      "created_at": 1748915204704,
      "counter_party": "ACzEZTg...",
      "cause": "normal"
    }
  ]
Field
Type
Description

'event_type'

string

"fulfill_taker" if maker "fulfill_maker" if taker

'side'

string

"open_long" "open_short" "close_long" "close_short"

'cause'

string

"normal" regular user-initiated trading "market_liquidation" position was liquidated due to insufficient margin "backstop_liquidation" position was liquidated by backstop mechanism "settlement" position was closed due to Auto-Deleveraging (ADL) or other settlement

  • Status 400: Invalid request parameters

  • Status 401: Unauthorized access

  • Status 500: Internal server error

Code Example (Python)

import requests

response = requests.get(
    "/api/v1/positions/history?account=42trU9A5...&symbol=BTC&limit=100&offset=0",
    headers={"Accept": "*/*"},
)

data = response.json()
PreviousGet positionsNextGet funding history

Last updated 2 days ago