Docs
Built on Mezo

Built on Mezo

Every place MEZONK touches Mezo, which Mezo contract it calls, and why each one matters for MUSD.

MEZONK is a prediction market that only makes sense on Mezo. Every market is priced and paid in MUSD, Mezo's bitcoin-backed dollar. If you hold BTC instead of MUSD, the app opens a Mezo loan for you from your own wallet, and BTC price markets are designed to settle from the same BTC price Mezo uses for its own loans. This page lists every one of those touchpoints in one place.

The short version

  • MUSD is the only money. You pay for shares in MUSD, winners are paid in MUSD, bonds and fees are in MUSD. There is no other token and no MEZONK token.
  • You can borrow MUSD inside the app. Lock BTC, get MUSD, trade. The loan is a normal Mezo loan, signed by your wallet against Mezo's contracts. MEZONK never holds your BTC or your loan.
  • The trade ticket can borrow for you. If a trade is short on MUSD, it offers to borrow exactly the difference from your Mezo loan, and the claim screen can send winnings back to the loan.
  • BTC price markets read Mezo's PriceFeed. A market like "BTC at or above $100,000 when trading closes" settles from the price Mezo uses for loans and liquidations. Live on Mezo Mainnet.
  • BTC up or down, with BTC. Hourly rounds where you stake native BTC on Up or Down and winners are paid in BTC from the other side's stakes, decided by the same PriceFeed. Live on Mezo Mainnet.

The picture below shows where Mezo sits. Look at the right-hand side: MUSD, Mezo's borrowing contracts and the PriceFeed are all called directly by your wallet or by MEZONK's contracts, never through MEZONK's server.

MEZONK system: browser and wallet, Next.js server, MEZONK and Mezo contracts, market-maker botBrowserMEZONK web appNext.js client · wagmi · React QueryYour walletsigns every transactionsign requestMEZONK server (Next.js)/api routesJSON: lists, books, quotesOrder servicesuggests fill sources onlyPostgresevents + read tablesIndexerembedded, cron or workerfetch JSONquote, bookqueriessigned orderswritesBot host (keeper)Market-maker bot+ keeper for price marketsA separate process with itsown wallet key. Not the server.Mezo chainMezoPriceFeedBTC/USD priceBorrowing contractsBorrowerOperations, TroveManagerMUSDMezo's dollar (ERC-20)MEZONK contractsMezonkMarketFactoryMezonkResolutionMezonkIncentivesMezonkExchangeholds the MUSDMezonkPriceResolversettles BTC price marketsborrowsigned transactionslive reads: stage, balances, claimablelive readsgetLogsplaceOrdersettle()MUSD in and out
  • MEZONK contracts
  • Mezo contracts
  • Wallets and people
  • Off-chain (servers, data)
Every transaction goes from your wallet straight to the contracts. The server indexes events, serves JSON and suggests which orders a trade could fill, but it holds no keys and can't move funds. Balances, stage and claimable amounts are always read live from the chain.

Why it matters for MUSD

A prediction market is a place where people want to hold dollars for days or weeks: to back a side, to seed a new market's order book, or to post a bond on a result. On MEZONK every one of those dollars is MUSD. Each MUSD in a market was either bought or borrowed against BTC on Mezo, so activity on MEZONK turns directly into MUSD demand and, through in-app borrowing, into new Mezo loans.

The loop the app is built around:

  1. You hold BTC and want to back a side without selling it.
  2. You open a Mezo loan from the app. Mezo mints MUSD to your wallet; your BTC stays locked in Mezo's contracts.
  3. You trade with that MUSD. It sits in MEZONK's exchange as collateral for your shares.
  4. You win, claim MUSD, and repay the loan from the winnings. Your BTC unlocks.

See Bet from your loan for the exact flow.

How it works exactly

Touchpoint 1: MUSD as the only collateral

MUSD on Mezo Mainnet (chain 31612) is 0xdD468A1DDc392dcdbEf6db6e34E89AA338F9F186.

  • The exchange takes the collateral token in its constructor and stores it as immutable collateralToken. It can never be changed. The deploy script refuses to deploy unless the address has code, 18 decimals and the symbol MUSD.
  • Addresses live in two places only: contracts/src/MezoAddresses.sol and apps/web/src/lib/chain/config.ts. The app never resolves a token by its symbol.
  • Every transferFrom into a MEZONK contract checks the balance before and after. If the amount received differs from the amount asked for, the call reverts with UnsupportedToken. MUSD is a standard ERC-20, so this never triggers, but it means a fee-on-transfer token could not be swapped in.
  • One Yes share plus one No share is always backed by exactly 1 MUSD held by the exchange. See Solvency for how to check that yourself.

