Earn 7.17% APY staking with Solana Compass + help grow Solana's ecosystem

Stake natively or with our LST compassSOL to earn a market leading APY

Scale or Die 2025: Adapting DEX Aggregation to Solana: Routing Under Constraints

By accelerate-25

Published on 2025-05-19

0x's Duncan Townsend explains the challenges and solutions for bringing DEX aggregation to Solana's unique blockchain environment.

The notes below are AI generated and may not be 100% accurate. Watch the video to be sure!

In a groundbreaking presentation at Scale or Die 2025, Duncan Townsend from 0x unveils the company's ambitious plans to bring their industry-leading DEX aggregation technology to the Solana blockchain. Despite significant technical challenges, 0x is poised to revolutionize trading on Solana, promising users unparalleled access to liquidity and the best possible swap prices.

Summary

Duncan Townsend, representing 0x, delivered a comprehensive overview of the challenges and solutions involved in adapting DEX aggregation to Solana's unique blockchain environment. The presentation highlighted the fundamental differences between Ethereum's EVM and Solana's SVM, particularly focusing on the constraints imposed by Solana's transaction size limits and account model.

Townsend explained that while DEX aggregation is crucial for obtaining the best swap prices by leveraging multiple exchanges, implementing this on Solana presents unique challenges. The limited number of accounts that can be accessed in a single transaction on Solana (due to the 1280-byte transaction size limit) makes it significantly more complex to create the multi-hop and multi-plex trades that are common in EVM-based DEX aggregation.

Despite these obstacles, 0x is actively working on solutions to bring their powerful aggregation algorithm to Solana. Townsend outlined several technical approaches, including the use of ALTs (Address Lookup Tables), program-owned token accounts, and multi-transaction atomicity through Jito bundles. He also hinted at upcoming features and called for collaboration with Solana-based DEXes to optimize the aggregation process.

Key Points:

Understanding DEX Aggregation

DEX aggregation is the process of intelligently combining multiple decentralized exchanges to provide users with the best possible price for their token swaps. This involves techniques such as multi-hop (using the output of one DEX as input for another) and multi-plex (splitting large orders across multiple DEXes) to optimize trade execution.

The complexity of DEX aggregation is exemplified by a real-world swap on Ethereum that involved 28 legs, demonstrating the intricate nature of finding the best price, especially for large trades. Townsend emphasized that while this level of complexity is achievable on Ethereum, implementing similar strategies on Solana presents unique challenges due to its different blockchain architecture.

Solana's Unique Challenges

The presentation highlighted the significant differences between Ethereum's EVM (Ethereum Virtual Machine) and Solana's SVM (Sealevel Virtual Machine). While Solana offers advantages such as mutable programs and the elimination of upgradeable proxies, it also introduces constraints that complicate DEX aggregation.

The most significant hurdle is Solana's transaction size limit of 1280 bytes, which restricts the number of accounts that can be accessed in a single transaction. This limitation makes it challenging to implement the complex, multi-leg trades that are common in DEX aggregation on EVM-based chains. Townsend explained that this constraint moves DEX aggregation on Solana into a different complexity class, making the optimal routing problem NP-hard.

Solutions and Adaptations

To overcome these challenges, 0x is exploring several technical solutions:

  1. Extensive use of ALTs (Address Lookup Tables) to maximize the number of accounts that can be referenced within Solana's transaction size limits.
  2. Leveraging program-owned token accounts, although this introduces potential issues with state contention and inclusion rates.
  3. Implementing multi-transaction atomicity through Jito bundles, with hopes for future in-protocol bundle support.
  4. Exploring meta-transactions, intents, and limit orders as alternative ways to structure complex trades.

Townsend emphasized the importance of these adaptations, noting that suboptimal routing can lead to increased MEV (Miner Extractable Value) and value loss for traders.

Facts + Figures

  • 0x is bringing its powerful DEX aggregation algorithm, which powers their API V2, to Solana in the near future.
  • A real-world example of a complex swap on Ethereum involved 28 legs for a $4.5 million notional RAP PTC to USDC trade.
  • Solana's transaction size limit is 1280 bytes, matching the IPv6 MTU.
  • Legacy Solana transactions can access approximately 32 accounts, while V0 transactions can theoretically access up to 256 accounts with optimal encoding.
  • Solana maintains a 64 account lock limit.
  • A typical DEX swap on Solana requires about 8 account locks.
  • 0x is currently integrating with 8 major DEXes on Solana, compared to 49 on one of their EVM chains.
  • The call depth limit on Solana's SVM is 4, compared to 1024 on Ethereum's EVM.
  • Suboptimal routing due to account limitations can generate MEV, resulting in value loss for traders.

Top quotes

  1. "DEX aggregation gets you the best price every time. Your users don't want to think about having to find the best price. We find the best price for you."
  2. "Doing DEX aggregation well is hard. Really hard. In fact, on Solana, on SVM, the transaction account limit moves DEX aggregation into a completely different complexity class."
  3. "SVM is not EVM. I hope you agree with me on that one."
  4. "The real issue is the transaction size limit. Solana transactions are fully encoded in a UDP packet. 1280 bytes, just the IPv6 MTU."
  5. "If you're having problems with call depth, you're having a skill issue. Program harder, please."

Questions Answered

What is DEX aggregation and why is it important?

DEX aggregation is the process of combining multiple decentralized exchanges to find the best price for token swaps. It's important because it ensures users get the most favorable rates by leveraging liquidity across various platforms. DEX aggregation uses techniques like multi-hop (chaining trades across exchanges) and multi-plex (splitting large orders) to optimize trade execution, potentially saving users significant amounts on their transactions.

