Skip to Content
Scalar
Trading APIs

Get account balance and margin

Returns the current balance and margin requirement for a user, after any accepted withdrawals have been subtracted from balance. Requires an `Authorization: Bearer` SIWE token proving control of `user`; otherwise 401.

GET
/account/{user}

Returns the current balance and margin requirement for a user, after any accepted withdrawals have been subtracted from balance. Requires an Authorization: Bearer SIWE token proving control of user; otherwise 401.

Authorization

bearer_auth
headerAuthorizationBearer <token>

Path Parameters

user*string

User address in hex format (0x prefix optional)

Response Body

Account balance and margin

application/json
  1. response

Account-level collateral. The single source for balance/margin — they deliberately do not also appear on [Position], where they would carry an independent staleness.

balance*string

Account collateral balance, micro-dollars (base-10 string; CASH_DENOMINATOR = 1e6 per $1)

margin*string

Total account margin across all instruments, micro-dollars

user*string

User address as 0x-prefixed lowercase hex

Example Request
curl -X GET 'https://testnet-api.scalar.market/account/string'
Example Response
{
  "balance": "string",
  "margin": "string",
  "user": "string"
}