How It Works
From quote request to on-chain anchored certificate — the full Bench pipeline in detail.
Query Fan-Out
When an agent requests a quote, Bench dispatches parallel requests to all 13 supported DEX aggregators. Each adapter normalizes the response into a standard format:
{
source: "1inch",
outputAmount: "2847320000",
gasEstimate: "145000",
latencyMs: 98,
route: "ETH → WETH → USDC",
success: true
}
Supported Sources (13)
Sources are weighted by tier. Tier 1 sources have higher weight in consensus. Failed sources are excluded — Bench adapts to whatever responds successfully.
Consensus Engine
Once quotes arrive, the consensus engine processes them:
- A
Outlier Removal
Quotes that deviate more than 2 standard deviations from the median are flagged as outliers and excluded from consensus.
- B
Weighted Median
Remaining quotes are weighted by source tier and used to compute the weighted median price — the consensus best price.
- C
Agreement Scoring
Each source is scored 0-100 based on how close its quote is to the consensus. The overall agreement score is the weighted average.
- D
Best Price Identification
The source offering the highest output amount (best execution) is identified. This may differ from the consensus median.
- E
Certification Level
Based on agreement score and source count: CERTIFIED (≥70, ≥3 sources), WARNING (below threshold), FAILED (critical disagreement).
Certificate Issuance (BEC v2)
The Bench Execution Certificate (BEC v2) is a structured, signed attestation containing:
certHash: "0xabc...",
agentAddress: "0x5a6A...",
chainId: 196,
inputToken: "ETH",
outputToken: "USDC",
inputAmount: "1000000000000000000",
bestSource: "1inch",
bestOutputAmount: "2847320000",
sourceAgreementScore: 94,
certificationLevel: "CERTIFIED",
sourcesSuccessful: 11,
sourcesTotal: 13,
signature: "0x..." // EIP-712
}
EIP-712 Signing
Certificates are signed using EIP-712 typed structured data. The signing domain is:
On-Chain Anchoring
Certificates are anchored to the BenchRegistry smart contract on X Layer (chain 196). The registry stores:
- Certificate hash (bytes32)
- Attestor address (who signed)
- Timestamp (block.timestamp)
- On-chain queryable by cert hash or attestor
Contract: 0x6a400d858daA46C9f955601B672cc1a8899DcE3f
Chain: X Layer Mainnet (196)