Skip to main content
POST
/
account
curl --request POST \
  --url https://exchange-api.bulk.trade/api/v1/account \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "fullAccount",
  "user": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
}
'
[
  {
    "fullAccount": {
      "margin": {
        "totalBalance": 123,
        "availableBalance": 123,
        "marginUsed": 123,
        "notional": 123,
        "realizedPnl": 123,
        "unrealizedPnl": 123,
        "fees": 123,
        "funding": 123
      },
      "positions": [
        {
          "symbol": "<string>",
          "size": 123,
          "price": 123,
          "fairPrice": 123,
          "notional": 123,
          "realizedPnl": 123,
          "unrealizedPnl": 123,
          "leverage": 123,
          "liquidationPrice": 123,
          "fees": 123,
          "funding": 123,
          "maintenanceMargin": 123,
          "lambda": 123,
          "riskAllocation": 123,
          "allocMargin": 123
        }
      ],
      "openOrders": [
        {
          "symbol": "<string>",
          "orderId": "<string>",
          "price": 123,
          "originalSize": 123,
          "size": 123,
          "filledSize": 123,
          "vwap": 123,
          "isBuy": true,
          "maker": true,
          "reduceOnly": true,
          "tif": "gtc",
          "status": "placed",
          "timestamp": 123
        }
      ],
      "leverageSettings": [
        {
          "symbol": "<string>",
          "leverage": 123
        }
      ]
    }
  }
]

Request Examples

{
  "type": "fullAccount",
  "user": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
}

Response Schemas

Responses are always an array of objects; each object has a single key (fullAccount, openOrder, fills, positions, fundingPayment, or orderHistory) depending on the query type.

Full Account Response

For type: "fullAccount". Returns complete state: margin, positions, open orders, and leverage settings.
[
  {
    "fullAccount": {
      "margin": {
        "totalBalance": 100000.0,
        "availableBalance": 95000.0,
        "marginUsed": 5000.0,
        "notional": 50000.0,
        "realizedPnl": 1234.0,
        "unrealizedPnl": 500.0,
        "fees": 12.5,
        "funding": -5.0
      },
      "positions": [
        {
          "symbol": "BTC-USD",
          "size": 0.5,
          "price": 100000.0,
          "fairPrice": 100050.0,
          "notional": 50000.0,
          "realizedPnl": 1234.0,
          "unrealizedPnl": 500.0,
          "leverage": 5.0,
          "liquidationPrice": 80000.0,
          "fees": 12.5,
          "funding": -5.0,
          "maintenanceMargin": 2500.0,
          "lambda": 0.05,
          "riskAllocation": 0.8,
          "allocMargin": 4000.0
        }
      ],
      "openOrders": [
        {
          "symbol": "BTC-USD",
          "orderId": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
          "price": 100000.0,
          "originalSize": 0.1,
          "size": 0.1,
          "filledSize": 0.0,
          "vwap": 0.0,
          "isBuy": false,
          "maker": true,
          "reduceOnly": false,
          "tif": "gtc",
          "status": "resting",
          "timestamp": 1704067200000000000
        }
      ],
      "leverageSettings": [
        { "symbol": "BTC-USD", "leverage": 5.0 },
        { "symbol": "ETH-USD", "leverage": 3.0 }
      ]
    }
  }
]
Margin fields: totalBalance, availableBalance, marginUsed, notional, realizedPnl, unrealizedPnl, fees, funding Position fields: symbol, size, price, fairPrice, notional, realizedPnl, unrealizedPnl, leverage, liquidationPrice, fees, funding, maintenanceMargin, lambda, riskAllocation, allocMargin

Open Orders Response

For type: "openOrders". Returns up to 5000 resting orders; each item is an object with key openOrder.
[
  {
    "openOrder": {
      "symbol": "BTC-USD",
      "orderId": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
      "price": 99000.0,
      "originalSize": 0.1,
      "size": 0.1,
      "filledSize": 0.0,
      "vwap": 0.0,
      "isBuy": true,
      "maker": true,
      "reduceOnly": false,
      "tif": "gtc",
      "status": "resting",
      "timestamp": 1699564800000000000
    }
  }
]

Fills Response

For type: "fills". Returns up to 5000 recent fills; each item has key fills.
[
  {
    "fills": {
      "maker": "maker_pubkey_base58",
      "taker": "taker_pubkey_base58",
      "orderIdMaker": "maker_order_hash",
      "orderIdTaker": "taker_order_hash",
      "isBuy": true,
      "symbol": "BTC-USD",
      "amount": 0.1,
      "price": 100000.0,
      "reason": "normal",
      "slot": 12345,
      "timestamp": 1699564800000
    }
  }
]
Fill reason: normal, liquidation, adl

Closed Positions Response

[
  {
    "positions": {
      "owner": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "symbol": "BTC-USD",
      "maxQuantity": 0.5,
      "totalVolume": 1.0,
      "avgOpenPrice": 99000.0,
      "avgClosePrice": 101000.0,
      "realizedPnl": 1000.0,
      "fees": 20.0,
      "funding": 5.0,
      "openTime": 1763310000000000000,
      "closeTime": 1763316177219383423,
      "closeReason": "normal"
    }
  }
]
Close Reason Values:
  • normal - Manually closed by user
  • liquidation - Closed due to liquidation
  • adl - Closed due to auto-deleveraging

Funding History Response

[
  {
    "fundingPayment": {
      "owner": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "symbol": "BTC-USD",
      "size": 0.5,
      "payment": 12.50,
      "fundingRate": 0.0001,
      "markPrice": 100000.0,
      "slot": 123456789,
      "timestamp": 1763316177219383423
    }
  }
]
Payment Field:
  • Positive = received funding
  • Negative = paid funding

Order History Response

For type: "orderHistory". Returns up to 5000 terminal orders; each item has key orderHistory.
[
  {
    "orderHistory": {
      "orderId": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
      "symbol": "BTC-USD",
      "side": "buy",
      "orderType": "limit",
      "tif": "gtc",
      "price": 100000.0,
      "vwap": 100025.5,
      "originalSize": 0.1,
      "executedSize": 0.1,
      "reduceOnly": false,
      "status": "filled",
      "reason": null,
      "slot": 12345,
      "timestamp": 1699564800000000000
    }
  }
]
Terminal Status Values:
  • filled - Fully filled
  • partiallyFilled - Partially filled
  • cancelled - Cancelled by user
  • cancelledRiskLimit - Risk limit exceeded
  • cancelledSelfCrossing - Self-trade prevention
  • cancelledReduceOnly - Would increase position
  • cancelledIOC - IOC expired
  • rejectedInvalid - Invalid parameters
  • rejectedRiskLimit - Risk limit on submission
  • rejectedCrossing - Post-only would cross
  • rejectedDuplicate - Duplicate order ID

Real-time Updates

For real-time account updates, use the WebSocket account stream.
{
  "method": "subscribe",
  "subscription": [{
    "type": "account",
    "user": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
  }]
}

Body

application/json

Account query parameters (no signature needed)

type
enum<string>
required

Type of account data to retrieve

Available options:
fullAccount,
openOrders,
fills,
positions,
fundingHistory,
orderHistory
user
string
required

User public key (base58)

Example:

"FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"

Response

Successful response

fullAccount
object

Complete account state with margin, positions, orders, and leverage settings