> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xmonaco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# V0.8.7

# 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.

```typescript theme={null}
const summary = await sdk.marginAccounts.getMarginAccountSummary(marginAccountId);

// summary.withdrawable_collateral is now safe to pre-fill into a "Max" button
await sdk.marginAccounts.transferCollateralFromMarginAccount(marginAccountId, {
  asset: "USDC",
  amount: summary.withdrawable_collateral,
});
```

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:

```typescript theme={null}
// Before — would sometimes return hot-cache entries:
const { latest_orders, orders } = await sdk.trading.getOrders({ page: 1 });

// After — use the paginated array directly:
const { orders } = await sdk.trading.getOrders({ page: 1 });
```

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

```bash theme={null}
npm install @0xmonaco/core@0.8.7 @0xmonaco/types@0.8.7 @0xmonaco/react@0.8.7
# or bun
bun add @0xmonaco/core@0.8.7 @0xmonaco/types@0.8.7 @0xmonaco/react@0.8.7
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.