## What Is EIP-712?
EIP-712 is an Ethereum standard for structured data signing. It allows users to sign human-readable data with their wallet — and that signature can be verified on-chain by smart contracts.
In OraclBet's on-chain trading mode, EIP-712 enables **gasless order placement** with **on-chain settlement**.
## How It Works
### Step 1: Create Order The trader specifies: - Market ID - Side (Yes or No) - Price (e.g., $0.55) - Quantity - Expiration time
### Step 2: Sign with Wallet The order is structured as an EIP-712 typed data message and signed by the trader's wallet. This signature proves the trader authorized this exact order — without submitting a transaction.
### Step 3: Submit to Order Book The signed order is sent to OraclBet's order matching engine. No gas is spent — it's just a signature.
### Step 4: Matching When a matching counter-order arrives, the matching engine pairs them.
### Step 5: On-Chain Settlement The matched trade is submitted to the Polygon smart contract with both signatures. The contract: - Verifies both signatures are valid - Transfers USDC between traders - Mints conditional tokens (Yes/No shares) - Records the trade on-chain
## Benefits of EIP-712 Trading
### For Traders - **Zero gas for orders** — only matched trades cost gas (< $0.01 on Polygon) - **Limit orders** — set your exact price, no slippage - **Cancel for free** — unmatched orders can be cancelled without gas - **Human-readable** — your wallet shows exactly what you're signing
### For the Market - **Better price discovery** — order books reveal supply and demand depth - **Professional market making** — firms can post orders efficiently - **Tighter spreads** — competition between market makers benefits everyone
## LMSR vs. EIP-712 Order Book
| Feature | LMSR (Instant) | EIP-712 (On-Chain) | |---------|----------------|---------------------| | Counterparty | Automated market maker | Another trader | | Slippage | Yes (size-dependent) | None (filled at your price) | | Guaranteed fill | Always | Only if matched | | Gas cost | Per trade | Only on match | | Best for | Quick trades, thin markets | Precise pricing, large orders |
## When to Use Each Mode
- **Use Instant (LMSR)** when you want guaranteed execution and the market has good liquidity - **Use On-Chain (EIP-712)** when you want a specific price and are willing to wait for a match
Both modes are available on every market page via a simple toggle.
## Conclusion
EIP-712 signed orders bring the efficiency of centralized exchange order books to decentralized prediction markets. By combining gasless order placement with on-chain settlement, OraclBet offers professional-grade trading infrastructure on Polygon.