Settlement is the process that finalizes executions produced by the matching engine by updating balances in the trading ledger.
Matching determines who trades with whom and at what price; settlement determines how balances change as a result. Every execution, regardless of size, is settled through the same atomic accounting process.
Role in the Trading Flow
Settlement occurs after an execution has been produced by the matching engine and acknowledged by Symbol Order State (SOS).
At this point the trade has already happened, price and quantity are fixed, and counterparties are known.
Settlement applies the results of that trade correctly and completely.
Atomic Ledger Updates
Every execution is settled as a single atomic operation in the trading ledger.
Settlement applies all balance changes related to a trade together, ensuring that either the entire update succeeds or nothing is applied at all. There are no partial outcomes and no intermediate states.
For each execution, settlement may involve multiple simultaneous balance movements.
Example: One execution, multiple balance changes
Consider a single BTC/USDT execution with the following conditions:
- Execution size: 1 BTC
- Execution price: 100,000 USDT
- Buyer trading fee: 0.10%
- Buyer VIP discount: 0.02%
- Maker rebate (seller): 0.01%
- Remaining fee goes to Polyester Treasury
Trade Context
- Buyer pays 100,000 USDT to acquire 1 BTC
- Gross trading fee = 100 USDT
- VIP discount reduces buyer fee by 20 USDT
- Net buyer fee = 80 USDT
- Seller receives a 10 USDT maker rebate
- Polyester retains 70 USDT in net fees
Atomic Settlement Result
Settlement applies the following balance changes together, as one atomic update:
Buyer
- USDT: −100,000 (trade amount)
- USDT: −80 (net trading fee)
- BTC: +1
- USDT: +20 (VIP discount credit)
Seller (Maker)
- BTC: −1
- USDT: +100,000
- USDT: +10 (maker rebate)
Polyester Treasury
- USDT: +70 (net trading fees)
All of these debits and credits occur together, or not at all.
Reservation Release and Balance Finalization
As part of settlement, any reservations placed during admission are adjusted or released.
- Reserved funds are converted into finalized debits.
- Unused reservations are returned to available balance.
- Fees and rebates are finalized at settlement time.
This ensures that available balances always reflect settled state, not pending intent.
Settlement Outputs
Once settlement completes, it produces finalized records that drive the rest of the system.
- Both counterparties see updated trading balances.
- Execution records are published as market data.
- Entries are written to the append-only immutable database.