AWS Web3 Blog
How Derive scaled their low-latency, decentralized trading platform using AWS Graviton, Amazon EKS, and Amazon Aurora
This is a guest post by Joshua Kim, Head of Engineering at Derive, and Dillon Lin, Head of Growth at Derive, in partnership with AWS.
The derivatives market is poised for significant growth in the next decade, driven by increasing institutional participation, technological innovation, and a shift towards on-chain adoption, tokenization, and decentralized finance (DeFi). As global markets face uncertainty, derivatives are becoming essential tools for managing risk and capitalizing on opportunities. This convergence of traditional financial instruments with blockchain technology is set to redefine the derivatives landscape, providing new avenues for growth and innovation in the industry.
In this post, we share how Derive successfully scaled their hybrid decentralized trading platform to achieve billions of dollars in trading volume and low-latency execution by using a robust compute and database infrastructure, using AWS Graviton on Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon Aurora. We explore Derive’s hybrid exchange model and how AWS played a crucial role in their growth and scalability.
Overview: Derive’s unique hybrid exchange model
Derive is a DeFi protocol that creates unique and programmable on-chain derivatives, from options, perpetuals, and other structured products. It operates a hybrid model, combining the efficiency of centralized order matching with the security and transparency of decentralized settlements and margin on its Derive chain, built with the OP Stack, an open source Ethereum Layer 2 blockchain. This approach allows Derive to offer a seamless trading experience similar to centralized exchanges while maintaining user control over assets. This is facilitated by an open auction-based margin system, creating transparency and mitigating risks associated with a traditional centralized system where reserve assets are managed by a central party.
Although Derive provides standard exchange products such as perpetuals and spot trading, its core focus is on serving sophisticated traders and institutions. Its solution delivers on-chain liquidity for decentralized options, both through its order book and through a robust Request-for-Quote (RFQ) system, enabling advanced trading strategies and optimal price discovery in decentralized markets.
With rapid growth in their user base and trading volume, Derive needs to make sure their infrastructure can handle growing demand without compromising performance, even with a lean engineering team and during periods of market volatility.
Solution overview
The following diagram illustrates the architecture for Derive’s high performance, low-latency platform.
The high-level architecture is composed of several key components, which we discuss in the following sections.
High-performance compute
Derive’s architecture includes a highly efficient, high-performance compute running on Graviton nodes with a microservices architecture in Amazon EKS. This provides low latency and scalability, enabling rapid execution of trades. Microservices are modular and horizontally scalable, allowing the solution to handle high volumes efficiently, with specialized services for core functions:
- Core matching engine – Built on Rust for low-latency, the core matching engine processes orders, matches trades, and manages state transitions
- Risk management – Dedicated microservices handle standard and portfolio risk calculations, providing compliance and protecting both the platform and its users
- Emitters – Services such as the Orderbook Emitter and Ticker Emitter broadcast state changes and price updates to external systems and users
- Additional microservices – The architecture is extensible, supporting the addition of new microservices as needed for future growth
Database
Microservices transact data on PostgreSQL on Aurora, benefiting from its scalability and reliability.
“During our launch, we had more than 50,000 users in a single day, making over 50 million API requests while trading,” says Josh Kim, Head of Engineering at Derive. “Amazon Aurora was instrumental in helping us quickly scale our database to service significant volume of read requests.”
Aggregation and blockchain settlement
Derive’s hybrid exchange model requires a component that manages the aggregation rollup and settlement of trades, interfacing with its microservices to finalize transactions. For settlements, Derive built a Layer 2 blockchain as a scaling solution for the Ethereum blockchain, based on the open-source, OP Stack. This provides high throughput, low cost, and inherits Ethereum security, balancing speed and security.
“Hybrid exchanges add a new layer of complexity to low-latency trading by requiring self-custody through cryptographic order signatures and real-time on-chain risk validation—even while matching occurs off-chain,” says Kim. “A great example is a high-frequency trader getting liquidated on-chain while posting thousands of orders to the Derive exchange. The matching engine needs fast access to on-chain protocol state and ability to parallelize certain workloads.”
Event-driven architecture
User requests are facilitated through both WebSocket and REST API endpoints, providing secure and efficient handling of orders and market data. A Valkey-based queue system orchestrates the sequencing and processing of incoming orders, and a configurable rate limiter enforces fair usage policies and safeguards the exchange against abuse or overload. To deliver real-time market data and order updates with minimal latency, a Valkey-based publish/subscribe mechanism efficiently broadcasts these events to all connected clients. The scalability of the architecture also includes event streaming, which tracks and captures state changes for communication to downstream microservices. This event-driven approach uses NATS, deployed on Amazon EKS, providing scalability and reliability across the platform.
“Beyond building a performant Rust-based engine, we built several other internal components that required domain-specific technical knowledge—one of them being a custom message queueing system that routes orders with a very tight latency range,” says Kim. “The team at AWS gave us amazing support through many in-person technical brainstorms with AWS resident experts. This really improved our execution speed. Shortly after launch, the exchange handled $3.7B in volumes and settled almost 1 million trades on-chain in one month.”
Security
In addition to the inherent security of a decentralized settlement layer, Derive uses AWS security services such as AWS Control Tower for centralized cloud governance, AWS IAM Identity Center for streamlined identity management, AWS Key Management Service (AWS KMS) for secure encryption, and Amazon GuardDuty for intelligent threat detection. These measures enable Derive to align with stringent security requirements and high standards expected by institutional investors.
Collaboration with AWS
Derive collaborated with AWS since the inception of its journey, participating in the AWS Activate program for startups. They were able to access AWS credits after securing investment from leading venture capital firms, Coinbase Ventures and Framework Ventures, who are AWS Activate Providers.
“The team at AWS Startups has been instrumental in our journey, providing us with the funding, tools, and expertise to innovate in the DeFi space,” says Dominic Romanowski, Co- Founder at Derive. “By harnessing the power of AWS infrastructure, we’ve not only optimized our costs but also ensured that our platform can scale seamlessly to meet growing demand, while remaining secure. This has enabled us to focus on what matters most: building a high- performing trading platform for our institutional and retail customers. As we continue to pioneer new frontiers in decentralized finance, AWS’s scalable and reliable infrastructure will be fundamental for our success.”
To address their unique technical challenges and accelerate development, Derive used specialist experts across subject matter areas, including compute, databases, and Web3.
“It’s incredibly reassuring to know we can hop on a call and get deep, expert opinions whenever we need them,” says Romanowski.
Next steps
Looking ahead, Derive is committed to continuously enhancing its capacity and reducing latency. In addition to ongoing improvements, Derive is excited about several key initiatives in its roadmap. First, a comprehensive replay and audit capability that will empower users to precisely replay orders and trades. This capability is designed to meet the needs of institutional clients who require granular historical data to debug algorithms and maintain fair execution on the exchange. Second, a deeper integration with the Ethereum Virtual Machine (EVM), positioning it as a natural extension of an EVM node. This blockchain-based approach is expected to deliver several advantages, including reducing discrepancies between exchange balances and on-chain state; simplifying and streamlining the infrastructure for market, account, and trade data; and in the future, empowering users to seamlessly integrate Derive exchange components with other protocols.
“We believe these developments will position our exchange as a leader in blockchain-native trading and pave the way for broader innovation in the industry,” says Dillon Lin, Head of Growth at Derive.
Conclusion
By using AWS services, Derive is able to focus on innovation and expand their offerings in tokenization and decentralized derivatives. This alignment empowers Derive to successfully scale their solution, providing a secure and efficient trading environment that meets the evolving needs of financial institutions.
“As we continue to innovate in the DeFi space and meet the growing demand for on-chain derivatives, our collaboration with AWS remains crucial,” says Lin. “Their support has been instrumental in our journey, enabling us to scale efficiently and deliver solutions that cater to the evolving needs of institutional investors. We look forward to working with AWS to continue scaling our platform.”
To learn more about decentralized derivatives and how AWS and Derive can support your DeFi initiatives, explore the following resources:
- Learn about decentralized derivatives at Derive and its Developer Hub
- Learn more about Web3 on AWS
- Learn more about AWS Startups on startups.aws