Skip to main content

Read positions

A user's protection​

curl $BFX/api/v2/hedges -H "Authorization: Bearer $TOKEN"
{
"hedges": [
{
"pair": "USD/NGN",
"position": {
"ref": { "chain": "stellar-testnet", "contract": "CBW3...", "id": "position/1" },
"positionId": 1, "poolId": 1, "structure": "capped", "direction": "up",
"status": "active", "tenorDays": 14,
"createdAt": 1792454252, "expiry": 1793663852,
"notional": "10000", "spot": "1331.61657", "strike": "1358.248901", "cap": "1494.073792",
"fairRateE6": 11768, "premiumRateE6": 13533,
"premium": "135.33", "fee": "6.7665", "maxPayout": "1020.0000064",
"settlementPrice": null, "payout": "0"
},
"settlement": { "position": "...", "settlementPrice": null, "grossPayout": "0", "fee": "0", "netPayout": "0", "status": "pending" }
}
]
}

One position: GET /api/v2/hedges/:ref.

A pool​

curl "$BFX/api/v2/pools/$POOL" # terms, fees, liquidity
curl "$BFX/api/v2/pools/$POOL/positions" # active cover it has sold

Market data​

EndpointReturns
GET /api/v2/ratesWatchlist rates with change since the last daily close
GET /api/v2/spot?pair=Today's rate
GET /api/v2/chart?pair=&range=Chart points: 1H, 6H, 24H, 1M, 3M, 6M, YTD, 1Y, 5Y, MAX
GET /api/v2/history?pair=&days=Daily closes, 5 to 400 days
GET /api/v2/fair?pair=&direction=&tenors=&distance=Fair rate per tenor at a reference strike distance bps from spot and a limit 10% beyond

Balances​

curl $BFX/api/v2/balances -H "Authorization: Bearer $TOKEN"