🏗️Architecture & Design
Amara is designed as a hybrid decentralized exchange that combines the perpetual trading model pioneered by GMX with the spot swap mechanics of PancakeSwap. The result is a unified system that provides users with both leverage trading and instant token swaps in a single protocol.
The architecture is built around several key layers that work together:
Frontend Layer – The web application through which users interact with the protocol. It connects directly to Odyssey Chain RPCs, integrates wallet providers like MetaMask and WalletConnect, and exposes the trading interface for both spot and perpetual markets.
Backend Services – Indexers, event processors, and subgraphs that capture on-chain activity and make it queryable. These services provide real-time data for charts, trading analytics, market health indicators, and portfolio dashboards.
Smart Contract Layer – The core of the protocol. On the perpetual side, vaults, routers, and order handlers manage positions, collateral, and fees. On the spot side, factories, routers, and pair contracts manage swaps and liquidity pools. These contracts are modular and upgradeable, allowing Amara to evolve as new features are introduced.
Oracle Layer – Pricing is secured by the Dione Oracle system. Multiple nodes provide off-chain data that is aggregated on-chain. Consumer contracts then expose this data to the protocol in a Chainlink-compatible format. This ensures traders always interact with the most reliable price feeds available, especially for synthetic carbon credit assets.
Execution Layer (Keepers) – Inspired by GMX’s design, Amara uses external keepers to execute user-submitted orders. When a user opens, adjusts, or closes a position, the request is stored on-chain. Keepers monitor these requests and finalize them once conditions are met, using the latest oracle prices. This asynchronous model protects traders from frontrunning and ensures fair execution.
Together, these layers form the architecture that makes Amara more than just another exchange. It is market infrastructure: a system built to make synthetic sustainability assets liquid, tradable, and accessible within DeFi while providing the speed, transparency, and security expected from modern decentralized protocols.
Last updated
