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

# Monaco Protocol SDK v0.7.2

## Vault Deposits

Monaco's vault contract has been upgraded. Deposits now embed the application's
`client_id` directly in the on-chain call. The public `sdk.vault.deposit()`
signature is unchanged — no code changes required for existing callers.

### What changed

* `@0xmonaco/contracts`: Vault ABI updated. ERC20 deposits now call
  `depositERC20(destination, clientId, token, amount)`; native SEI deposits
  use `depositNative(destination)`.
* `@0xmonaco/core`: `sdk.vault.deposit()` reads `clientId` from
  `applications.getApplicationConfig()` and calls the new entrypoints.
  Public method signature unchanged.
* `@0xmonaco/types`: `ApplicationConfigResponse` now includes `clientId`.

### No migration required

`sdk.vault.deposit(assetId, amount)` behaves identically for callers.

***

## Margin Transfers — Balance Coherence

Collateral movement now keeps wallet balances, WebSocket balance events, and
UI state aligned after margin transfers.

### New balance event reasons

`UserBalanceEvent.data.reason` has two new values:

| Reason | Description |
| - | - |
| `margin_transfer_in` | Collateral moved from wallet into a margin account |
| `margin_transfer_out` | Collateral moved from a margin account back to the wallet |

### `TransferCollateralResponse` — new fields

Both `transferCollateralToMarginAccount()` and `transferCollateralFromMarginAccount()`
now return:

| Field | Type | Description |
| - | - | - |
| `new_total_collateral_value` | string | Total collateral value after the transfer |
| `new_withdrawable_collateral` | string | Amount withdrawable from the account after the transfer |

Use these to update the UI immediately without a separate refresh call.

### `useUserBalances` behavior (React)

Spot-only balance events (order fills, locks) now preserve the existing
margin-collateral component of `total_balance`. A `margin_transfer_in` or
`margin_transfer_out` event replaces the full total. This prevents the wallet
total from briefly dropping after a spot event when collateral is also locked
in a margin account.

***

## Upgrade

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

No breaking changes. No migration steps required.


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