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.
Cash balances
Section titled “Cash balances”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.
Positions
Section titled “Positions”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. Whenfalse, the value leaves out what could not be priced.
breakdown splits a value into buckets: cash, yield, markets, digital_assets and strategies.
Endpoints
Section titled “Endpoints”- GET
/v1/accounts/{id}/detailAn account with its portfolios and balances - GET
/v1/accounts/{id}/positionsWhat each portfolio owns beyond cash, with cost base and value - GET
/v1/accounts/{id}/realised-gainsSales, lot by lot: cost, proceeds and gain - GET
/v1/accounts/{id}/reports/allocationHow the account (or a portfolio) splits by kind of asset and by currency - GET
/v1/accounts/{id}/currency-accountsThe account's currency accounts and the currencies it can ask for - GET
/v1/accounts/{id}/yieldYield on this account, with interest so far - GET
/v1/accounts/{id}/incomeDividends, interest, repayments and splits received