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
        • Account
        • Agent
        • Funding
        • Info
        • Kline
        • Orders
        • Portfolio
        • Positions
        • Models
      • Websocket
        • Orderbook
        • Trades
        • Orders
        • Positions
        • User Order History
        • User Trade History
        • Candle
        • Account Data
    • Specification
  • Other
    • Brand Assets
    • Contact Us
    • Glossary of Terms
Powered by GitBook
On this page
  1. API Documentation
  2. API
  3. REST

Positions

PreviousPortfolioNextModels

Get Current Positions

get

This endpoint allows users to get current positions.

Query parameters
accountstringRequired

User account address

Responses
200
Successfully retrieved current positions
application/json
400
Invalid request parameters
401
Unauthorized access
500
Internal server error
get
GET /api/v1/positions?account=text HTTP/1.1
Host: 
Accept: */*
[
  {
    "amount": "0.0067",
    "createdAt": "2025-03-18T20:01:26.983080Z",
    "entryPrice": "82124.29850746268656716417911",
    "isolated": false,
    "margin": "-0.2483864",
    "side": "bid",
    "symbol": "BTC",
    "updatedAt": "2025-03-21T20:00:21.295592Z"
  }
]

Get Position History

get

This endpoint allows users to get position history.

Query parameters
accountstring | nullableOptional

User account address (optional)

symbolstring | nullableOptional

Market symbol to filter by (optional)

start_timeinteger · int64 | nullableOptional

Start time in milliseconds (optional)

end_timeinteger · int64 | nullableOptional

End time in milliseconds (optional)

limitinteger · int64 | nullableOptional

Maximum number of records to return (optional, defaults to system defined limit)

offsetinteger · int64 | nullableOptional

Number of records to skip (optional, defaults to 0)

Responses
200
Successfully retrieved position history
application/json
400
Invalid request parameters
401
Unauthorized access
500
Internal server error
get
GET /api/v1/positions/history HTTP/1.1
Host: 
Accept: */*
[
  {
    "amount": "0.0011",
    "counterParty": "6TUfbNv7euNithYNdXWDaMYidX1pmLxCgxFGKpKmmt1C",
    "createdAt": "2025-03-21T09:12:12.652363Z",
    "entryPrice": "82124.29850746268656716417911",
    "eventType": "open_long",
    "fee": "0.017820",
    "historyId": 710023,
    "isMaker": true,
    "pnl": "-0.017820",
    "price": "81000",
    "symbol": "BTC"
  }
]
  • GETGet Current Positions
  • GETGet Position History
  • POSTSet take profit and stop loss for a position

Set take profit and stop loss for a position

post

This endpoint allows users to set take profit and stop loss levels for an existing position.

Body
agent_walletstring | nullableOptionalExample: AgentWalletAddress123
sidestringRequiredExample: bid
signaturestringRequiredExample: 5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc
stop_lossall of | nullableOptional
symbolstringRequiredExample: BTC
take_profitall of | nullableOptional
userstringRequiredExample: Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6
Responses
200
Take profit and stop loss set successfully
application/json
400
Bad request
application/json
500
Internal server error
application/json
post
POST /api/v1/positions/tpsl HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 373

{
  "agent_wallet": "AgentWalletAddress123",
  "side": "bid",
  "signature": "5j1Vy9UqYUF2jKD9r2Lv5AoMWHJuW5a1mqVzEhC9SJL5GgbPkGEQKpW3UZmKXr4UMrHMJ5xHQFMJk2wE8J5Vyc",
  "stop_loss": {
    "amount": "0.3",
    "limit_tick_level": 125,
    "stop_tick_level": 120
  },
  "symbol": "BTC",
  "take_profit": {
    "amount": "0.3",
    "limit_tick_level": 125,
    "stop_tick_level": 120
  },
  "user": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
}
{
  "success": true
}