Market maker API
Use the maker wallet address in the x-wallet-address header. Outcomes map to the market winner:
YES means the base asset wins, NO means the quote asset wins.
x-wallet-address: 0xYourMakerWallet
Markets
btc-eth-5m:YES = BTC wins,NO = ETH winseth-sol-5m:YES = ETH wins,NO = SOL wins
Create one passive limit order
POST /api/mm/orders/limit
{
"walletAddress": "0xYourMakerWallet",
"marketId": "eth-sol-5m",
"outcome": "YES",
"orderSide": "SELL",
"price": 0.53,
"quantity": 120
}
orderSide = SELL posts ask liquidity on that outcome.
orderSide = BUY posts bid liquidity on that outcome.
Replace all quotes for a market
POST /api/mm/orders/replace
{
"walletAddress": "0xYourMakerWallet",
"marketId": "eth-sol-5m",
"orders": [
{ "outcome": "YES", "orderSide": "BUY", "price": 0.47, "quantity": 120 },
{ "outcome": "YES", "orderSide": "SELL", "price": 0.53, "quantity": 120 },
{ "outcome": "NO", "orderSide": "BUY", "price": 0.45, "quantity": 180 },
{ "outcome": "NO", "orderSide": "SELL", "price": 0.51, "quantity": 180 }
]
}
This cancels the maker’s currently open quotes for the active round in that market and posts the replacement ladder. The bundled bot uses this endpoint.
Cancel one order
POST /api/mm/orders/cancel
{
"walletAddress": "0xYourMakerWallet",
"orderId": "mm_abc123"
}
Inspect orderbooks and maker orders
GET /api/mm/orderbook?marketId=eth-sol-5m
GET /api/mm/orders?marketId=eth-sol-5m&status=open
GET /api/bootstrap?walletAddress=0xYourMakerWallet
/api/mm/orderbook returns bids and asks for both outcomes.
/api/bootstrap returns balances, active rounds, user positions, trades, and the maker’s open orders.
Matching and settlement
When a taker buys YES or NO through POST /api/orders/market, the backend matches that order
against passive SELL liquidity on the chosen outcome. Each fill creates:
- a taker long position on the chosen outcome
- a maker short position for every maker quote consumed
At round resolution, the winning outcome pays $1 per share to longs, while shorts keep or lose their locked liability accordingly.
Bundled bot
Run the included bot with a dedicated maker wallet. It consumes Binance mini-ticker prices and refreshes a simple 2-sided quote set on every market.
MM_PRIVATE_KEY=0xyourmakerprivatekey
MM_WALLET_ADDRESS=0xyourmakeraddress
APP_URL=http://localhost:3000
node server/basic-maker.js