sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Post-Trade Settlement (PTS)

Get All Positions

PreviousGet Account Risk MetricsNextGet All Funding Transactions

Last updated 1 year ago

GET https://api.sfox.com/v1/post-trade-settlement/positions

Retrieve a list of your account's positions.

: 10 requests per 10 seconds

Query Parameters

Name
Type
Description

status

String

Filter response by position status

active (default) = active positions

closed = settlement history

pair

String

Filter response by currency pair associated with the position i.e. btcusd

loan_currency

String

Filter response by loan currency i.e. btc

collateral_currency

String

Filter response by collateral currency i.e. btc

margin_type

String

Filter response by margin type

PTS_SHORT = short positions

PTS_LONG = long positions

from

String

Starting UNIX timestamp (in millis)

to

String

Ending UNIX timestamp (in millis)

page_size

String

The number of positions sent in the request. Default/Max = 100

page_cursor

String

The last Position Id of the previous page. The request will contain orders following the cursor.

Response Body

Key
Description

id

Position ID

status

The status of the position ACTIVE : Outstanding pending settlement CLOSED : Settled

date_added

Date and time the position was opened

date_loan_closed

The date and time the position was settled (null if position is active)

loan_currency_symbol

Currency borrowed

current_loan_qty

The amount currently awaiting settlement including interest if applicable

collateral_currency

Order proceeds currency

pair

Currency pair traded to open the position

interest_rate

The annualized interest rate of the borrowed currency

interest_qty

The amount of interest that has been charged to this position in terms of the currency borrowed

margin_type

Long or short

order_id_open

The ID of the order that opened the position

order_id_close

The ID of the order that closed/settled the position, if applicable (null if position is active or settled via transfer)

proceeds

Proceeds of the collateral currency as a result of this position

vwap

Open Price. The fill price of the order that opened the position

Responses

200
{
    "id": 3065,
    "status": "ACTIVE",
    "date_added": "2022-06-01T19:49:53.000Z",
    "date_loan_closed": null,
    "loan_currency_symbol": "btc",
    "current_loan_qty": 0.03349122,
    "collateral_currency": "usd",
    "pair": "btcusd",
    "interest_rate": 0.1,
    "interest_qty": 0.0000931,
    "margin_type": "PTS_SHORT",
    "order_id_open": 1117465,
    "order_id_close": null,
    "proceeds": 1003.651384,
    "vwap": 29967.597
}

Example Requests

curl -H 'Authorization: Bearer <API_TOKEN>' \
https://api.sfox.com/v1/post-trade-settlement/positions
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/post-trade-settlement/positions',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.get(
  "https://api.sfox.com/v1/post-trade-settlement/positions",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
Rate Limit