How does Solana's architecture differ from Ethereum's when it comes to DEX aggregation?

Solana's architecture, specifically its Sealevel Virtual Machine (SVM), differs significantly from Ethereum's EVM. The most critical difference is Solana's transaction size limit of 1280 bytes, which restricts the number of accounts that can be accessed in a single transaction. This limitation makes it challenging to implement complex, multi-leg trades that are common in DEX aggregation on Ethereum. Additionally, Solana has a lower call depth limit of 4 compared to Ethereum's 1024, though this is less of an issue due to Solana's different program design patterns.

What solutions is 0x implementing to overcome Solana's constraints for DEX aggregation?

0x is implementing several solutions to overcome Solana's constraints for DEX aggregation. These include extensive use of Address Lookup Tables (ALTs) to maximize the number of accounts that can be referenced within transaction limits, leveraging program-owned token accounts, implementing multi-transaction atomicity through Jito bundles, and exploring meta-transactions, intents, and limit orders. These techniques allow 0x to work around Solana's account limitations and still provide efficient DEX aggregation services.

How many DEXes is 0x integrating with on Solana, and how does this compare to other chains?

0x is currently integrating with 8 major DEXes on Solana. This number is significantly lower compared to their integration on EVM chains, where they have up to 49 DEXes integrated on a single chain. The lower number on Solana is partly due to the blockchain's unique constraints and the relative newness of 0x's Solana integration efforts.

What is the potential impact of suboptimal routing in DEX aggregation on Solana?

Suboptimal routing in DEX aggregation on Solana can lead to increased Miner Extractable Value (MEV) and value loss for traders. Because of Solana's account limitations, it may not be possible to touch the entire market in a single transaction, leading to partial market movements. This can create opportunities for MEV extraction and result in less favorable prices for users. Optimal routing aims to move all DEXes equally, minimizing market impact and protecting user value.

How does 0x plan to compete in the Solana ecosystem?

0x plans to compete in the Solana ecosystem by leveraging its expertise in DEX aggregation from other blockchains and adapting its powerful algorithms to Solana's unique environment. They are actively working on solutions to overcome Solana's constraints and are calling for collaboration with Solana-based DEXes to optimize the aggregation process. By providing the best possible swap prices and simplifying the trading experience for users and integrators, 0x aims to become a leading player in Solana's DeFi landscape.

What advice does 0x have for DEX developers on Solana?

0x advises DEX developers on Solana to focus on reducing the number of account locks required for swaps, as this can provide a competitive advantage in the context of DEX aggregation. They encourage DEX projects to reach out and collaborate, especially if they weren't mentioned in the presentation, as 0x is keen to integrate more DEXes and increase liquidity options for users.

How does the complexity of DEX aggregation on Solana compare to Ethereum?

DEX aggregation on Solana is significantly more complex than on Ethereum due to the transaction size and account limitations. While on Ethereum, the optimal routing problem can be solved in polynomial time, the same problem on Solana becomes NP-hard due to the account constraints. This increased complexity requires more sophisticated algorithms and workarounds to achieve efficient DEX aggregation on Solana.


Related Content

Scale or Die 2025: No-strings-attached programs w/ Pinocchio

Fernando Otero introduces Pinocchio, a new dependency-free SDK for writing efficient Solana programs

Scale or Die at Accelerate 2025: Solver Infrastructure

RockawayX Labs' Krystof Kosina discusses the challenges and solutions in developing cross-chain solvers on Solana

Scale or Die 2025: Solving The Pains of Indexing On Solana

The Graph's Substreams solution addresses major challenges in indexing Solana blockchain data, offering improved performance and developer experience.

Ship or Die at Accelerate 2025: Time Is Money (Kawz - Time.fun)

Kawz introduces Time.fun, a platform that tokenizes time and creates new capital markets on Solana

Ship or Die at Accelerate 2025: Building User-Centric Products

Simon Amor of Sling Money shares invaluable insights on creating user-centric products in the blockchain space

Ship or Die 2025: Solana Attestation Service

Solana Attestation Service launches on mainnet, revolutionizing KYC and data management on the blockchain

Ship or Die 2025: Enterprise Adoption of Stablecoins

Exploring the future of stablecoins and their impact on global financial systems

Ship or Die 2025: Public Markets for Public Blockchains

Parker White discusses the rapid rise of DeFi Development Corporation and its innovative approach to Solana investment

Ship or Die 2025: Solana Attestation Service

Solana Attestation Service launches on mainnet, enabling seamless KYC and data verification for on-chain applications

Breakpoint 2024: Product Keynote: In the Blink of an Eye

Chris Osborn introduces Blinks, a revolutionary technology changing how we interact with the internet

Ship or Die at Accelerate 2025: Lightning Talk: Vana

Anna Kazlauskas discusses data as an asset class and its role in AI, introducing Vana's innovative approach to data ownership and monetization.

Ship or Die 2025: Institutional DeFi

Industry leaders discuss the future of institutional DeFi on Solana, addressing market depth, compliance, and new primitives.

Ship or Die at Accelerate 2025: Bringing International Trade Onchain

Arnold Lee of Sphere discusses revolutionizing cross-border payments and international trade using blockchain technology

Scale or Die 2025: Solving The Pains of Indexing On Solana

The Graph's Substreams solution addresses major challenges in indexing Solana blockchain data, offering significant performance improvements and developer-friendly features.

Scale or Die at Accelerate 2025: Writing Optimized Solana Programs

Dean Little from Blueshift delivers an in-depth exploration of Solana program optimization techniques at Accelerate 2025.