import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
order_book = pmxt.OrderBook(
bids=[pmxt.OrderLevel(price=0.52, size=100)],
asks=[pmxt.OrderLevel(price=0.54, size=100)],
)
result = exchange.get_execution_price(order_book, "buy", 10){
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": 123
}Order Book & Trades
Get Execution Price
Calculate the volume-weighted average execution price for a given order size. Returns 0 if the order cannot be fully filled.
POST
/
api
/
{exchange}
/
getExecutionPrice
import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
order_book = pmxt.OrderBook(
bids=[pmxt.OrderLevel(price=0.52, size=100)],
asks=[pmxt.OrderLevel(price=0.54, size=100)],
)
result = exchange.get_execution_price(order_book, "buy", 10){
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": 123
}Path Parameters
The prediction market exchange to target.
Available options:
polymarket, kalshi, kalshi-demo, limitless, probable, baozi, myriad, opinion, metaculus, smarkets, polymarket_us, gemini-titan, hyperliquid, suibets, rain, hunch, router Body
application/json
Response
200 - application/json
Get Execution Price response
Was this page helpful?

