Vertigo is prediction markets for every squad. Any group of friends, community gets its own market.
Vertigo is prediction markets for every squad. Any group (friends, a hackathon team, a city community) gets its own onchain market over up to eight base events. Members buy single-event contracts or parlays, the paper's "joint contracts on the simultaneous resolution of several events", of up to three legs. Before paying, they see the exact payout for every outcome pattern, and they can sell a single-event position back before close. Every trader is a verified human through World ID, so nobody can farm a market with fake wallets.
Each squad runs one engine priced by LOPMM, the Low-Order Parlay Market Maker. It "keeps a separate book for each combination of legs": one logarithmic market scoring rule (LMSR) book per leg-set, with a common liquidity b. Each book stores its own parameter block r(S). The engine "shares information from lower-order parlays into the higher-order ones containing them", so a trade on one event reprices every parlay that contains it. We cap parlays at three legs to match the paper's low-order flow condition (most flow is in parlays of at most k legs). Because of that cap, the cost of a trade depends on the order m of the parlay, not on the number M of base events, and the operator's worst-case loss stays bounded.
A buy is a full-trade: the trader states a target belief on their chosen pattern. The engine splits it into sub-trades, one for each lower-order book inside the parlay (seven for three legs), and settles them in the paper's buy-only realization with gauge shifts. The engine reserves each position's maximum payout so winners are always paid. Because a position also holds claims in the lower-order books, partial matches can pay. On top of the paper we add a graded target rule: other patterns are weighted by how many legs they match, so payouts rise in equal steps per correct leg instead of all-or-nothing. Selling back, an exact LMSR inverse on single-event books, is also our extension; the paper's mechanism is buy-only.
Trades reach the same engine through two venues: 1inch Aqua with a custom SwapVM strategy, and a Uniswap v4 custom-accounting hook. The operator picks the venue for each squad in an admin portal, and the contracts enforce it. Squads get ENS names that point to their market. Squad events can be resolved by an EIP-712-signed outcome published to ENS, followed by a challenge-and-vote among verified members. Each position is an NFT that stores its payout for every outcome pattern, and winners claim after resolution.
Everything runs live on Ethereum Sepolia: 14 squad engines, 155+ positions, buys and sells on both venues, and a deployed web app and admin portal.
Contracts (Solidity 0.8.30, Foundry).
Engine. Each squad's LopmmEngine is a beacon proxy. It holds the squad's collateral and keeps one LMSR book per leg-set, each stored as a parameter block r(S) at a common liquidity b. A stateVersion counter stops stale quotes from filling. The engine reserves the maximum payout of every position and pays claims. Positions. Positions are ERC-721 NFTs that record their payout for every outcome pattern. Allowance. A CapacityGate enforces a daily spending allowance per verified human, using vouchers our backend signs after a World ID proof. Math written twice. The LOPMM math exists in TypeScript and in Solidity with identical integer arithmetic (bounded log/exp, largest-remainder rounding). That covers the full-trade, its sub-trades into every lower-order book, the buy-only realization and the gauge shifts. A 10,000-case differential test shows both give bit-identical quotes, next books and payouts. A 70-digit Python Decimal oracle independently checks the TS model. Size limit. To stay under the EIP-170 size limit, the engine calls a stateless LopmmEngineLens contract for all pure pricing and forwards its ABI-encoded return data unchanged. 1inch. The engine is an Aqua maker that ships one SwapVM strategy: a single Extruction instruction (opcode 0x20) that calls the engine for the price.
The hacky part. ERC-20 and ERC-721 share the transferFrom(address,address,uint256) selector, so the position NFT is the swap's output. Buys are exact-out swaps with amountOut set to the id of the NFT being minted. Sells reverse it: an exact-in swap of the NFT for collateral, with a just-in-time approval of exactly the refund, so no standing allowance ever exists. Side effects. We mapped what this trick could break: the engine only lets the freshly minted id move, only our router can pull, and no receiver callbacks run. Uniswap v4. A custom-accounting hook with the flags beforeInitialize, beforeAddLiquidity, beforeSwap and beforeSwapReturnDelta, at a CREATE2-mined address.
Buys. In beforeSwap, the hook moves the trader's payment from the PoolManager into the engine, and the engine mints the NFT straight to the trader. The hook returns a BeforeSwapDelta that consumes the whole input, so the curve never runs and pools stay at 1:1 with no liquidity. Sells are exact-output swaps for exactly the refund. Charging the right person. The real trader comes from the trusted Universal Router's msgSender(), so the World ID allowance is charged to whoever paid. Pricing beyond the paper. The paper's mechanism is buy-only, and its contracts pay only on their exact pattern. We added two things on top:
Selling back. A single-event position can be sold back at the exact LMSR inverse of its purchase: refund = C(q) − C(q − payouts), minus the fee. A fuzz test checks that a buy-then-sell round trip never profits. Graded target rule. For parlays, the trader's target belief p is pinned on the chosen pattern. The other patterns are tilted by how many legs they match, with weights q·w^matches and w solved by integer bisection. Routed through the sub-trades, this makes payouts rise in equal steps per correct leg. Engines opt in onchain, and existing positions keep their payouts. The price history replays each full-trade with the rule in force at its state version. ENS.
Squad names on an ENSv2 permissioned resolver carry text records that point to the engine. The owner can delegate writing a single record key. A SquadVoteResolver imports the designated proposer's EIP-712-signed outcome from ENS through the Universal Resolver. It verifies the signature against the frozen event facts, then runs a challenge and a one-vote-per-human vote before resolving the engine. App and infrastructure.
App. A Next.js app with a three.js globe of squads, and live market charts rebuilt by replaying the position NFTs' full-trades, with no log indexing needed. An admin portal handles venue switching and resolution. Backend. A Hono API (wallet auth, World ID verification, voucher signing) running on Vercel with Upstash Redis. Browser chain reads go through a read-only RPC proxy, so the RPC key stays on the server. Libraries and deploys. Client libraries use viem and the 1inch SwapVM and Aqua SDKs. Deploys run from GitHub Actions on every merge. Tests. 225 Foundry tests, including fork tests against live Sepolia Aqua, the PoolManager and the Universal Router. 150+ TypeScript tests.

