TESTNET
Markets
Trade
Lending Vaults
More
User Docs Developer Docs Sdk API Docs Help
Welcome to Polyester
Concepts
Overview
Creating an Account
Authentication Methods
Turnkey
Smart Wallets
Dashboard
Account Security
MFA
Asset Lifecycle
Supported Assets
Deposit Funds
Withdraw Funds
Transfer Funds
Inventory and Supply
Overview
Trading Fees
Base vs Quote
Lending Fees
Withdrawal Fees
Liquidation Fees
Rebates
Overview
On-chain Visibility
Overview
Supplying
Borrowing
Collateral
Interest
Liquidations
Overview
Trades
Candles
Order Book
Data Delivery
Notifications
Appearance
Localization
Sound Effects
Overview
Architecture
Benchmarks
Matching Engine
Settlement
Safeguards
Overview
Validators
Gas Abstraction
Layer-1 Benchmarks
Audits
Read Pre-compiles
Create Invite Code
Managing Links/Codes
Claiming Rewards
Auto-Convert Rewards
Overview
Create/Delete subaccounts
Permissions
Roles
Audit Logs
Unified Trading Account
Spot Trading
Order Types
Tools
Privacy
Custom Layouts
Overview
Asset Wrapping
Vaults
Zipper Security
What Is TEE?
  1. Polyengine
  2. /
  3. Settlement

Settlement

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.

Settlements Are All or Nothing
If any part of an execution’s accounting cannot be applied, none of it is applied. There is no scenario where one side of a trade is settled while another is not.

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.

Partial Fill vs Full Fill Settlement
From the ledger’s perspective, partial fills and full fills are viewed the same way. Each is an entire execution by itself and is settled independently using the same atomic accounting logic. What is a partial fill for one user, may be the full fill for the counterparty.

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.
Previous

Matching Engine

Next

Safeguards

  • Role in the Trading Flow
  • Atomic Ledger Updates
  • Reservation Release and Balance Finalization
  • Settlement Outputs