Smart contracts
The Katana Perps smart contracts, deployed natively on the Katana blockchain, bring programmatic guarantees to the platform that eliminate the need to trust a centralized operator.
Historically, high-performance exchanges have required users to deposit funds directly with the exchange — effectively handing over custody. Katana Perps takes a fundamentally different approach: a series of smart contracts decentralize fund custody and trade settlement, ensuring that the platform's rules are enforced by code rather than trust.
Custody and Escrow
The off-chain trading engine executes trades in real time, then dispatches settlement transactions to the Katana blockchain. This creates a brief delay between when a user signs an order and when final settlement occurs on-chain. During this window, it is critical that neither party's funds move — otherwise the settlement transaction would fail.
The smart contract solves this by acting as a form of escrow. Once funds are deposited, the contract restricts their movement until all pending settlements have been processed. All trades and withdrawals are sequenced to ensure that on-chain balances update in the correct order.
A special smart contract function called wallet exit guarantees that funds can never be restricted indefinitely. If the off-chain system were to become unresponsive, users can invoke the wallet exit to reclaim their funds directly from the contract.
Enforcing System Rules
On a centralized exchange, users must trust the operator to correctly match and settle trades. More critically, they trust the exchange to maintain proper custody and process valid withdrawals. There is no mechanism to independently verify that the exchange is playing by its own rules.
Katana Perps eliminates this trust requirement. The smart contracts cryptographically enforce ownership and authorization for every action:
Trade authorization — Every trade must be signed by the account owner. The contract verifies these signatures on-chain, ensuring that no trade can execute without explicit user consent.
Withdrawal security — Withdrawals are validated by the contract and can only be sent to the originating account owner. There is no mechanism for the exchange or any third party to redirect funds.
This design means that even if the off-chain infrastructure were fully compromised, the smart contracts would prevent any unauthorized movement of funds.

