> For the complete documentation index, see [llms.txt](https://ocx.gitbook.io/ocx-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ocx.gitbook.io/ocx-doc/ocx/product/settlement.md).

# settlement

OCX uses a hybrid settlement model: **on-chain custody for funds, off-chain matching for trades**.

## Custody on Base

USDC deposits are held in an on-chain vault on the Base network. The vault address and associated contracts are public and verifiable on-chain.

| Asset         | Network                      | Address                                      |
| ------------- | ---------------------------- | -------------------------------------------- |
| USDC-T        | Base Sepolia (chainId 84532) | `0x3295682B1Ee3B069de71371B649aFe7b74f4774E` |
| Vault         | Base Sepolia                 | `0x66733107356D31712D6272d91374f962C087910c` |
| Wallet Router | Base Sepolia                 | `0x1967f0d076B6ffA9B4C32a57bcC01Ec1af77bd59` |

## Deposit flow

1. You send USDC-T to the OCX vault from your wallet.
2. An indexer verifies the transaction and credits your wallet balance.
3. Funds become immediately usable — you can transfer to the perps or options bucket and begin trading.

Typical time from confirmation to credited balance: **under one block**.

## Trading flow

Once your balance is credited, orders execute against an off-chain central limit order book. Trades settle instantly in the database; there is no per-trade gas cost. Positions and PnL are visible in your portfolio view in real time.

## Withdrawal flow

1. You submit a withdrawal request through the API or UI. Your `tradableBalance` is immediately debited and moved to a `pendingWithdrawal` state.
2. An automated keeper batches and executes the on-chain transfer back to your wallet via the Wallet Router contract.
3. Once confirmed, the withdrawal transitions to `settled` and is recorded with the on-chain transaction hash.

Typical withdrawal confirmation: **under one minute**.

## Buckets

Your USDC balance is partitioned into buckets so that risk is isolated between products:

| Bucket    | Used for                                           |
| --------- | -------------------------------------------------- |
| `wallet`  | Idle balance, available for transfer or withdrawal |
| `spot`    | Collateral for spot trading                        |
| `perps`   | Collateral for perpetual and futures trading       |
| `options` | Collateral for options trading                     |

Transfers between buckets are instant and incur no fee. See the [Wallet API](file:///7302513/api/wallet.md) for endpoints.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocx.gitbook.io/ocx-doc/ocx/product/settlement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
