TAIFOONGAS & PRICE ORACLE — CONTINUOUS DATA JOBS
11GAS & PRICE ORACLE
Gas & Price Oracle
TL;DR
Continuous gas and price data for 41 chains. Gas oracle: 15s refresh, 5-min bucket aggregation, slow/standard/fast recommendations with spike detection (2.5× threshold). Price oracle: bloom-filtered DEX Swap events — not Coingecko. REST today; gRPC streaming (6 methods) at paid tier launch.
Gas oracle: 15s refresh, 5-min bucket aggregation, slow/standard/fast recommendations with spike detection. Price oracle: bloom-filtered DEX Swap events, not Coingecko. Delivered via REST today; gRPC streaming (6 methods) coming at paid tier launch. Every data point traceable to a specific block with optional MMR proof.
Cache Refresh
15s
cadence
Bucket Window
5min
aggregation
Spike Detection
2.5×
threshold
Baseline Period
30d
rolling
01 — Gas Oracle Pipeline
01
Header Collection
gas_used, gas_limit, base_fee, tx gas prices every block
02
RocksDB
Key: gas:{chain_id}:{block}. Persists across restarts.
03
Bucket Aggregation
5-min tumbling windows. P10→P95, std dev, volatility.
04
SmartGasEngine
12 buckets (1h). Volatility-aware safety margins. EIP-1559 split.
05
gRPC / REST
slow/standard/fast + confidence_score + is_spike
02 — DEX-Native Price Provision
01
Subscription Activation
OperationType::Oracle → job. POST /api/v1/subscriptions (operation_type: oracle).
02
Pool Monitor
ScheduledPoolMonitor per token/DEX/chain. Tracks last_processed_block — no data reprocessed after restart.
03
Bloom Filter Scan
Every 60s, checks block header Bloom filter for Swap topic0 + pool address. Only bloom hits trigger log fetch.
04
Price + MMR Link
Price = reserve_quote / reserve_token adjusted for decimals. Optional MMR proof linkage for verifiable feeds.
03 — gRPC Service Methods
service GasOracle (port 50051)
Coming at paid tier launch. tonic / prost runtime.
Mode
Method
Cadence
Description
U
GetGasPrice
On demand
slow / standard / fast recommendation per chain. confidence_score, is_spike, % vs. market. 30s cache.
S→
StreamGasPrices
300s
Server-streaming. Continuous gas feed at configurable interval (default 300s). No polling needed.
U
GetMultiChainGasPrices
On demand
Batch request: list of chain_ids → list of GasPriceResponse. For DEX aggregators routing 5–10 chains.
U
GetGasHistory
Historical
Historical GasBucket objects between timestamps. Full percentile distribution per 5-min window. ML/backtesting.
U
GetGasBuckets
Recent N
Last N 5-minute buckets for a chain. Simpler than GetGasHistory for recent data.
U
GetUnifiedMetrics
Per block
The integration primitive: finality proof type + gas metrics + block metadata + SuperRoot ref in ONE call.
U = Unary (request/response) · S→ = Server streaming
Integration Primitive
GetUnifiedMetrics — All Data in One Call
GetUnifiedMetrics is the most architecturally significant method for protocol integrations. A single call returns gas price (slow/standard/fast), the chain's finality status, the proof type (PoW / GRANDPA / TowerBFT / L2Anchored), the current block number, and a reference to the active SuperRoot. For a cross-chain bridge that needs to answer the question "what does it cost to settle this and how confident am I that the source block is final?" — this is one gRPC call, not three separate services.