Skip to content

Positions and balances

Nothing at IDEALX stores a balance as a number that gets updated. Every balance and position is read from a double-entry ledger, so what the API returns always adds up to the account’s history.

GET /v1/accounts/{id}/detail lists each portfolio’s balances: one per currency held, as an instrument id (the currency code, for example AUD), an amount and its currency.

"balances": [
{ "instrumentId": "AUD", "amount": "18250.40", "currency": "AUD" },
{ "instrumentId": "USD", "amount": "1200.00", "currency": "USD" }
]

Cash set aside for an open order or a conversion still belongs to the portfolio but cannot be spent twice; an order shows what it holds back in setAside.

A position is how much of one investment one portfolio holds. GET /v1/accounts/{id}/positions returns every position beyond cash with:

Field Meaning
portfolioId Where it is held
investment The listing, with its latest quote (see Investments and listings)
quantity Units held, a decimal string ("25", "0.0125")
quantityInOrders Units set aside for open sell orders
costBase What the units cost, in the investment’s currency
value, gain At the latest price; null without a price
valueInAccountCurrency, gainInAccountCurrency Converted to the account’s main currency at today’s middle rate; null without a rate

A position is made of lots: pieces with their own acquisition date and cost. Lots survive transfers between portfolios unchanged; sales use them oldest first (or the country’s own matching rules), which is what GET /v1/accounts/{id}/realised-gains and the tax report show.

Values are given with two flags:

  • approximate: at least one price or rate used is an estimate (a delayed quote, a middle rate).
  • complete: every position had a price. When false, the value leaves out what could not be priced.

breakdown splits a value into buckets: cash, yield, markets, digital_assets and strategies.