Skip to main content
Testnet-Only. Use https://test-dex-api.cloud.aultblockchain.xyz for these endpoints and the matching Testnet chain for signed actions. This product is not available on Mainnet.
These endpoints describe leveraged Spot accounts backed by Lending. They are separate from Perp margin. Read Margin Trading for the product rules.

Routes

All routes use GET under /api/v1/margin. market_id is hex and takes precedence over symbol. symbol is a Spot BASE/QUOTE pair. margin_mode is cross or isolated. owner identifies the wallet; address and account identify a derived Margin account. Use discovery results unchanged. Repeat type to select activity categories: deposit, withdraw, reservation, borrow.auto, borrow.manual, repay.settlement, repay.cancel, repay.manual, repay.skipped, settlement, forceCancel. Both feeds accept paired legacy before_height/before_index; prefer the opaque cursor. Invalid filters or no owner/account on a feed return 400. A missing position returns 404. Health dependencies can return 503, or a response can retain its balances while returning null valuation fields and healthError.

Balances and derived risk

Per-denom total, used, free, debt and maxTransferable are raw base-unit strings. free = total - used is unreserved collateral, not a safe withdrawal estimate. maxTransferable applies the API’s indexed borrow-capacity calculation and is capped by free. With debt it is null if health cannot be priced; a debt-free account can still report free collateral. It is not a transaction-execution guarantee. Debt includes accrued interest. Valuation totals retain the raw Lending amount/price scale; ratios and leverage are dimensionless. liquidationPrice is nullable and must not be treated as an executable closeout price. marginCallBar and forceLiquidationBar are API display configuration, not new on-chain liquidation thresholds. enabled and marginLendingPoolId describe indexed configuration. Market maxLeverageBuy and maxLeverageSell are side-specific calculations from the received asset’s Lending LTV and taker fee; maxLeverage is the smaller bound and can be null. These values are not Perp leverage tiers. Activity amount is signed for reservation changes, negative on release; after is the resulting reservation and is otherwise null. Liquidation records include seized/repaid coins, canceled order IDs and bad debt.
Use the returned account address with Spot orders and fills. Margin-owned Spot orders can carry marginMode, marginOwner, autoRepay and autoRepayAtCancel decorations. No Margin-specific WebSocket channel is registered.

Response field reference

Types below describe JSON, not numeric units. See the unit notes above. Nullable values must not be replaced with zero.
collateralsInOrder contains Coin objects with string denom and raw-unit string amount.