binance
binance prediction-market exchange — CCXT unified API: methods, parameters and endpoints.
binance
Kind: global class
Extends: Exchange
- fetchMarkets
- fetchEvents
- fetchEvent
- fetchTicker
- fetchTickers
- fetchOrderBook
- fetchBalance
- fetchOpenOrders
- fetchOrders
- fetchPositions
- fetchPosition
- fetchMyTrades
- fetchWallet
- fetchQuote
- createOrder
- createMarketOrderWithCost
- cancelOrder
- cancelOrders
binance
Binance Web3 Wallet prediction trading. Binance aggregates prediction markets from on-chain vendors (predict.fun on BNB Chain) behind its standard signed SAPI — every endpoint, including market data, requires apiKey/secret credentials
binance.binance ()fetchMarkets
fetches binance prediction markets; with a query it resolves the query via the search endpoint and returns the matched topics' markets, otherwise it pages the market listing
Kind: instance method of binance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.query | string | No | a single search query resolved against the market search endpoint |
| params.queries | Array<string> | No | multiple search queries (alternative to query) |
| params.l1Category | string | No | filter the listing by a level-1 category id (see the category/list endpoint) |
| params.l2Category | string | No | filter the listing by a level-2 category id |
| params.limit | int | No | for an unscoped listing (no query), the max number of topics to collect (defaults to options.maxFetchMarketsLimit, 200) |
binance.fetchMarkets (params?)fetchEvents
fetches prediction-market events (market topics); the call must be scoped by query/queries/tags, eventId, or an l1Category/l2Category listing filter
Kind: instance method of binance
Returns: Array<object> - a list of prediction event structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.query | string | No | a free-text search resolved against the semantic market search endpoint |
| params.queries | Array<string> | No | multiple free-text searches (alternative to query) |
| params.tags | Array<string> | No | treated as additional free-text searches (binance has no tag taxonomy) |
| params.eventId | string | No | a marketTopicId, fetched directly via the detail endpoint |
| params.l1Category | string | No | scope the listing server-side by a level-1 category id |
| params.l2Category | string | No | scope the listing server-side by a level-2 category id |
| params.limit | int | No | the maximum number of events to return |
| params.sort | string | No | 'volume' |
| params.status | string | No | 'active' |
| params.sortBy | string | No | sort events by server side ('RECOMMENDED' |
| params.orderBy | string | No | order events by server side ('ASC' |
binance.fetchEvents (params?)fetchEvent
fetches a single prediction-market event (market topic) by its marketTopicId
Kind: instance method of binance
Returns: object - a prediction event structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the marketTopicId |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchEvent (id, params?)fetchTicker
fetches the last trade price for a single prediction outcome
Kind: instance method of binance
Returns: object - a prediction ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome handle like BTC_PRICE_1H_UP_DOWN_UP:YES, or an outcome token id |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchTicker (outcome, params?)fetchTickers
fetches last trade prices for multiple outcomes, one request per distinct underlying market
Kind: instance method of binance
Returns: object - a dictionary of prediction ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcomes | Array<string> | Yes | unified outcomes — required: the venue has no all-tickers endpoint |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchTickers (outcomes, params?)fetchOrderBook
fetches the order book for a single prediction outcome token
Kind: instance method of binance
Returns: object - a prediction order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome handle, or an outcome token id |
| limit | int | No | not used by binance fetchOrderBook |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchOrderBook (outcome, limit?, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of binance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'CeDefi', 'FUNDING', or 'SPOT' |
binance.fetchBalance (params?)fetchOpenOrders
fetches currently open orders for the user
Kind: instance method of binance
Returns: Array<object> - a list of prediction order structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | filter by outcome |
| since | int | No | only return orders updated since this timestamp in ms |
| limit | int | No | max number of orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.tradeSide | string | No | Filter by trade side. Enum: BUY, SELL |
| params.l1Category | string | No | Filter by level-1 category |
| params.paginate | boolean | No | spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchOpenOrders (outcome?, since?, limit?, params?)fetchOrders
fetches all historical orders for the user
Kind: instance method of binance
Returns: Array<object> - a list of prediction order structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | filter by outcome |
| since | int | No | only return orders updated since this timestamp in ms |
| limit | int | No | max number of orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.orderType | string | No | Filter by order type. Enum: MARKET, LIMIT |
| params.l1Category | string | No | Filter by level-1 category |
| params.status | string | No | Filter by order status |
| params.until | string | No | end timestamp in ms |
| params.paginate | boolean | No | spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchOrders (outcome?, since?, limit?, params?)fetchPositions
fetches the user's outcome positions; outcome positions are spot token balances under the "+
Kind: instance method of binance
Returns: Array<object> - a list of prediction position structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcomes | Array<string> | No | filter by outcome ids or outcomes |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.tab | string | No | Position status tab. Values from PositionQueryType. Default ONGOING |
binance.fetchPositions (outcomes?, params?)fetchPosition
fetch data on an open position
Kind: instance method of binance
Returns: Array<object> - a list of prediction position structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | filter by outcome |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchPosition (outcome?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of binance
Returns: Array<object> - a list of prediction order structures
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | No | filter by outcome |
| since | int | No | only return orders updated since this timestamp in ms |
| limit | int | No | max number of orders to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.orderType | string | No | Filter by order type. Enum: MARKET, LIMIT |
| params.l1Category | string | No | Filter by level-1 category |
| params.status | string | No | Filter by order status |
| params.until | string | No | end timestamp in ms |
| params.paginate | boolean | No | spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchMyTrades (outcome?, since?, limit?, params?)fetchWallet
fetch wallet for user and save the one match the walletAddress user provided
Kind: instance method of binance
Returns: object - a wallet
| Param | Type | Required | Description |
|---|---|---|---|
| methodName | string | No | method name |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.fetchWallet (methodName?, params?)fetchQuote
request for quote from binance server
Kind: instance method of binance
Returns: object - a quote
| Param | Type | Required | Description |
|---|---|---|---|
| request | object | No | request to the exchange API endpoint |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.chainId | string | No | Chain ID. Default 56 (BSC) |
| params.feeRateBps | integer | No | Fee rate in basis points. Default 200, range 1–10000 |
| params.fundingSource | string | No | Funding source. Enum: MPC, CEX. Default MPC |
| params.fundTransferAmount | string | No | Auto-transfer amount before order (wei). Must be > 0 if provided |
binance.fetchQuote (request?, params?)createOrder
creates a limit or market order for an outcome market
Kind: instance method of binance
Returns: object - a prediction order structure
| Param | Type | Required | Description |
|---|---|---|---|
| outcome | string | Yes | unified outcome |
| type | string | Yes | 'limit' or 'market' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | quantity of outcome tokens |
| price | float | No | limit price (0–1 range for prediction markets) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.timeInForce | string | No | Must match orderType: FOK for MARKET, GTC for LIMIT |
| params.slippage | string | No | slippage for market orders (default 5%) |
| params.fundingSource | string | No | Funding source. Enum: MPC, CEX. Default MPC |
| params.fundTransferAmount | string | No | Auto-transfer amount before order (wei). Must be > 0 if provided |
| params.accountType | string | No | Payment account type. Enum: SPOT, FUNDING |
| params.feeRateBps | string | No | Payment account type. Enum: SPOT, FUNDING |
| params.cost | string | No | Buy prediction market with USDT cost, only for buy side |
binance.createOrder (outcome, type, side, amount, price?, params?)createMarketOrderWithCost
create a market order by providing the symbol, side and cost
Kind: instance method of binance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| side | string | Yes | 'buy' or 'sell' |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.createMarketOrderWithCost (symbol, side, cost, params?)cancelOrder
cancels a single open order
Kind: instance method of binance
Returns: object - a prediction order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| outcome | string | No | unified outcome |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.cancelOrder (id, outcome?, params?)cancelOrders
cancels multiple open orders
Kind: instance method of binance
Returns: Array<object> - a list of prediction order structures
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| outcome | string | No | unified outcome (required) |
| params | object | No | extra parameters specific to the exchange API endpoint |
binance.cancelOrders (ids, outcome?, params?)