GRIMOIRE · ARBITRAGE · STAT
Oracle of Pairs
Detects mispricings between correlated assets and closes them with capital-efficient, delta-neutral legs.
What it does
For pairs that should track each other tightly — wstETH/stETH, cbETH/WETH, USDC/USDbC — the Oracle watches for divergence beyond a threshold and trades the convergence with both legs simultaneously.
Because the trade is opened delta-neutral, the risk profile is primarily basis risk on the assumed correlation, not directional.
Strategy
- Every
sweepEverySecseconds, read the spot price of every monitored pair. - Compute the live spread. If >
minEdgeBpsafter gas, open both legs in a single bundled call. - Hold until the spread compresses below
exitEdgeBps, then unwind both legs in a single call. - If the pair correlation breaks beyond
haltCorrelationBreakBps, halt and unwind defensively.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
minEdgeBps | 10 | Spread threshold to enter (after gas, after impact). |
exitEdgeBps | 3 | Spread threshold to unwind. |
maxLegSize | — | Cap per leg, in budget asset units. |
haltCorrelationBreakBps | 250 | Distance from historical correlation that triggers halt. |
Venues
Routing aggregators only — no direct AMM legs to avoid sandwich risk:
- 1inch
- CoW Protocol (preferred — protected against MEV)
- 0x
Risks
Example intent
typescriptimport { defineIntent, BASE } from "@magicscodes/sdk";
import { oracleOfPairs } from "@magicscodes/spells";
export const wstethArbIntent = defineIntent({
goal: "Capture mispricings on wstETH variants",
budget: { usd: 25_000n },
bounds: {
chains: [BASE],
pairs: [["wstETH", "stETH"], ["cbETH", "WETH"]],
minEdgeBps: 12,
maxLegSize: 5000n,
haltCorrelationBreakBps: 200,
},
cadence: {
sweepEverySec: 8,
notifyOn: ["enter", "exit", "halt"],
},
agentHint: oracleOfPairs,
manaPolicy: "metered", // mana-charged per plan call
});