Parlay-markets

On-chain parlays on 1inch Aqua: LMSR pricing, Chainlink CRE settlement, cross-chain buys via CCIP

Parlay-markets

Created At

ETHGlobal Mumbai

Project Description

Parlay Markets is a fully on-chain sports parlay betting protocol built on Ethereum Sepolia. Users pick 2–5 match outcomes (e.g. Man City wins AND Real Madrid wins) and stake USDC to receive a parlay ticket NFT. Pricing uses a Logarithmic Market Scoring Rule (LMSR) AMM — each leg's implied probability is read on-chain, multiplied together with a 10% house margin, and the payout is computed as stake ÷ combined_price. Liquidity for payouts is sourced virtually through 1inch Aqua: the LP's USDC never leaves their wallet until a winning ticket is claimed. Cross-chain buying is supported via Chainlink CCIP — users on Base Sepolia can send USDC and parlay legs in a single CCIP message, and the receiver on Ethereum Sepolia mints their ticket atomically. Market resolution is wired to Chainlink CRE (Compute Runtime Environment) for automated settlement. Winners claim payouts directly from the ParlayVault smart contract.

How it's Made

The core stack is Solidity (Foundry) + Next.js 15 + wagmi v2 + viem. LmsrMarket.sol implements a custom LMSR AMM with configurable liquidity parameter b, storing outcome shares and computing prices via the standard exp-based scoring rule. AquaParlayRouter.sol integrates 1inch Aqua's virtual liquidity: the LP calls Aqua.ship() to register a payout reserve, and on every parlay purchase the router calls Aqua.pull() to transfer exactly the payout amount from the LP's wallet. ParlayVault.sol is an ERC-721-style ticket registry — it mints tickets on purchase and pays out on claim after all legs resolve. CCIPParlayReceiver.sol handles incoming Chainlink CCIP messages from Base Sepolia, decodes the parlay legs, pulls USDC from a reserve, and mints the ticket on the destination chain. MarketResolver.sol is the resolution oracle, callable only by the Chainlink CRE forwarder address. The frontend uses a custom wagmi transport that routes reads through public RPCs and signing through the injected wallet, working around Alchemy's EIP-7702 delegated-account rate limits.

background image mobile

Join the mailing list

Get the latest news and updates

Parlay-markets | ETHGlobal