Skip to main content

Monaco Protocol SDK v0.8.7

withdrawable_collateral now reflects what can actually be moved

MarginAccountSummary.withdrawable_collateral and the new_withdrawable_collateral field returned by transferCollateralToMarginAccount / transferCollateralFromMarginAccount now return the risk-bounded free collateral amount instead of equity-based available_margin. Previously the field could overstate the withdrawable amount when an account had realized PnL gains or lower live free collateral, because equity-based available_margin includes PnL. Using the field as the “Max” value for transferCollateralFromMarginAccount could fail risk validation.
Affects: getMarginAccountSummary, listMarginAccounts, transferCollateralToMarginAccount, transferCollateralFromMarginAccount.

Transfer-out and isolated margin reduction use margin state directly

transferCollateralFromMarginAccount no longer depends on wallet-side mirrored margin collateral. Transfer-out validation uses the margin account’s free collateral and collateral asset binding directly. The same model applies to sdk.positions.reducePositionMargin: isolated margin reduction uses margin position/account state and credits spot wallet balance through the transfer ledger. No SDK signature changes — affected calls just succeed where they used to error.

latest_orders and latest_movements are now always undefined

The optional latest_orders field on getOrders() and latest_movements field on getUserMovements() were a Redis hot-cache shadow. With Redis removed from the orders/movements path, the backend no longer populates them — both fields are still declared optional on the response types but will always be undefined. If you were reading them, switch to the paginated orders / movements arrays:
No breaking type change — the fields remain on the response interface as optional.

Open interest

The TS SDK already exposed open_interest_base and open_interest_notional on sdk.market.getOpenInterest() — those fields are now sourced from live margin positions instead of OHLCV candles (where the underlying column was never populated and the values came back null). Existing callers see correct values. The OpenInterest type also gains an optional open_interest?: string field as a base-units alias for backward compatibility with consumers that read the older field name.

Upgrade