Cross-check an oracle before capital moves
Compare oracle returns with pool-implied state and policy thresholds before routing, lending, liquidating, or rebalancing.
Goal
Return a PASS or REJECT row for a price-dependent action by checking two things first: whether the oracle round is fresh, and whether a pool-implied price is within the allowed deviation.
When to use this
Use this before route approval, lending actions, liquidation checks, vault rebalances, or agent-proposed trades when the action depends on a live price.
Inputs to change
$transportselects the RPC endpoint.- The Chainlink feed is the ETH/USD proxy address.
- The pool is the Uniswap v3 USDC/WETH 0.30% pool.
$max_age_secondsis the maximum accepted age of the Chainlink update.$max_deviation_pctis the maximum accepted absolute pool-vs-oracle difference.
What the query does
read latestRoundData -> compute Chainlink age -> read pool slot0 -> compute pool price -> compare thresholds
Query
Read the output
The output is intentionally a decision row, not just a price cell. reason tells the caller which threshold failed.
decision | reason | chainlink_eth_usd | chainlink_updated_at | chainlink_age_seconds | pool_eth_usd | pct_diff
---------|------------------|-------------------|----------------------|-----------------------|--------------|---------
PASS | within_threshold | ... | ... | ... | ... | ...
Inspect chainlink_updated_at, chainlink_age_seconds, pool_eth_usd, and pct_diff before relying on the decision. pct_diff is positive when the pool-implied price is above the Chainlink value and negative when it is below.
Next step
Once the price input passes, continue by executing the candidate with evm_execute_candidate, applying durable policy through evm_create_policy_spec and evm_evaluate_policy, and promoting the selected branch with evm_promote_candidate_evidence.