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:
- reads the rolling
price()and live O2price(fFUEL); - independently rejects unavailable, zero, crossed, wrong-decimal, future, or stale values; live freshness follows O2's limit capped at 25 hours;
- selects the lower 1e18 bid, then floors it once by
1_000_000_000_000to e6; and - 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:
bun run oracle:health:testnetExternal 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.