Search projects, hackathons, sponsors and tech

    ← All projects

    MIRAGE

    Evidence before allocation: oracle checks, accounting consistency and Uniswap exit quotes

    Demo

    About

    An attractive lending rate does not tell an allocator whether its next market deserves a deposit. MIRAGE adds that missing decision step. Before USDC enters a Morpho Blue market, it checks available liquidity, the configured oracle, and a specified collateral sale against independent Uniswap prices and quotes. The Graph supplies live market discovery. MIRAGE turns those market IDs into a report with exact Ethereum calls, then applies the report to our existing allocation policy. Users can inspect the evidence, change the proposed amount, check another market, and compare the original decision with the admission gate. The workbench opens on 47 of those markets: every market that passed, plus the largest refusals. A market is refused when evidence is missing, when a check fails, or simply when its own supply is smaller than the entry it was offered. A wstETH example shows why route selection matters: the same input quotes about 5,928 USDC directly and 10,008 USDC through WETH. Its exit check passes after comparison; its unsupported oracle remains visible. Every result names its block, amount and coverage. Beyond the workbench set, we published all three check groups for all 697 Graph-discovered USDC markets at block 25938815, for a 10000 USDC scenario. The aggregate is 11 PASS, 95 BLOCK and 591 INSUFFICIENT. A market whose own supply is smaller than the proposed entry is refused whatever its other checks returned. Complete collection includes unavailable evidence; it is not a claim that every market can be assessed or admitted. The original snapshot, corrected diagnostics and audit records are public and can be replayed offline.

    How it's made

    MIRAGE extends our existing open-source USDC allocator and reuses the MIT-licensed EVM bytecode extractor from our second project, revert.pro. The original T1 decision policy still proposes an allocation. A new admission wrapper evaluates the market evidence and can veto that proposal when checks fail, are incomplete, or do not cover the proposed amount. This repository also carries our earlier MCDM allocator research, so its first commit predates the event. All MIRAGE code sits in mirage/ and contracts/: the first commit under mirage/ is 9 September 2026, the first under contracts/ is 13 September 2026, both inside the hacking window. The pre-existing part is the T1 policy being wrapped, which is unchanged and still makes the original proposal. A deployed Subgraph Studio subgraph indexes Morpho Blue CreateMarket events. Python discovers USDC markets at a pinned block hash, then makes individual RPC reads of market state, oracle contracts and interest-rate models. Supported oracle templates use factory membership, configuration getters and sampled historical prices. Unsupported bytecode goes through the existing 70-feature extractor for structural diagnostics. Uniswap v3 supplies a geometric TWAP and QuoterV2 sale simulations. MIRAGE compares direct and WETH routes with exactly the same collateral input, preserving both results and their raw calls. Offline replay rebuilds derived values from those calls. A Python server exposes the interactive workbench, evidence inspection and original-policy comparison. For the original frozen four-market capture, we independently reread 185 distinct contract calls and eight runtime-code reads through each of two RPC providers; all matched. Two small Sepolia contracts close the loop. MirageGate (0xe1b9031EeF64e376c37B4e3E849B35424f647901) records each admission decision on chain and prices it against the Chainlink ETH/USD feed through AggregatorV3Interface, inlined rather than imported. It refuses to record when the round is incomplete, the answer is not positive, or the update is older than the configured maximum age. ExecutionGuard is the reference consumer: its enter reverts unless the gate holds a fresh ALLOW for that exact market and amount, so an admission that was never granted cannot be spent. The separate full-universe capture covers all 697 discovered markets at block 25938815. Independent accounting and Uniswap calculations checked the saved raw observations, and expected exit outcomes matched production for every market. Both original and derived snapshots replayed successfully; the diagnostic migration preserved raw evidence, finding codes, severities and rates. These are offline checks, not a second-provider verification of the full universe. An optional stdio MCP server uses the official Python SDK to expose three reusable tools: get_saved_report, inspect_market, and preview_saved_allocation. An official SDK client successfully called all three, including a live Graph-to-RPC inspection of a PAXG market at block 25938274. The bundled client chooses its cases from the report the server just returned rather than from pinned market IDs, so the demonstration follows whichever evidence ships. AI agents can consume the same structured evidence and allocation comparison as the workbench. Findings are computed by explicit rules; no LLM or ML safety score decides admission.