Oracles and Pricing Mechanisms

Accurate pricing is critical for both perpetual trading and spot swaps. Amara employs a decentralized oracle system built on Odyssey Chain to ensure that trades execute against reliable data, especially when dealing with synthetic sustainability assets.

Dione Oracle At the center of the system is the DioneOracle contract. It is upgradeable and designed to aggregate data from multiple independent oracle nodes. When an asset price is requested:

  • Multiple oracle nodes submit off-chain data.

  • The oracle contract validates and aggregates these submissions into a single on-chain value.

  • The aggregated result is then passed to consumer contracts that interact directly with Amara’s trading modules.

This design prevents reliance on a single price source and minimizes the risk of manipulation.

Consumer Contracts Specialized consumer contracts such as TechBasedOffsetUSDPriceFeedV2 interact with the DioneOracle to provide Chainlink-style APIs (latestRoundData()). This makes it easy for trading modules, subgraphs, and external dApps to fetch the latest validated price for a given asset.

  • Each consumer contract is designed for a specific trading pair or asset type.

  • They ensure only the freshest data is accepted, using mechanisms like heartbeat checks and timestamp validation.

  • Outdated or invalid submissions are rejected automatically.

Perpetual Market Pricing For leveraged trades, price feeds are central to determining margin requirements, profit and loss, and liquidation thresholds. When a trader opens or closes a position:

  1. The Router requests the latest price from the Oracle.

  2. The Oracle returns the aggregated result.

  3. The Position Manager uses this data to update the trader’s collateral and calculate funding rates.

Orders are executed asynchronously. Keepers fetch prices at the moment of execution, ensuring that traders always interact with current market conditions.

Spot Market Pricing AmaraSwap pools use the constant product AMM model (x * y = k) to determine swap prices directly from reserves. However, oracle pricing still plays a role in governance, analytics, and cross-protocol integrations. By indexing AMM prices alongside oracle feeds, Amara can compare pool data to external benchmarks, ensuring integrity and transparency.

Security Measures The oracle system includes several safeguards to protect against manipulation:

  • Minimum response thresholds: At least a set number of oracle nodes must respond before a price is finalized.

  • Heartbeat validation: Consumer contracts reject stale data if it is older than the last recorded heartbeat.

  • Upgradeable design: Using OpenZeppelin’s upgradeable libraries, both oracle and consumer contracts can be upgraded to adapt to new markets or standards.

  • Event logging: Every price submission and update is logged on-chain, providing full transparency for audits and analytics.

Future Expansion The oracle system is modular, allowing new feeds to be added without disrupting existing markets. Future integrations may include additional sustainability-related data providers, such as carbon offset registries or green energy indexes, expanding Amara’s ability to support synthetic markets tied to real-world climate finance.

Last updated