trading_fee
Calculate the venue fee for a single fill at a given price and contract size on Kalshi or Polymarket, including maker/taker schedules, without network calls.
Instructions
Compute the venue fee for one fill at a given price and size; a pure calculation with no network calls.
Kalshi charges round_up(0.07 x M x C x P x (1 - P)) on taker fills, and
0.0175 x M x C x P x (1 - P) on maker fills where the series has maker fees;
Polymarket charges takers rate x C x p x (1 - p) and makers nothing. Use it
to price a single leg or a hypothetical fill; take a live market's fee terms
from get_quote, and use check_constraint to price a whole basket. Returns
fee, fee_per_contract, order_type and the schedule used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maker | No | Price a resting maker order instead of a taker order (default false). | |
| price | Yes | Fill price in dollars per contract, strictly between 0 and 1. | |
| venue | Yes | Venue: 'kalshi' or 'polymarket'. | |
| contracts | Yes | Contracts in the fill; must be positive. | |
| polymarket_rate | No | Polymarket taker fee rate for the market, from get_quote. Defaults to 0.07, the highest documented rate. Ignored for Kalshi. | |
| kalshi_maker_fees | No | Whether the Kalshi series charges maker fees, from get_quote (default false). Ignored for Polymarket. | |
| kalshi_multiplier | No | Kalshi series fee multiplier M, from get_quote's fee_schedule (default 1). Ignored for Polymarket. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||