Skip to main content
This page answers common technical questions about how ezpz.fi is built. It describes the current M1 architecture (AMM-first, self-custodial trading, open API).

Oracle and settlement data sources

ezpz.fi does not use Solana-native oracle networks (Pyth, Switchboard, etc.) to resolve markets for now. Settlement is a two-step process:
  1. Off-chain truth gathering which is to gather feeds, crons, and operators determine the outcome.
  2. On-chain settlement where a trusted platform oracle signs resolve_market on authoring-market, which records the winner and enables redemption.

By vertical

Every market declares a resolution source and criteria at creation. Operators (or automated crons for factory markets) must follow that declaration. Disputes are handled off-chain in oracle-admin; on-chain, dispute_market / uphold_resolution / overturn_resolution gate redemption.

Solana-native vs off-chain oracles


How positions are represented

Single-market predictions (SPL tokens)

Player positions on binary markets are real SPL tokens, not opaque database balances:
  • Each market leg has a YES mint and a NO mint (anchor_spl::token::Mint).
  • When a player makes a prediction, USDC is converted to a complete set (YES + NO) via mint_tokens / mint_tokens_v2, then the unwanted side is swapped via the AMM.
  • Tokens sit in the player’s custodial token account (ATA) managed by the platform.
  • Portfolio and the API project on-chain balances; the indexer mirrors mint, swap, and redeem events.
Winning players call redeem to burn winning tokens and receive USDC from the market vault.

Parlays on-chain program accounts

Parlay predictions are not outcome SPL positions. They are recorded in Parlay accounts on authoring-parlay:
  • Stake is USDC in the parlay LP pool.
  • Legs reference underlying markets; resolve_leg reads each market’s on-chain outcome.
  • Payout is USDC from the parlay pool via settle_parlay.

CLOB positions (future / v2)

CLOB inventory is also SPL-based: makers hold USDC and outcome tokens in ATAs with exchange-delegate approval so authoring-exchange::settle_match can move tokens atomically after off-chain matching.

Solana-native dependencies

ezpz.fi keeps on-chain dependencies minimal. There is no Jupiter swap integration, no Pyth price feed, and no external AMM router in the settlement path. External off-chain data (not Solana programs):
  • Polymarket Gamma / CLOB WebSocket (sports + crypto reference data)
  • pump.fun APIs (coin markets)
  • Spot exchanges (Coinbase, Kraken, etc.) for charting where configured
  • Supabase (auth), PostgreSQL (app + indexer state)

On-chain update frequency and price feeds

Prices are not posted on-chain on a schedule. There is no requirement for sub-second on-chain price updates. The AMM price at trade time is whatever the pool math returns for that transaction.

On-chain vs off-chain components

Source of truth for funds: Solana programs. Postgres and the indexer are projections of on-chain events, not authoritative ledgers for USDC custody.

Pricing model

M1 retail trading uses an automated market maker (AMM), not a central limit order book. LS-LMSR is a bonding-curve-style market maker: the pool maintains a cost function over outstanding quantities rather than a traditional order book. It is not a Uniswap-style constant-product pool once upgraded.

What runs where: pricing, matching, odds, settlement

CLOB retail trading is gated off in M1. Players trade via the AMM. Makers and factory markets may still use CLOB infrastructure in preparation for v2.

End-to-end: single AMM prediction

  1. Off-chain: Player confirms trade in UI; API checks balance and market status.
  2. On-chain: Custodial signer submits swap (which CPIs mint_tokens_v2 + AMM math).
  3. On-chain: Player holds YES or NO SPL tokens in custodial ATA.
  4. Off-chain: After event ends, operator or cron determines winner.
  5. On-chain: resolve_market → dispute window → redeem pays USDC from market vault.
See also: Venues, Prices & AMM, Resolution, Outcome tokens.