Skip to main content

Aggregation Logic

To prevent price manipulation, Lemon Markets does not rely on a single source.

Data Sources

Lemon Markets uses a multi-source aggregation strategy to provide the most accurate and real-time pricing for synthetic assets.
SourcePriorityPurpose
DexScreenerPrimaryReal-time prices for low-cap and trending tokens.
GeckoTerminalSecondaryBackup and verification for major pairs.
Pyth NetworkTertiaryInstitutional-grade feeds for high-volume assets (where available).

Aggregation & Confidence

The Oracle Adapter contract doesn’t just take the first result. It:
  1. Polls multiple sources simultaneously.
  2. Verifies results against onchain confidence intervals.
  3. Detects Outliers: If one source deviates significantly from others, it is discarded to prevent price manipulation.

Spot vs. Index Price

  • Index Price: The aggregate price from external oracles.
  • Mark Price: The internal price used for liquidation, which may deviate slightly based on system health to encourage arbitrage.