Trade Settlement
Zenko’s trade settlement architecture is designed to enforce non-custodial execution, deterministic trade finality, and cryptographic integrity across all matched orders. While orders are matched off-chain for performance, the actual transfer of assets is handled entirely on-chain through audited smart contracts that enforce atomic, user-authorized settlement.
This hybrid model enables high-speed matching without sacrificing asset control, ensuring that no trade can execute without explicit user-side cryptographic approval.
Settlement Workflow
Off-Chain Order Matching: Users submit signed order intents off-chain (e.g. via WebSocket or REST API). These orders are collected in the Zenko matching engine and paired based on price-time priority, resulting in a provisional match.
On-Chain Validation and Execution: Once a match is identified, both orders are bundled into a settlement transaction. This transaction includes:
Signed payloads from both maker and taker (EIP-712 compliant)
Order hashes and asset amounts
Trade parameters (price, quantity, fees, time constraints)
Nonce and replay protection mechanisms
The settlement smart contract verifies both signatures and trade consistency before proceeding.
Atomic Asset Transfer: Upon successful verification, the smart contract executes an atomic transfer of tokens between the involved parties (or their vault contracts). The entire transaction either completes in full or reverts — guaranteeing no partial fills or incomplete transfers.
Fee Routing and Protocol Accounting: Trading fees are extracted during settlement and programmatically routed:
To the protocol treasury
To buyback-and-burn contracts
To referral or rebate addresses (if applicable) This ensures that protocol economics are enforced on-chain and verifiable by third parties.
Settlement Features
Atomicity: Trades cannot be partially executed. If one leg fails (e.g., invalid signature, insufficient balance), the entire transaction is reverted.
Self-Custody Enforcement: Only users can authorize the use of their funds. The exchange cannot unilaterally move assets under any condition.
Gas Efficiency: Trades are batched and optimized for minimal gas consumption, with optional Layer 2 support planned for high-frequency environments.
Replay Protection: Every order includes nonces and expiry windows to prevent order reuse or delay-based attacks.
Settlement Finality: Once executed on-chain, trades are immutable and verifiable in the transaction ledger, including all fee splits and vault movements.
Layer 2 and Rollup Integration (Planned)
To support high-throughput use cases and micro-trades, Zenko’s settlement engine is designed for compatibility with future Layer 2 systems such as:
ZK-Rollups
Optimistic Rollups
App-specific Validium chains
These integrations will enable scalable trade settlement without compromising custody or security.
Last updated

