The money contract
You own your customers’ cash ledger. Parity never holds a player’s funds. It returns the exact amounts to reserve, debit, release and credit against your own books.
Who holds what
| Step | Who does it | From which field |
|---|---|---|
| Reserve the stake | You | operatorMoney.authorizationAmount on the quote |
| Debit what actually filled | You | operatorMoney.actualDebit on the order |
| Hand back what did not | You | operatorMoney.releaseAmount on the order |
| Charge the platform fee | Parity | Already inside the debit: platformFee |
| Credit an exit | You | operatorExitMoney.sellProceeds |
| Credit a winner | You | operatorMoney.settlementCredit |
| Credit a void (a refund, or a split payout) | You | operatorMoney.voidCredit |
Swipe the table sideways for more columns.
Apply these amounts as given
If you multiply a price by a quantity to work out a debit, your figure and ours can differ. They usually agree, then drift by a cent on a position built from several fills, and neither side can tell which is right.
The two identities
authorizationAmount = actualDebit + releaseAmount
actualDebit = tradeAmount + platformFee + operatorFee + venueFeeThese are equalities, not tolerances. Every figure is an exact integer of minor units on our side: actualDebit is the sum of its parts and releaseAmount is a subtraction. No combination of prices makes them drift. If a response breaks one, do not book it: stop posting for that order, keep the raw response with its parity-request-id, and send both to Parity support.
operatorFee is your own fee, where your terms set one: it comes off the stake beside the platform fee, the player pays it, and you keep it, less any share your terms give your aggregator or Parity. It is "0.00" when your terms set none, and on a partial fill it is the part the fill earned.
Why the release exists
Parity takes its fee off the top of the stake instead of adding it on: a $50 stake at 120bps wagers $49.40. The cash the player commits is exactly what you authorize, and a fully filled order releases nothing except the unused part of a live buy's venue fee reservation (below).
The release matters on a partial fill. The venue takes less cash than the stake covered, tradeAmount is the notional actually spent, and you must hand back the difference. An operator that always debits the full stake keeps it without noticing.
{
"currency": "USD",
"authorizationAmount": "25.00", // you reserved this
"actualDebit": "12.30", // take this
"releaseAmount": "12.70", // give this back
"tradeAmount": "12.00",
"platformFee": "0.30",
"operatorFee": "0.00",
"venueFee": "0.00",
"venueFeeKnown": false
}An operator that debits "25.00" here keeps $12.70 of the customer's money. Its own books still balance and no later response mentions it, so nothing flags the mistake.
Test a partial fill in the sandbox
The simulated venue never runs out of book, so a partial fill only happens when you arm one with POST /api/v1/sandbox/scenarios. Put an order through it and check that your wallet released the remainder. See Sandbox.
venueFeeKnown: false means the zero is a placeholder: the execution fee is not priced into that quote (as on a sandbox account). The quote stores null rather than 0 so “unknown” differs from “none”, and the identity reports it as zero. When the fee is known, venueFeeKnown is true, venueFee is the amount, and the identity holds the same way.
All in: the debit is the stake, every fee inside it
On a live buy the venue charges its taker fee on top of what it is sent, so the quote makes room for that fee inside the stake. The platform fee comes off first, a reservation for the venue fee comes out of the rest, and the remainder, tradeAmount, buys contracts. The customer is never debited more than authorizationAmount. On the quote, venueFee is the reservation. On the order, tradeAmount is what bought contracts, and anything the venue did not charge or use comes back as releaseAmount.
On the order, venueFee is the venue fee charged to the customer, read from the fill with venueFeeKnown: true and capped at the room the authorization has left once the trade is paid for. If the venue charges more, Parity absorbs the excess (taking less platformFee first if needed), so actualDebit never exceeds authorizationAmount and both identities hold. Book the order's figures; do not adjust them from a venue statement.
{
"currency": "USD",
"authorizationAmount": "3.00",
"actualDebit": "3.00",
"releaseAmount": "0.00",
"tradeAmount": "2.83",
"platformFee": "0.03",
"operatorFee": "0.00",
"venueFee": "0.14",
"venueFeeKnown": true
}{
"currency": "USD",
"authorizationAmount": "3.00",
"actualDebit": "2.98",
"releaseAmount": "0.02",
"tradeAmount": "2.83",
"platformFee": "0.03",
"operatorFee": "0.00",
"venueFee": "0.12",
"venueFeeKnown": true
}The reservation assumes a fill at a better price than quoted, where the venue fee per dollar is higher. The venue usually charges less, so a fully filled live buy can release a small amount, as here. The quote's contracts is priced on tradeAmount, so the venue fee does not shorten the fill; filledQuantity on the order is what the player holds and what a win pays on. While a fill's venue fee is being read, the order stays open (settlementState: pending) and the remainder stays held, so the release you apply contains nothing the venue kept.
A live buy must send the market at least $1 after both fees. A smaller one is refused at quote time with 422 invalid_stake. At the standard platform fee, a stake of $1.10 or more clears this on every market.
An exit credits, it never debits
On a sell, operatorMoney is null and operatorExitMoney is populated. The null is deliberate: if an exit carried an authorizationAmount, a wallet applying the contract would debit the player for selling their own position.
{
"action": "sell",
"operatorMoney": null,
"operatorExitMoney": {
"currency": "USD",
"sellProceeds": "12.20", // credit this. ALREADY NET
"platformFee": "0.15",
"venueFee": "0.00",
"venueFeeKnown": false
}
}The fees sit beside the proceeds so you can show what the round trip cost. Do not subtract them again; that charges the player twice. A round trip is two transactions and carries two fees.
The exit has its own identity. Check it if you like, but never derive the credit from it:
sellProceeds = notional - platformFee - venueFeenotional is the gross contract value before fees. The subtraction happens once, on our side, in exact minor units. Credit sellProceeds.
One payout, two names
{ "settlementCredit": "17.15", "voidCredit": "0.00" } // won
{ "settlementCredit": "0.00", "voidCredit": "0.00" } // lost
{ "settlementCredit": "0.00", "voidCredit": "25.00" } // void, annulled: fee included
{ "settlementCredit": "0.00", "voidCredit": "17.15" } // void, split payout: fee keptA settlementCredit is winnings. A voidCredit is what a void pays, and there are two kinds of void. When the market is annulled, it refunds everything the player committed, fee included. When the source splits the payout between both sides (for example fifty cents a contract to each), the trade stood: voidCredit is the split payout for the player's contracts, rounded down to the cent, the platform fee is kept, and realisedPnl on the settlement shows what the split cost. Both report outcome: "void". Winnings and refunds are separate fields because most operators book them differently.
Amounts are exact decimal strings
Every figure in operatorMoney, operatorExitMoney and a settlement is a string. A JSON number cannot hold an exact cent beyond a certain size, and a client that parses 12.30 as a float loses exactness before its ledger sees the figure.
import { toMinorUnits, addDecimal } from './parity-sdk'; // the client Parity provides
toMinorUnits(order.operatorMoney!.actualDebit); // 1230n, exact
addDecimal(debit, release) === authorization; // the identity, in your own codeThe float fields beside them (stake, notional, platformFee, averagePrice, executionPrice) are for display. A price such as 0.71 is a fair approximation; an amount someone is charged must be exact.
What Parity will and will not refuse
- Where you hold the wallet, the funds check is yours. Parity cannot see your customer's balance and does not refuse on it, so decide what a player may stake before you ask for a price. This API has no
insufficient_balancecode;422 insufficient_fundsapplies only where Parity holds the player's wallet, as in the sandbox. - Parity refuses on price and freshness (
price_stale,stake_exceeds_stale_limit,price_unverified), a line that cannot pay (line_not_available), book depth (stake_exceeds_available_depth), the limits you configured (over_wager_limit,over_period_limit,over_order_limit,over_tenant_exposure), a player you suspended (user_suspended), a market you are not offered (market_not_offered), and the operator's own float (insufficient_collateral), your trading pause (trading_paused), the live cash out rules (below_venue_minimum,insufficient_position,sell_not_available), and on a live account the caps agreed for it, per order, per player and overall, which withdraw an order before it is sent. Every code is on Errors. - The safe order of steps: reserve on your side, submit with a
clientOrderIdderived from that reservation, and release on anything but a success. The exception is an unresolved order: keep holding. See Orders.
Currency, units and rounding
- Every stored amount is in US dollars: the ledger, every money block and every settlement.
currencyon each block says so, and it is not configurable per operator. - A display currency changes presentation only. The embed can show stakes in your configured display currency (USD, EUR, GBP, CAD, BRL, USDT, USDC, DAI, BTC, ETH, SOL or ARB). The amount is converted for display, not relabelled, and nothing you book changes.
- Outputs are decimal strings in major units (
"12.30"is twelve dollars thirty). Inputs named...Minorare integers of cents (maxWagerMinor: 5000is fifty dollars). A quote'sstakeis a JSON number in dollars. - Rounding happens once. The stake is rounded to the cent, and the fee, the wager and the figure shown to the customer all derive from it. The fee rounds up to the cent; a quoted payout and a settlement credit round down. Every amount Parity returns is already rounded, so do not round it again.
The sandbox balance, and why it is not this
Sandbox only: 403 sandbox_only in live mode
GET /api/v1/users/{id}/balance and GET /api/v1/users/{id}/ledger return figures derived from Parity's double-entry books, so you can learn the integration with simulated money.
They are not part of the production integration. In live mode they answer 403 sandbox_only, because Parity does not hold your players' funds and a balance from there would describe something other than your books.
The sandbox posts every movement exactly as production does, so the accounting model is still worth reading. See Ledger.
The rest of the money model
- Settlement is the register you credit from, and how to consume it exactly once.
- Reconciliation is the verdict, and the fact stream your own books can be rebuilt from.
- Ledger (sandbox) is the chart of accounts, the movement types and the immutability rules.
- Bridge covers how value reaches the collateral asset, and the custody models.
Custody
Your customers' cash stays in your ledger, under your licence. Parity holds none of it, which is why this page gives instructions rather than a balance: you never move money to Parity and wait for it to come back.
Custody of the collateral asset is agreed in your commercial arrangement, not chosen through the API. What that means is on Bridge.