Local order amount calculation and signed order construction.
This module mirrors the current official Python order builder for CLOB exchange orders, but it does not post orders to the API.
Summary
Functions
Builds and signs a limit order without posting it.
Builds and signs a market order without posting it.
Calculates maker/taker amounts for a limit order.
Calculates maker/taker amounts for a market order.
Builds an unsigned order map from already calculated maker/taker amounts.
Types
Functions
@spec build_limit_order( PolymarketClob.Client.t(), String.t(), number(), number(), side(), keyword() ) :: map()
Builds and signs a limit order without posting it.
@spec build_market_order( PolymarketClob.Client.t(), String.t(), number(), number(), side(), keyword() ) :: map()
Builds and signs a market order without posting it.
@spec limit_amounts(side(), number(), number(), String.t()) :: amount_result()
Calculates maker/taker amounts for a limit order.
@spec market_amounts(side(), number(), number(), String.t()) :: amount_result()
Calculates maker/taker amounts for a market order.
The current Python client uses round_down for the market order price.
@spec unsigned_order( PolymarketClob.Client.t(), String.t(), amount_result(), keyword() ) :: map()
Builds an unsigned order map from already calculated maker/taker amounts.