Execution-Quality Verifier
exec_verifyDeterministic execution-quality / fair-fill verification. Given a completed swap (amountIn, amountOutRealized) plus either the pre-trade pool reserves+fee (constant-product) or a fair reference price, returns how many basis points the fill lost to ADVERSE execution (sandwich/MEV/stale) beyond the unavoidable fee + own price impact. Proves that a fill "within slippage tolerance" can still have been robbed. Call after a swap to detect being sandwiched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| feeTier | No | pool fee as fraction, e.g. 0.003 | |
| amountIn | Yes | input amount actually sent | |
| fairPrice | No | reference mode: fair out-per-in price at submit time | |
| reserveIn | No | pool reserve of input token, pre-trade (constant-product mode) | |
| reserveOut | No | pool reserve of output token, pre-trade | |
| amountOutRealized | Yes | output amount actually received | |
| slippageTolerancePct | No | the slippage setting used, to demonstrate within-tolerance-yet-robbed |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | false when the engine rejected the input | |
| mode | No | constant-product or reference-price mode | |
| note | No | interpretation guidance | |
| proof | No | Verifiability envelope: echoed inputs, engine codeHash, contentHash of this exact result, self-checks, EIP-712 signature (EAS-ready). Re-run the open engine on `inputs` to reproduce the result byte-for-byte. | |
| checks | No | Ground-truth self-checks; the result is untrustworthy if any fails. | |
| verdict | No | plain-language verdict | |
| midPrice | No | pre-trade mid price | |
| honestOut | No | output an honest execution would have delivered | |
| adverseValueOut | No | value lost to adverse execution, in output-token units | |
| honestFillPrice | No | the fill price an honest execution would have produced | |
| realizedFillPrice | No | the fill price actually received | |
| unavoidableCostBps | No | fee + own price impact — the honest, unavoidable cost (bps) | |
| adverseExecutionBps | No | bps lost to ADVERSE execution beyond the honest cost |