Skip to content

Simplified O2 TWAP oracle ​

Fuel Earn reads the shared, ownerless testnet oracle at 0x2c32b316b19394261f271bdf2ece2756389c2d9351ab50f13d5b3605b5a176f2. The oracle samples the O2 fFUEL bid no more than once every six hours and keeps up to 120 samples (about 30 days). Anyone may call update(); the contract validates source freshness and enforces the sampling interval.

price() returns the arithmetic mean of retained bids at 1e18 scale. It returns None before the first sample or when no accepted update has occurred for 25 hours. The Vault also reads the live bid from the same O2 source and uses the lower of live and rolling prices.

Vault policy ​

For each new position, the Vault:

  1. reads the rolling price() and live O2 price(fFUEL);
  2. independently rejects unavailable, zero, crossed, wrong-decimal, future, or stale values; live freshness follows O2's limit capped at 25 hours;
  3. selects the lower 1e18 bid, then floors it once by 1_000_000_000_000 to e6; and
  4. fixes the resulting opening price for the position's lifetime.

FUEL and stFUEL both use the testnet fFUEL source price per unit. There is no minimum sample count: early rolling history is genuine and accepted. Oracle unavailability blocks only new openings; transfers, unbonding, claims, and market settlement remain available.

Operations ​

The independent updater runs every 15 minutes; only the first eligible call after each six-hour interval can add a sample. Fuel Earn does not run a second keeper. Monitor:

bash
bun run oracle:health:testnet

External health: https://fuel-credit-testnet-simplified-oracle.nick-j-alexander.workers.dev/v1/health. Verify source_oracle() is the O2 testnet proxy and source_asset_id() is O2 fFUEL before any deployment. These addresses and assumptions are testnet-only.

Managed custody · Testnet preview · Audit pending