Get All Positions

GET https://api.sfox.com/v1/margin/loans

Retrieve a list of your account's positions.

Rate Limit: 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

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

The ID of the order that opened the position

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
{
    "data": [
        {
            "id": 3835,
            "status": "CLOSED",
            "date_added": "2022-06-30T01:01:55.000Z",
            "date_loan_closed": "2022-06-30T01:02:47.000Z",
            "loan_currency": "btc",
            "collateral_currency": "usd",
            "pair": "btcusd",
            "original_collateral_qty": 2101.94565,
            "current_collateral_qty": 0,
            "original_loan_qty": 0.1,
            "current_loan_qty": 0,
            "interest_qty": 0,
            "interest_rate": 0.1,
            "margin_type": "MARGIN_SHORT",
            "order_id": 1127584,
            "proceeds": 0
        },
        {
            "id": 3836,
            "status": "CLOSED",
            "date_added": "2022-06-30T02:46:57.000Z",
            "date_loan_closed": "2022-07-01T02:41:01.000Z",
            "loan_currency": "btc",
            "collateral_currency": "usd",
            "pair": "btcusd",
            "original_collateral_qty": 2107.60095,
            "current_collateral_qty": 0,
            "original_loan_qty": 0.1,
            "current_loan_qty": 0,
            "interest_qty": 0,
            "interest_rate": 0.1,
            "margin_type": "MARGIN_SHORT",
            "order_id": 1127591,
            "proceeds": 0
        }
    ]
}

Example Requests

curl -H 'Authorization: Bearer <API_TOKEN>' \
https://api.sfox.com/v1/margin/loans

Last updated