⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

GasOracle

exec.gasoracle
Execution live General live frozen

GasOracle continuously monitors the Polygon network gas-price environment and advises the execution layer on whether on-chain operations (order submis

What it does

GasOracle continuously monitors the Polygon network gas-price environment and advises the execution layer on whether on-chain operations (order submission, cancel-and-replace, neg-risk conversions) are economically viable at the current gas price. It defers non-urgent operations when gas is above the rolling percentile threshold, and never defers risk-critical operations such as emergency cancellations.

Pipeline placement

runs after: ExecutionPlan assembly (SmartRouter) GasOracle runs before: Order signing and on-chain submission

Applies to: Every on-chain operation that can be deferred without breaching a risk constraint

Why it matters

If this failsConsequence
Submitting during a gas spikeTransaction costs erode trade profitability; maker rebates (paid in pUSD) can be wiped out by gas fees on low-edge positions.
Deferring a risk-critical cancellationA resting order that should be pulled stays live during adverse market movement, accumulating unintended exposure.
Using a stale 24h gas baselineThe percentile thresholds are miscalibrated, causing GasOracle to defer operations during normal conditions or approve during actual spikes.

Inputs

Internal inputs

InputSourceRequiredUse
Polygon mempool gas-price snapshot (gwei)onchain RPC (eth_gasPrice / fee history)requiredCurrent gas price evaluated against the rolling 24h percentile baseline.
Rolling 24h gas-price baselineinternal time-series storerequiredCompute the max_gas_percentile_for_ops threshold from historical distribution.
Pending operation queue with urgency flagsinternal execution schedulerrequiredIdentify whether each pending op is risk-critical (never_defer) or deferrable.

Authority

What this bot is permitted to do

Reshape

State

Readiness

General live

Status

live

Class

Execution Utility

Default mode

general_live

Developer owner

Polytraders core

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
GAS_ORACLE_OKINFOCurrent gas price is below max_gas_percentile_for_ops; operation approved.Emit GasDecision.PASS. Operation proceeds normally.
GAS_ORACLE_ELEVATEDWARNGas price is in the warning band (within 10 percentile points above threshold). Operation approved with annotation.Emit GasDecision.PASS with warn=true; monitor for further elevation.
GAS_ORACLE_SPIKE_BLOCKRESHAPEGas price exceeds max_gas_percentile_for_ops; non-urgent operation deferred.Emit GasDecision.DEFER with retry_after_s. Operation queued for next lower-gas window.
GAS_ORACLE_EV_BELOW_FLOORRESHAPENeg-risk conversion net EV (after gas cost) is below conversion_min_ev_usd threshold.Emit GasDecision.DEFER. Conversion not submitted.
GAS_ORACLE_RISK_BYPASSINFORisk-critical operation approved unconditionally despite elevated gas (never_defer_risk=true locked).Emit GasDecision.PASS. Gas check bypassed. Log gas_gwei for audit.
GAS_ORACLE_RPC_FAILUREHARD_REJECTPolygon RPC gas feed is unreachable; current gas price cannot be determined.Defer all non-urgent ops. Emit GAS_ORACLE_RPC_FAILURE. Risk-critical ops still approved.
GAS_ORACLE_BASELINE_UNAVAILABLEWARNRolling 24h gas baseline store is unreachable or stale; falling back to hard static cap.Use static 100 gwei cap. Emit WARN annotation on all GasDecision records this cycle.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active; all on-chain operations except emergency cancellations are halted.Defer all non-risk-critical ops. No GasDecision.PASS emitted.

Used by

Reverse index — strategies that currently reference exec.gasoracle. If you change this bot's authority or reason codes, these strategies must re-pass shadow.

StrategyStateActivity
US Elections — sentiment fadedemo-wiredlast triggered 6m ago

Showing 1 of 1 · demo-wired ≠ production-live

Why this matters

Execution bots does NOT propose new positions; only routes and shapes approved intents. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…