Expand description
Parsing functions for Polymarket execution reports.
Structs§
- Market
Price Result - Result of walking the order book to compute market order parameters.
Functions§
- adjust_
market_ buy_ amount - Adjusts a market-BUY pUSD amount to fit within the user’s pUSD balance once
platform and builder taker fees are deducted. Mirrors
adjust_market_buy_amountinpolymarket-rs-clob-client-v2’sclob/utilities.rs. - build_
maker_ fill_ report - Builds a [
FillReport] from aPolymarketMakerOrderand trade-level context. - calculate_
market_ price - Calculates the market-crossing price and expected base quantity by walking the order book.
- compute_
commission - Computes a pUSD commission using Polymarket’s fee formula.
- determine_
order_ side - Determines the order side for a fill based on trader role and asset matching.
- instrument_
fee_ exponent - Returns the fee-schedule exponent for a Polymarket instrument. Polymarket
stores
feeSchedule.exponentin the instrument’sinfomap at parse time. Defaults to1.0when missing so the fee curve degenerates to the simplefee = C * rate * p * (1 - p)form used bycompute_commission. - instrument_
taker_ fee - Returns the effective taker fee rate for a Polymarket instrument.
- make_
composite_ trade_ id - Creates a composite trade ID bounded to 36 characters.
- parse_
balance_ allowance - Converts a raw micro-pUSD balance from the Polymarket API into an [
AccountBalance]. - parse_
fill_ report - Parses a
PolymarketTradeReportinto a [FillReport]. - parse_
liquidity_ side - Converts a
PolymarketLiquiditySideto a Nautilus [LiquiditySide]. - parse_
order_ status_ report - Parses a
PolymarketOpenOrderinto an [OrderStatusReport]. - parse_
timestamp - Parses a timestamp string into [
UnixNanos]. - resolve_
order_ status - Resolves the Nautilus order status from Polymarket status and event type.