# Settlement

### Summary

Settlement is the post-trade movement of tokens between users, venues, and Terrace's internal wallets; the work that happens after a trade fills to make sure funds arrive where they need to go. Most platforms expose this complexity to the trader: hold balances on each venue, pre-fund every account, wait for withdrawals, manage chain-by-chain custody. Terrace's Settlement Service does the opposite. It decouples execution from settlement, runs the funds movement in the background, and unifies the experience across 60+ venues so users see one balance, one portfolio, and one set of consistent post-trade behaviors regardless of where a trade actually fills.

### Settlement today&#xD;

#### Overview

Settlement timing depends on the venue. Trades on decentralized exchanges settle on-chain at the speed of the underlying network. Trades on centralized exchanges (CEX) settle in roughly 30 minutes, governed by the venue's withdrawal cycle. Trades with market makers (MM) settle on a T+1 schedule, once a day at a fixed time. The reason these differ is structural: CEX and MM venues extend lines of credit and post-trade margin, while DEXs are fully pre-funded. Terrace's job is to make those mechanics invisible to the trader.

The Settlement Service has two parts. The Settlement Database tracks every token in flight: where it is (user wallet, Terrace omnibus wallet, CEX, MM, or in transit) and where it's going. The Settlement Engine executes the transfers: signing on-chain transactions, calling exchange withdrawal APIs, and managing the multi-leg movements required to clear a trade across venues. Together they give Terrace a single, authoritative view of unsettled funds and an automated path to clear them.

#### How a Trade Settles

Every fund movement is modeled as an instruction with a source, a destination, an amount, and a settlement type. The Engine routes instructions through three pipelines:

* Instant flows — direct transfers like depositing user funds to a venue ahead of execution.
* Background flows — venue-to-user withdrawals, executed in two legs: first from the CEX or MM into Terrace's pre-whitelisted omnibus wallet, then on-chain to the user. Funds are placed on a ledger hold while in flight, so they remain reflected in the user's balance and never appear lost.
* Inter-venue flows — transfers between venues, aggregated across users and corridors. When enough volume accumulates on a route (for example, USDC moving from Binance to OKX), the Engine batches the individual instructions into a single transfer, reducing on-venue withdrawal volume and fees.<br>

Every step is auditable. Each transfer stores a transaction hash or venue-side proof, and balances are continuously reconciled against on-chain truth so any discrepancy is detected and corrected automatically. Failed transfers retry with exponential backoff and roll back cleanly if they cannot complete, restoring the ledger and the user's available balance.

#### CeDeFi available-to-trade&#xD;

Because Terrace tracks unsettled funds at the user level, balances that are mid-settlement on a CEX or MM remain available to trade across qualifying venues. A user who sells ETH on OKX can immediately re-enter the market on Binance with the proceeds — they don't have to wait for the original trade to clear and withdraw. This is what powers Terrace's CeDeFi available-to-trade balance: the consolidated view of settled wallet holdings plus in-flight CEX/MM positions. On purely on-chain (DEX) trades, the user trades only what's settled in their wallet, since DEX execution is pre-funded by definition.

#### Coverage

The Settlement Service operates across the chains and venues Terrace aggregates:

* **Chains**: Ethereum, Arbitrum, Optimism, Polygon, Base, BNB Chain, Avalanche, Blast, Solana, Bitcoin, Litecoin, and Dogecoin.
* **Centralized exchanges**: Binance, Bybit, OKX, Gate, and MEXC.
* **Market makers and OTC**: B2C2 and other institutional liquidity providers.

Each chain has a dedicated transaction manager that handles signing and broadcasting; each venue has an integration that drives deposits and withdrawals through its API. New venues and chains plug into the same instruction model, so coverage expands without changing the user experience.

### On the Roadmap

Two enhancements to today's settlement model are in active development:

* Net settlement. As volume grows, Terrace will net settle at the venue and platform level, offsetting buys and sells before any funds move. This will further reduce settlement times, withdrawal volume from CEXes, and operational overhead. Coming soon.
* Instant settlement. For a defined set of liquid tokens (USDC, USDT, ETH, and others across major chains), Terrace will deliver settled funds to the user the moment a trade fills, even when execution happens off-chain or cross-chain. The user sees the new balance immediately; Terrace clears the underlying movement using its own liquidity in the background. Coming soon.

<br>

<br>

<br>


---

# Agent Instructions: 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://docs.terrace.fi/features/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.
