Search projects, hackathons, sponsors and tech

    ← All projects

    Orbital Swap

    Multi-token concentrated liquidity on Aqua, with atomic USDC payments on Arc.

    Demo

    About

    Orbital is a multi-asset stablecoin exchange and payments application built on Arc Testnet. It combines concentrated liquidity, 1inch Aqua, custom SwapVM instructions, and Privy wallet onboarding into one experience: providers create wallet-backed liquidity strategies, traders swap against them, and merchants receive USDC through direct or swap-funded payments. The project adapts the Orbital automated market maker research into an executable Aqua application. Its mathematical model represents liquidity across multiple assets using spherical geometry and concentration boundaries. A single strategy can support trading between multiple token pairs, with liquidity concentrated around the price relationships the provider chooses. The implementation handles movement between concentration regions, token decimal differences, conservative output rounding, and separate accounting for liquidity principal and earned fees. For liquidity providers, the workflow starts with selecting two or three supported assets, allocating amounts, and choosing a Wide, Balanced, or Focused concentration profile and trading fee. Providers then review and sign the approval, Aqua allocation, and strategy activation steps. Tokens remain in the provider’s wallet until used in settlement. Available liquidity reflects the strategy’s allocation, wallet balances, and allowances, so quotes account for whether the strategy is actually backed. Providers can inspect their strategies and manage their lifecycle through the application. For traders, Orbital offers live quotes, slippage settings, approval reviews, gas estimates, and transaction receipts. The application discovers available strategies and checks their current onchain state before preparing execution. Custom SwapVM instructions apply the provider’s fee and execute the Orbital curve, while Aqua supplies the allocation and token-transfer mechanism. Each transaction remains explicitly reviewed and signed by the user. Payments extend that same liquidity into a practical merchant workflow. A merchant creates a USDC invoice with an amount, expiry, and optional recipient splits, then shares its payment page. The payer can settle directly in USDC or select another supported token. For swap-funded payments, Orbital calculates the required input and combines conversion with invoice settlement in one atomic transaction. Recipients receive the requested USDC, excess output is refunded to the payer, and a failed settlement reverts the operation. Privy provides existing-wallet connection and the configured email and embedded-wallet onboarding flow. Both wallet types use shared transaction controllers for approvals, swaps, liquidity management, and payments. The frontend keeps financial reviews explicit while placing advanced protocol details behind optional disclosures. Underneath the interface, a shared TypeScript SDK validates configurations and constructs transaction plans. An API and event indexer provide strategy discovery, invoice history, quotes, and receipt-backed observations. The repository also includes an independent high-precision mathematical reference, contract tests, paper-to-code documentation, and retained execution evidence. The current demonstration uses Arc Testnet USDC and two clearly identified demo tokens, including assets with different decimal precision. Its Arc deployment uses a project-deployed copy of the pinned upstream AquaRouter alongside the custom SwapVM implementation. Strategy publication, swaps, and swap-funded invoices have recorded onchain receipts. Orbital remains an experimental testnet implementation, with broader mathematical and security release validation tracked separately.

    How it's made

    We built Orbital as a pnpm monorepo connecting a Solidity execution engine, an independent Python mathematical reference, a shared TypeScript SDK, and a full-stack web application. The main engineering challenge was translating a multi-asset concentrated-liquidity mechanism into wallet-backed Aqua strategies while keeping quoting, execution, accounting, and the user interface consistent. The contracts use Solidity 0.8.30 and Foundry, with a pinned, minimal fork of 1inch SwapVM. We implemented two custom instructions: 0x72 applies the maker’s fee, and 0x52 executes the Orbital curve. The curve engine handles interior liquidity, concentration boundaries, and inward and outward tick crossings. It uses fixed-point arithmetic, wide integer operations, directed bounds, and conservative token-unit rounding. Principal and earned fees are tracked separately so fee accumulation does not silently change the geometric reserves. One particularly interesting modification was extending SwapVM’s token selection. The pinned upstream implementation binds an order to two tokens, while Orbital needs multiple trading pairs to share one strategy and one evolving reserve state. We extracted a token-resolution hook used by both quoting and swapping, then implemented an Orbital resolver that validates input/output indices against the strategy’s immutable token list. This allows the three-token demonstration to support all six directed trading pairs within a shared strategy. Aqua provides the wallet-held liquidity and settlement layer. Makers publish allocations using Aqua’s lifecycle, with the strategy keyed to the encoded SwapVM order. Tokens remain in the maker’s wallet, and execution uses Aqua’s push/pull mechanics to settle trades. Orbital checks the allocation, current balances, allowances, and actual transfer deltas. This made wallet-backed liquidity a core protocol behavior. On Arc Testnet, we deployed a copy of the pinned upstream AquaRouter alongside our custom router; that deployment is documented separately from canonical 1inch deployments. For the mathematics, we built a Python reference using mpmath and exact arithmetic. It explicitly evaluates individual ticks and produces high-precision fixtures for comparison with Solidity. The reference and production engine use different computational approaches, helping expose mistakes that two copies of the same solver could share. We retained counterexamples, rounding regressions, and paper-to-code notes as the implementation evolved. Another practical challenge was contract size: initialization, numerical, storage, and settlement functionality had to be organized into linked libraries to fit EVM deployment limits. Arc supplies the USDC settlement environment. Its use of USDC for both payments and gas introduced an important accounting detail: the ERC-20 interface uses six decimals, while native gas accounting uses eighteen. Our SDK handles these representations separately and reserves gas when calculating spendable amounts. The payment adapter combines a supported swap with USDC invoice settlement, optional recipient splits, and excess-output refunds. If a required payout fails, the transaction reverts atomically. The frontend uses Next.js, React, TypeScript, CSS Modules, and Radix UI. Privy supplies wallet connection and configured email/embedded-wallet onboarding, while wagmi and viem handle the shared wallet actions and chain interactions. Financial logic lives in the SDK and feature controllers; presentation components receive typed state and callbacks. That separation let us redesign the interface without rewriting calldata construction or payment accounting. Approvals and execution have separate reviews, and submitted transaction hashes are retained for receipt recovery after interruptions. The backend uses Fastify, PostgreSQL, and Drizzle, with a dedicated event indexer. It reconstructs strategy and invoice history, tracks chain reorganizations, and serves quotes and receipt-backed observations. A notable integration fix was batching authenticated block and event ingestion so the indexer could keep up with Arc. We also introduced a bounded, same-origin read-only RPC route after browser extensions blocked direct RPC requests; signing still goes through the selected wallet. The frontend is deployed through Vercel, with Railway hosting the API, indexer, and PostgreSQL. Local development uses Docker Compose and Anvil. The repository retains contract, reference, browser, and onchain execution evidence, while broader mathematical and security release obligations remain explicitly tracked.