Daejin Developers

Overview

The three Daejin prediction-market APIs, and where each one lives.

Daejin exposes two HTTP surfaces. They share one credential model — an API key from this portal, or the app's own session — described in Authentication.

SurfaceWhat it is forBase URL (this environment)
CLOB Market Maker APIThe matching engine: live books, depth, trades, placing and cancelling signed limit orders, and the real-time WebSocket feed.https://app-staging.daejin.xyz/clob/v1
Settlement Bridge APIMarket orders against the AMM, quotes, and Solana transaction builders. Every POST here makes the bridge spend gas.https://app-staging.daejin.xyz/clob-engine

Staging mirrors production at app-staging.tokenplay.ai — with one trap: on staging /clob is the engine and /clob-engine is the bridge, while on production /clob-engine is the engine and /clob-bridge is the bridge. Read the base URL from your environment; never hardcode a path.

Amounts are decimal strings when they may exceed JavaScript's safe integer range. Prices are integer ticks: 1000 = $1.00.

Start here

  1. Sign in on the API keys page with the wallet that will own your keys and create one with the scopes you need.
  2. Read Authentication for headers, rate limits and the migration timeline.
  3. GET /markets on the engine tells you what is live and the exact market label every other call takes.
  4. Orders are signed by your own wallet — EIP-712 on EVM, ed25519 over a canonical string on Solana. The API never holds a key of yours; see the operation pages under API Reference for the exact payloads.
  5. Subscribe to the WebSocket feed instead of polling.

Which surface for what

The matching engine holds resting limit orders. The settlement bridge handles market orders, chain preparation and Solana transaction builders.

NeedUseImportant detail
Read the book, place/cancel limit ordersEngineAPI and UI use the same book when the market label is the same.
Market orders and funding helpersBridgeMarket orders fill against the AMM and never rest in the engine book.
EVM integrationexamples/market-maker/mm-client.mjs in prediction-backendOrders use EIP-712. Market label is evm:<chainId>:<clobMarketId>.
Solana integrationexamples/market-maker/solana-mm-client.mjsOrders use base58 ed25519 over a canonical string. Market label is the plain numeric CLOB market id.
Deposit, withdraw, claim, LP actionsWallet-signed chain transactionSolana uses the bridge's /tx/* builders. EVM calls ClobExchange directly or via mm-client.mjs.

First-time test order: GET /markets, inspect /book, generate a fresh signature, then POST /orders. A copied old signature will be rejected.

Market maker API list

MethodEndpointUseAuth / Signature
GET/marketsList live CLOB books known to this engine.None
GET/markets/{market}Summary: best bid/ask levels, open orders, session volume.None
GET/markets/{market}/tickerCurrent top-of-book price/spread/session stats.None
GET/markets/{market}/bookAggregated order book depth.None
GET/markets/{market}/ordersAll current resting limit orders.None; the ?user= filter needs read and is owner-only
GET/markets/{market}/tradesRecent matched fills observed by this engine.None
GET/users/{user}/orders?market={market}One wallet's current resting orders.read, owner-only
GET/users/{user}/orders/closed?market={market}One wallet's cancelled, expired, or rejected orders.read, owner-only
GET/orders/{orderId}Status for one order id.read
POST/ordersPlace a limit/market-maker order.write, plus the order signature — EVM: EIP-712; Solana: ed25519 over the canonical string
DELETE/orders/{orderId}Cancel a resting order.write, plus a wallet-signed cancel message

Every endpoint above is on the engine. The API key identifies the caller; the wallet signature is what authorises a trade, and the API never creates one for you. Market orders are not here: they fill against the AMM through the settlement bridge, see Market Order. Money movement is chain-specific: Solana uses the bridge's /tx/* transaction builders, while EVM users send ClobExchange contract transactions from their own wallet/RPC or with mm-client.mjs.

Close, settlement and resolve endpoints are operator-only and are not issued to market makers.

Suggested test flow

StepActionExpected result
1GET /markets.You have the correct engine market label. Do not use the app/Mongo market id in /orders.
2GET …/book, …/orders, …/ticker.You see current book depth, resting orders, and current top-of-book stats.
3Fund the wallet on chain, then place a signed limit order.The order is accepted only if the signature matches the exact payload.
4GET /orders/{orderId}.You see the exact order status: open, partial, filled, cancelled, or expired.
5Cancel from the UI, or use signed DELETE /orders/{orderId}.The order disappears from book/orders. No explorer tx is expected for an engine cancel.
6Check /users/{user}/orders/closed.Cancelled, expired, or rejected orders are visible separately from the live book.
7Withdraw idle balance from the exchange.The wallet receives tokens and this withdrawal appears on the explorer.
8Use a second wallet to cross the book with a taker order.Book size changes and app trade history records the fill. If settlement fails, the engine rolls the fill back.

The same flow on Solana, as paste-able commands with the arithmetic to check against, is the Solana walkthrough.

On this page