Touchpoint 2: borrowing through BorrowerOperations

The app calls Mezo's MUSD borrowing contracts (mezo-org/musd, a Liquity-v1-style design) straight from your wallet. The addresses come from mezo-org/musd's deployment files and were checked on-chain on 2026-11-18: every contract has code, they reference each other, and MUSD.mintList(BorrowerOperations) is true.

ContractMezo Mainnet
BorrowerOperations0x44b1bac67dDA612a41a58AAf779143B181dEe031
TroveManager0x94AfB503dBca74aC3E4929BACEeDfCe19B93c193
SortedTroves0x8C5DB4C62BF29c1C4564390d10c20a47E0b2749f
HintHelpers0xD267b3bE2514375A075fd03C3D9CBa6b95317DC3
PriceFeed0xc5aC5A8892230E0A3e1c473881A2de7353fFcA88
InterestRateManager0x4a453700d157717Fe02fB62E7700ED7845048285

Writes the app sends to BorrowerOperations, always with msg.sender = your wallet:

FunctionUsed for
openTrove(debt, upperHint, lowerHint) payableOpen a loan; BTC is msg.value
withdrawMUSD(amount, upperHint, lowerHint)Borrow more, including the trade-ticket shortfall
repayMUSD(amount, upperHint, lowerHint)Repay part, including repaying from winnings
addColl(upperHint, lowerHint) payableAdd BTC
withdrawColl(amount, upperHint, lowerHint)Take BTC out
closeTrove()Repay everything and unlock all BTC

Reads, all taken at one block number so price, mode and fees agree with each other (readBorrowParams in apps/web/src/lib/mezo/borrow.ts):

ContractReads
PriceFeedfetchPrice()
BorrowerOperationsminNetDebt(), borrowingRate(), MUSD_GAS_COMPENSATION(), MCR(), CCR()
InterestRateManagerinterestRate()
TroveManagercheckRecoveryMode(price), getEntireSystemColl(), getEntireSystemDebt(), getTroveStatus(addr), getEntireDebtAndColl(addr), getTroveMaxBorrowingCapacity(addr)
SortedTroves, HintHelpersgetSize(), getApproxHint(...), findInsertPosition(...) for gas hints

Details: Borrowing and Manage your loan.

Touchpoint 3: PriceFeed settlement for BTC markets

MezonkPriceResolver reads PriceFeed.fetchPrice() and the oracle's latestRoundData() right after a market closes, compares the price with a strike recorded before close, and proposes Yes or No through MEZONK's normal resolution process, with an evidence hash of the exact reading. The proposal can still be challenged. Details and limits: BTC price markets.

MezonkPriceResolver is live on Mezo Mainnet at 0xc58D8A13B1e6f1614508ca20124A9d0F60520354.

Touchpoint 4: BTC up or down, staked in BTC

MezonkBtcRounds is the one part of MEZONK that doesn't use MUSD. Rounds run back to back, one hour each. During a round's betting window you stake native BTC on Up or Down; the stake must be worth between the contract's USD limits at PriceFeed.fetchPrice() right then. A keeper captures the price at each boundary with one roll() call that closes one round and locks the next, so there is exactly one price per boundary. Winners split the whole pool in BTC, pro rata, less a fee; a tie, a one-sided round or a missed capture refunds everyone with no fee. The contract holds nothing but stakes, the owner can sweep only fees, and claims never expire. Details: BTC up or down, with BTC.

MezonkBtcRounds is live on Mezo Mainnet at 0xc27f434195e4aF70782817A280A5D3Cb5de2ECa8.

What MEZONK does not do with Mezo

  • It never holds or manages anyone's loan. There is no MEZONK contract that calls BorrowerOperations. The only BTC a MEZONK contract ever holds is a round stake in MezonkBtcRounds, which can go nowhere but back to the wallet that staked it (or to the winners of that round).
  • It does not use the MEZO token for anything.
  • It does not route MUSD through any other protocol.

Next