Get All Positions
GET https://api.sfox.com/v1/margin/loans
Retrieve a list of your account's positions.
Query Parameters
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
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
Example Requests
curl -H 'Authorization: Bearer <API_TOKEN>' \
https://api.sfox.com/v1/margin/loansconst axios = require('axios');
axios({
method: 'get',
url: 'https://api.sfox.com/v1/margin/loans',
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/margin/loans",
headers={
"Authorization": "Bearer <API_KEY>",
}
)
print(data)Last updated