Compare candidate routes in isolated forks
Run competing routes, rebalances, repayments, or agent plans in separate product branches. Rank outcomes and reject unsafe paths with reasons.
Goal
Run competing candidates in isolated product branches and return one row per branch. The output marks the best valid branch as PASS and rejects failed, unsafe, or worse branches with a reason.
When to use this
Use this when a solver, execution engine, or agent wants to run a route tournament without contaminating state between trials.
This guide uses tiny bytecode candidates to keep the example focused on branch orchestration. The same pattern applies to router calldata, vault rebalances, liquidation paths, repayments, deployment branches, and agent plans.
Inputs to change
$transportselects the RPC endpoint.- The
route_inputstable defines branch names, quoted amounts, expected output, and score assumptions. - The policy JSON requires success and caps gas at
100000.
What the query does
pin state -> execute one product branch per route -> score branches -> store decisions -> read run decisions
Query
Read the output
Each branch returns independently. A branch is rejected when execution fails, policy fails, or another valid branch returns more output.
scenario | decision | reason | gas_used | policy_status | quality_status
---------|-----------------|---------------------|----------|---------------|---------------
route_b | PASS_BEST_ROUTE | best valid route | ... | pass | OK
route_a | REJECT_WORSE... | another route... | ... | pass | OK
Inspect scenario, decision, reason, gas_used, policy_status, and quality_status. Use evm_run_asset_deltas, evm_run_touched_contracts, and evm_run_branch_comparison for deeper branch analysis.