Orderbook
Using the Order Book
Yolomarkets uses a Polymarket-style off-chain order book to run its betting markets, which lets trading behave like a real exchange with deep liquidity, tight spreads, and non-custodial settlement.
Placing Orders Off-Chain
Traders place bids and asks off-chain by submitting limit orders such as “Buy 200 units of the 50–60% bucket at 0.42” or “Sell 500 units of the 20–30% bucket at 0.31.” All quoting, cancelling, and order modification happens off-chain without gas costs, because Yolomarkets runs its own matching engine and maintains a live order book for every bucket, continuously streaming best bid and best ask data into the UI.
OffChain Matching for Speed
When a buy order crosses a sell order, the off-chain matching engine pairs them together, calculates the trade at the agreed price, nets the token and collateral deltas for both sides, and prepares a settlement batch. This lets the platform behave like a fast CEX while still remaining fully on-chain in the final accounting layer, because no individual order touches the blockchain; only finalised trades do.
On-Chain Settlement & Negative Risk Margining
The matched bundle is pushed on-chain in a single call, such as executeMatchedTrade(trader, outcomeTokenDeltas[], collateralDelta, feeAmount), which updates outcome-token balances, collateral balances, and fee accounting. Each trader is checked against the negative-risk margin model to ensure they remain fully collateralised, exactly like Polymarket, so that regardless of how many buckets they hold, the protocol only requires enough collateral to cover the worst possible outcome.
Outcome Tokens Represent Exposure
For every percentage bucket (0–10%, 11–20%, and so on), the system internally mints or burns ERC1155-style outcome tokens that represent a claim on 1 unit of collateral if that bucket wins the final resolution. These outcome tokens track exposure across all positions and are continuously netted as traders buy or sell, just like the CTF model used by Polymarket.
Fee Accrual for Opinion Givers
Every matched trade routes a 1% fee into the market’s FeeVault, which is later distributed to opinion givers who voted correctly using a Merkle-proof claim system after the market resolves.
Finalising the Winning Bucket
Once the opinion market generates the final percentage, for example, 58% choosing Polymarket over Kalshi, the system maps that value to the appropriate bucket, such as 50–60%. The CTF engine finalises that bucket as the single winner, and traders holding its outcome tokens can redeem them for their full collateral value, while all other buckets settle to zero.
Last updated