Spot Swap Module (AmaraSwap)

AmaraSwap is the spot trading layer of the protocol. It is a fork of PancakeSwap V2, adapted for the Odyssey chain and modified to integrate WDIONE and the Amara token. The swap module enables instant token-to-token swaps, liquidity provisioning, and LP token issuance, forming the foundation for non-leveraged trading within Amara.

Factory Contract The Factory is the registry for all spot trading pairs. When a new pool is created, it is deployed through the Factory, which records its existence and makes it discoverable.

  • Each pool is represented by a Pair contract.

  • The Factory manages fee parameters and acts as the source of truth for all available markets.

  • By querying the Factory, the frontend can display active pools, track reserves, and calculate on-chain analytics such as TVL and APR.

Router Contract The Router is the user-facing contract that interacts with pairs on behalf of traders. Instead of calling pairs directly, users submit transactions through the Router, which handles the logic of choosing paths, checking reserves, and routing tokens.

  • Swaps: Functions like swapExactTokensForTokens execute trades by moving assets through a path of pools, often routed through WDIONE for liquidity efficiency.

  • Add Liquidity: Users deposit two tokens into a pair. The Router calculates optimal deposit ratios and returns LP tokens to represent the user’s share of the pool.

  • Remove Liquidity: Users burn LP tokens to withdraw their proportional share of the underlying tokens.

By standardizing these interactions, the Router ensures that swaps and liquidity operations remain simple for users while preserving the efficiency of the underlying AMM.

Pair Contracts Each Pair contract holds reserves for a token pair and manages the automated market making (AMM) process.

  • Reserves update with every trade, using the constant product formula (x * y = k) to determine pricing.

  • LP tokens are minted when liquidity is added and burned when liquidity is removed.

  • Swap fees are collected at the pool level, with a portion routed to protocol fee addresses and the rest distributed to liquidity providers.

Pair contracts are fully composable. Other dApps on Odyssey can integrate them directly, enabling AmaraSwap liquidity to serve as infrastructure across the ecosystem.

Token Standards and Adjustments To adapt PancakeSwap for Odyssey, several modifications were made:

  • WDIONE replaces WBNB as the wrapped native asset, ensuring compatibility between DIONE and ERC20-based contracts.

  • Amara Token replaces CAKE as the governance and incentive token, used for fee distribution and staking rewards.

  • All contract configurations have been updated for Odyssey’s chain ID (153153 for mainnet, 131313 for testnet) and RPC endpoints.

Liquidity Provisioning and Pools Liquidity providers play a central role in AmaraSwap. By adding token pairs to pools, they enable trading and earn fees on every swap. Pools can be created for any two ERC20-compatible tokens, including synthetic carbon credits once introduced.

  • Initial pools are expected to include Amara/WDIONE and WDIONE/USDC.

  • Over time, pools will expand to support synthetic green assets, creating the foundation for tokenized sustainability markets.

  • Pool data is displayed on the frontend by querying the Factory, giving users real-time insights into depth, volume, and yield.

Fee Structure AmaraSwap applies swap fees at the pool level, following the standard PancakeSwap model.

  • A portion of fees accrues to liquidity providers as their incentive.

  • A configurable share can be routed to a protocol-controlled address (feeTo) for treasury or governance purposes.

  • Fee parameters are flexible and can be adjusted to align with market needs or governance decisions.

Integration with Amara Perpetual Module Although the spot and perp modules operate independently, they are unified under a single frontend and ecosystem. This allows traders to move between a simple swap and a leveraged position without leaving the protocol. Liquidity providers can choose their preferred model — vault-based exposure on perps or pool-based exposure on spot — while benefiting from a consistent user experience.

Last updated