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

# Monaco Protocol SDK v0.8.11

This release adds life-to-date market statistics, asset-class categorisation on trading pairs, and direct deposit routing into margin collateral. It also removes the deprecated `CreateConditionalOrder` gRPC RPC and fixes a scoping bug in parent-account collateral transfers.

## Removed

### `CreateConditionalOrder` gRPC RPC removed

The deprecated `CreateConditionalOrder` RPC and its `CreateConditionalOrderRequest` / `CreateConditionalOrderResponse` messages are **removed** from `monaco.api.orders.OrdersService`. The method had been returning `FAILED_PRECONDITION` since standalone conditional TP/SL creation was deprecated in v0.8.7. The Rust gRPC SDK drops the generated `create_conditional_order` client method and the associated types.

**Migration:** attach TP/SL at order placement via `CreateOrder`, or use `AttachPositionTpSl` / `sdk.positions.attachPositionTpSl(...)`. Listing and cancelling conditional orders are unchanged.

## Added

### Asset-class `category` on trading pairs

Every trading pair now carries a `category` field indicating its asset class: `"crypto"`, `"equities"`, or `"commodities"`.

Affected surfaces:

* `TradingPair` (returned by `GET /api/v1/market/pairs`, `GET /api/v1/market/pairs/{trading_pair_id}`, and gRPC `ListTradingPairs` / `GetTradingPair`) gains `category: string`.
* `ScreenerItem` (returned by `GET /api/v1/market/screener` / `GetScreener`) gains `category: string`.
* `ListTradingPairsRequest` and `GetScreenerRequest` accept an optional `category` filter. Invalid values return 400.

Existing pairs are backfilled: `crypto` by default; known equity/RWA markets (NVDA, SPX, AMZN, GOOG, META, TSLA, SPCX) as `equities`. The field is always present and never null.

```typescript theme={null}
// Filter by asset class
const equities = await sdk.market.getPaginatedTradingPairs({ category: "equities" });
const cryptoScreener = await sdk.market.getScreener({ category: "crypto" });
```

### Life-to-date market statistics

New `GET /api/v1/market/stats` (no auth) returns exchange-wide cumulative statistics:

```typescript theme={null}
const stats = await sdk.market.getMarketStats();
// { total_quote_volume_ltd: "123456789.00", total_trade_count_ltd: 98765 }
```

Per-pair life-to-date totals are also added to existing responses:

* `MarketMetadata` (`getMarketMetadata`) gains `total_base_volume_ltd`, `total_quote_volume_ltd` (decimal strings), and `total_trade_count_ltd` (number).
* `ScreenerItem` (`getScreener`) gains `total_quote_volume_ltd` (decimal string) and `total_trade_count_ltd` (number).

All volume fields are decimal strings in display units. Pairs with no trades report `"0"` / `0`, never null. The global endpoint omits base volume intentionally — base quantities are not comparable across different base assets.

### Direct deposit to margin collateral

`vault.deposit()` accepts an optional `target` parameter to route an on-chain deposit straight into margin collateral, skipping the separate `transferCollateralToAutoMarginAccount` step:

```typescript theme={null}
// Spot deposit (default — unchanged)
await sdk.vault.deposit(assetId, amount);

// Route deposit directly into the parent margin account's collateral
await sdk.vault.deposit(assetId, amount, true, "margin");
```

`target` is `"spot"` (default) or `"margin"`. Deposits that cannot be routed to margin (unsupported asset, etc.) fall back to spot automatically.

The encoding is handled by the new `encodeDepositApplicationData()` helper — spot deposits remain byte-identical to before, so existing integrations are unaffected.

The MCP `vault_deposit` tool accepts the same optional `target` input.

## Fixed

### Parent margin account collateral transfers now correctly scope to parent

`marginAccounts.transferCollateralToMarginAccount(parentMarginAccountId, { asset, amount })` and `transferCollateralFromMarginAccount(parentMarginAccountId, { asset, amount })` now stay scoped to the parent account when `tradingPairId` is omitted, even when an active cross-margin bucket exists. Previously the REST API could route a parent-level transfer into an active cross bucket.

Transfer-out from the parent also now correctly honors live collateral when there is a temporary projection lag, instead of rejecting it as isolated bucket collateral.

### `getAvailableCollateral` returns parent account free collateral

`marginAccounts.getAvailableCollateral({ asset })` previously returned 0 for the parent account in certain configurations. It now correctly surfaces the parent margin account's free collateral alongside the bound asset balance.

## Upgrade

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


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