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. Fuel Earn deliberately uses this rolling value directly; it does not apply Fuel Credit V8's separate min(live, rolling) policy.
Vault policy
For each new position, the Vault:
- reads
price()with no asset argument; - rejects
None, zero or crossed prices, decimals other than 9, future or older-than-25-hour records, and conversion overflow; - floors
bid / 1_000_000_000_000from 1e18 to the Vault's e6 scale; 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.