Skip to main content

determine_order_side

Function determine_order_side 

Source
pub fn determine_order_side(
    trader_side: PolymarketLiquiditySide,
    trade_side: PolymarketOrderSide,
    taker_asset_id: &str,
    maker_asset_id: &str,
) -> OrderSide
Expand description

Determines the order side for a fill based on trader role and asset matching.

Polymarket uses a unified order book where complementary tokens (YES/NO) can match across assets. A BUY YES can match with a BUY NO (cross-asset), not just SELL YES (same-asset). For takers, the trade side is used directly. For makers, the side depends on whether the match is cross-asset or same-asset.