market_id, side, quantity, price,
time_in_force and request_id), and Splash computes the fee itself from your fee settings. This page gives the
formula Splash uses, so the number you compute is the number Splash takes.
Before you send an order
- Read your account with
GET /account:feeis your fee settings andmax_tradeis the maximum trade. Both change rarely, so read them at start-up rather than before every order. - Read your balance with
GET /balance:cash_availableis the cash you can spend now. - Compute the order’s cost: the contracts cost, the fee and the debit, as below.
- Check both limits: the debit must be at most
cash_available, and the contracts cost at mostmax_trade. - Send the raw order to
POST /trading/ordersand follow it as in Placing an order.
max_trade is refused at once with
400 Order exceeds the maximum trade of $<limit>, and its request_id is spent. An order whose debit is more than your
cash is accepted (200 with order_status: "pending") and then ends cancelled without filling, so you only learn about
it by polling. Checking first saves you both.
The fee
fee on GET /account looks like this:
theta × quantity × price × (1 − price)
The fee is largest at a price of $0.50 and shrinks toward $0.01 and $0.99. The formula gives the same number for price
and 1 − price, so it is the same whichever side you trade, and on a buy or a close.
- Rounding. Multiply in that order, rounding each product to 6 decimal places, half up:
theta×quantity, then ×price, then × (1 −price). Round the result to the cent half to even (banker’s rounding): $0.105 becomes $0.10 and $0.035 becomes $0.04. Every other amount on this page rounds half up; this is the one step that does not. - Example. 10 contracts at $0.59, theta 0.07: 0.07 × 10 × 0.59 × 0.41 = $0.16933, so the fee is $0.17.
theta from your own account rather than copying 0.07 from these examples.
What a buy costs
A buy opens contracts, or adds to the ones you hold on the same side.- Contracts cost =
quantity×price, exactly.priceis the price you send, in the terms ofside: anoorder is priced in NO terms. A sub-cent price such as0.655is used as sent. - Fee: as above.
- Debit = contracts cost + fee, rounded to the cent, half up. The fee is always a whole number of cents, so this rounds only the contracts cost: 13 contracts at $0.655 cost $8.515, and with a fee of $0.29 the debit is $8.805, rounded to $8.81.
max_trade: the fee is not counted. With a
max_trade of 100000, 169500 contracts at $0.59 cost $100,005.00 and are refused, whatever the fee; 169491 contracts
cost $99,999.69 and are allowed.
What a close costs
A close sells the contracts you hold: an order on the other side for exactly the number you hold (seeside on
Place an order). Its price is in the terms of the side you send, so
to sell 10 YES contracts at $0.66 you send side: "no", price: 0.34.
- Nothing is debited, so a close needs no cash and is never limited by
max_trade. - When it fills, you are credited the proceeds less the fee:
quantity× (1 −price) − fee, rounded to the cent, half up. The fee is computed at the fill price, so at your limit price this is the least you receive, give or take a cent of fee.
Rounding at a glance
Use decimal arithmetic, not binary floating point: in a float, 0.655 × 1000 is not exactly 655, and a half-cent tie can
round the wrong way. The calculator below uses Python’s
decimal, and integer micro-dollars in TypeScript (bigint) and
Go (int64).
Check your implementation
Run your code on these orders and compare to the cent. Each came from Splash’s own fee code.
The second row is a half-to-even tie: 0.07 × 6 × 0.5 × 0.5 = $0.105, which rounds to $0.10, not $0.11. The fifth row
rounds the debit half up: $8.515 + $0.29 = $8.805, debited as $8.81. The last row sells 10 YES contracts at $0.66,
filled at that price.
A cost calculator
order_cost / orderCost / OrderCost takes the fee object from GET /account as it arrives, the order’s price
and quantity, and whether the order closes a position you hold. It returns the contracts cost, the fee, the debit and,
for a close, the credit. can_afford / canAfford / CanAfford checks the debit against cash_available and the
contracts cost against max_trade. The Python and TypeScript tabs then read the two values and place the order, reusing
the request helpers from the signed-order example; the Go
tab is a complete program with the values filled in by hand.

