Production systems for finance, cryptography, and critical operations.
All posts

Building Production Applications with Arbitrum Stylus (Part 1): DEX Aggregator

How we used Rust and Arbitrum Stylus to build and validate a production-ready DEX Aggregator running on Arbitrum Mainnet.

Arbitrum Stylus production milestone

Infrastructure only proves its value when it runs in production. We built Bananita Swap, a Stylus-powered DEX Aggregator on Arbitrum Mainnet, to answer whether Rust smart contracts can handle real DeFi workloads under production constraints.

Every year, new blockchain infrastructure promises to make building decentralized applications easier. New virtual machines. New programming languages. New execution environments.

Arbitrum Stylus is one of the most significant additions to the Arbitrum ecosystem. By enabling high-performance smart contracts written in Rust, it expands the types of applications that can be built onchain while giving engineering teams access to Rust's mature ecosystem and tooling.

But new technology should not be evaluated by benchmarks alone. The real questions are:

  • Can it support production workloads?

  • How does it behave when interacting with real protocols?

  • What architectural patterns emerge once you move beyond demos?

Those are the questions we set out to answer.

As part of the Arbitrum ecosystem, we are building a series of open-source production applications designed to validate Stylus through real-world implementations. Each milestone explores a different application pattern and documents the engineering decisions behind it. We announced this initiative earlier this year; this post covers the first delivery.

This first milestone focuses on one of the most demanding application types in DeFi: DEX Aggregator.

2Liquidity sources integrated: Camelot and Uniswap
1Production deployment on Arbitrum Mainnet
100%Open source: contracts, routing engine, and reference implementation

Project Resources

Arbitrum-Miniapp1-BananitaSwap

Open-source Stylus contracts, routing engine, and Mini App integration for Bananita Swap. The reference implementation behind this milestone.

  • Rust
  • Arbitrum Stylus
  • DEX Aggregator
  • Open source
View source code

Live demo

Walkthrough of Bananita Swap running as an embedded Mini App with real liquidity on Arbitrum Mainnet.

  • Mini App
  • Lemon Cash
  • Mainnet
Watch demo

Project Snapshot

FieldDetail
NetworkArbitrum One
Smart contractsRust
RuntimeArbitrum Stylus
CategoryDEX Aggregator
Liquidity sourcesCamelot + Uniswap
DeploymentArbitrum Mainnet
InterfaceEmbedded Mini App
StatusProduction
LicenseOpen source

Why DEX Aggregator?

Swap aggregation is an excellent stress test for any smart contract framework.

A production-ready DEX Aggregator needs to coordinate multiple liquidity sources, normalize different protocol interfaces, execute complex routing logic, manage slippage, handle token approvals, and provide a reliable user experience throughout the entire transaction lifecycle.

These are not theoretical challenges. They are exactly the kinds of problems production applications solve every day.

If Stylus performs well under these conditions, it becomes a compelling foundation for more sophisticated onchain systems.

The Reference Implementation

To explore that question, we built Bananita Swap.

Bananita Swap is a production-ready DEX Aggregator embedded directly inside Lemon Cash as a Mini App, giving users access to decentralized liquidity without leaving the application.

From an engineering perspective, however, the Mini App is simply the interface. The real objective was validating a Stylus-based architecture capable of orchestrating swaps across Camelot and Uniswap while operating under production conditions.

Rather than building another proof of concept, we wanted to understand how Stylus behaves when real users interact with real liquidity on Arbitrum Mainnet.

Technical Architecture

The system is composed of four primary layers:

Embedded frontend

Optimized for the Lemon Cash Mini App environment, with UX patterns that fit naturally inside a host application.

Stylus smart contracts

Written entirely in Rust using Arbitrum Stylus, compiled to WASM for native execution on Arbitrum.

Routing engine

Responsible for quote selection and execution across multiple liquidity sources.

Protocol integrations

Direct integrations with Uniswap and Camelot, each with distinct routing models and interfaces.

One of the project's key engineering decisions was avoiding Solidity wrappers. Instead, the routing engine itself executes natively in Stylus, allowing the application logic to fully leverage Rust and compile directly to WASM for execution on Arbitrum.

That distinction was important because our goal was not simply to integrate Stylus. It was to evaluate it as the primary execution environment for production smart contracts.

Engineering Challenges

Multi-protocol routing

Although Uniswap and Camelot provide similar functionality, their routing models differ significantly. Designing a unified abstraction capable of selecting optimal execution paths while maintaining predictable behavior required several architectural iterations.

Embedded application constraints

Running inside another application introduces constraints traditional dApps rarely face. Wallet state, approval flows, transaction recovery, loading behavior, and user feedback all need to integrate naturally with the host application.

In practice, production readiness depends just as much on transaction orchestration as it does on smart contract correctness.

Building with Stylus

Perhaps the biggest shift came from developing smart contracts in Rust.

Stylus enables engineers to build high-performance smart contracts in Rust while deploying natively on Arbitrum. Beyond improving the developer experience, it opens the door to more computationally intensive applications, making it an attractive option for complex routing, advanced business logic, and other performance-sensitive workloads.

That leads to a development experience much closer to modern backend engineering than traditional Solidity development, particularly when implementing complex business logic.

What We Learned

Deploying the application on Arbitrum Mainnet provided valuable insights into Stylus as a production platform.

Based on this implementation, we found Stylus to be a strong foundation for building production-grade DeFi applications involving complex protocol interactions. Rust significantly improves the maintainability of sophisticated smart contract logic, while Stylus enables engineers to structure applications using modern software engineering patterns without sacrificing native blockchain execution.

Equally important, we found that production applications demand careful attention beyond the contracts themselves. Embedded user experiences, transaction orchestration, and protocol abstraction all play a critical role in delivering reliable blockchain products.

Why We're Publishing Everything

One of the biggest challenges with emerging blockchain technologies is the lack of production-grade reference implementations.

Documentation explains APIs. Tutorials demonstrate syntax. Production software reveals engineering patterns.

That is why every milestone in this initiative is fully open source. Our goal is not simply to showcase completed projects. It is to contribute practical reference implementations that developers can study, extend, and build upon as the Stylus ecosystem continues to mature.

What's Next

The DEX Aggregator is only the first milestone in this series. The next implementations will explore additional application patterns, expanding the set of production-ready Stylus references available to the Arbitrum ecosystem.

Each project answers a different engineering question. Together, they help build a clearer picture of what production software on Stylus actually looks like.

About WakeUp Labs

At WakeUp Labs, we build production-grade blockchain infrastructure and digital products for leading ecosystems, startups, and enterprises.

Our engineering philosophy is simple: new infrastructure only proves its value when it runs in production. Rather than evaluating emerging technologies through isolated prototypes, we validate them by building real systems that interact with real users, real liquidity, and real operational constraints.

Whether we are working with Arbitrum Stylus, OP Stack, zero-knowledge technologies, tokenization, or Ethereum infrastructure, our objective remains the same: transform promising technology into production-ready software while sharing practical engineering knowledge with the broader ecosystem.

If you are building on Arbitrum or exploring Stylus for production systems, we would love to connect.

Next step

Turn this into a scoped direction

Talk with us about the system you need. We will scope delivery, operating ownership, and the next step after go-live.