# Technical Architecture

### Overview of Extended Architecture

Extended is a perpetuals DEX built on Starknet, a general-purpose decentralised zk-chain. All user funds are fully self-custodied in on-chain smart contracts, with no custodial access by Extended.

The protocol is designed to minimise reliance on trust by enforcing trading logic, transaction validation, and key components of the risk engine directly on-chain. All transactions are validated and settled on Starknet, ensuring transparent and verifiable state transitions. Extended’s smart contracts are open source and publicly accessible: [link](https://voyager.online/class/0x055ca2019a8677a996e7b583c5c9d0147d2854d0c477716af685e926ee4a5463), with independent security audits available here: [link](https://docs.extended.exchange/extended-resources/more/smart-contract-audits). Extended is among the few perpetual DEXs with fully verifiable on-chain infrastructure.

At the protocol level, every transaction involving collateral movement, including trades, funding payments, transfers, liquidations, and ADLs, triggers a full on-chain health check. This ensures that all participating accounts remain solvent or become more solvent as a result of the transaction, with system solvency continuously enforced on-chain.

Extended also applies a comprehensive set of on-chain fairness checks across all transaction types:

* Trades must respect user-defined price constraints and cannot be executed at a price worse than the specified limit
* Funding payments are subject to on-chain limits on maximum funding rates per period
* Liquidations are permitted only when a user’s Total Value, or equity, falls below their Total Risk, or maintenance margin, based on external oracle prices
* Liquidations are triggered using independent external oracle mark prices, ensuring impartiality in the liquidation process
* Each liquidation must improve the user’s Total Value to Total Risk ratio, otherwise the transaction is rejected
* Accounts remain protected from ADL as long as their Total Value remains above zero

All state transitions are verified through zero-knowledge proofs, ensuring the integrity and correctness of the system.

Extended is progressing toward full decentralisation of sequencing through a purpose-built, application-specific chain based on a custom high-throughput implementation of full BFT consensus. This architecture introduces an app-chain layered on top of the existing zk-enabled stack to handle matching and related services in a decentralised manner, while preserving Starknet’s security guarantees. Further details on this architecture will be shared in due course.

### Performance and Execution Quality

Extended delivers competitive performance, with end-to-end latency and throughput comparable to leading trading venues, enabling reliable execution even under high market activity.

<figure><img src="https://3693216602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FThTVaNuyiBCaumOB7kqP%2Fuploads%2FwF27Z9dK5x2T1eIZqeHW%2FLatency%20-%20Detailed%201228x690.png?alt=media&#x26;token=328aed21-2ffa-4873-b061-51ca87644759" alt=""><figcaption><p>Latency benchmarks</p></figcaption></figure>

### **Rationale for Settling on Starknet**

The selection of Starknet as the settlement layer is based on three key considerations:

**Security**

Starknet relies on validity proofs to guarantee correct state transitions. It is among the most advanced and decentralised zk-rollup stacks, meeting key decentralisation and security requirements as a [Stage 1 rollup](https://x.com/VitalikButerin/status/1923988377474330775?s=20).

**Performance**

With approximately [2-second](https://www.starknet.io/blog/bolt-version-upgrade/) transaction confirmation times and an average cost per user operation as low as [$0.000057](https://www.starknet.io/blog/march-2025-roundup/), Starknet enables high throughput and low-latency execution. This is critical for supporting high-frequency trading, continuous risk checks, and complex state updates at scale.

**Longevity**

StarkWare, the team behind Starknet and the inventors of STARKs, has been building zero-knowledge infrastructure for over seven years. Through multiple market cycles, they have demonstrated technical resilience and long-term commitment.
