Settlement
A settlement record is an instruction: this position closed, credit this amount. Parity computes it once, so your system never repeats the arithmetic.
The settlement register
settlements:read.| Parameter | Notes |
|---|---|
externalUserId | Your own id for the customer. An id that has never traded is 404 unknown_user, not an empty page. |
outcome | won, lost or void. |
settledFrom / settledTo | ISO-8601, inclusive. Filters for a report, not a place to resume a poll: resume with cursor. |
limit | Default 100. Above 500 is clamped to 500; zero, negative or not an integer is 400 invalid_limit. |
cursor | Opaque. Echo nextCursor from the previous page. This is how a poller resumes. |
Swipe the table sideways for more columns.
curl -s "$PARITY_BASE/api/v1/settlements?externalUserId=user-4471&outcome=won&limit=100" \
-H "Authorization: Bearer $PARITY_KEY"// GET /api/v1/settlements [Authorization]
import { ParityClient } from './parity-sdk';
const parity = new ParityClient({
baseUrl: process.env.PARITY_BASE!,
apiKey: process.env.PARITY_KEY!,
});
const page = await parity.listSettlements({ externalUserId: 'user-4471', outcome: 'won', limit: 100 });import os
import requests
response = requests.get(
f"{os.environ['PARITY_BASE']}/api/v1/settlements?externalUserId=user-4471&outcome=won&limit=100",
headers={
"Authorization": f"Bearer {os.environ['PARITY_KEY']}",
},
)
print(response.status_code, response.json())using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get,
$"{Environment.GetEnvironmentVariable("PARITY_BASE")}/api/v1/settlements?externalUserId=user-4471&outcome=won&limit=100");
request.Headers.TryAddWithoutValidation("Authorization", $"Bearer {Environment.GetEnvironmentVariable("PARITY_KEY")}");
var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");<?php
$ch = curl_init(getenv('PARITY_BASE') . '/api/v1/settlements?externalUserId=user-4471&outcome=won&limit=100');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PARITY_KEY'),
],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), ' ', $response, PHP_EOL;{
"settlements": [
{
"id": "a41f7d0e-…", // stable. Safe as the idempotency key for a credit.
"positionId": "5e0c2a91-…",
"externalUserId": "user-4471", // YOUR id, never a Parity uuid
"contractId": "ctr_9f31c2…", // the opaque contract this settled against
"side": "YES",
"resolution": "YES", // YES | NO | VOID, as resolved upstream
"outcome": "won", // won | lost | void, for this position
"contracts": 68.6111,
"realisedPnl": 18.61, // THIS settlement's
"lifetimeRealisedPnl": 18.61, // the position's running total
"settledAt": "2026-08-21T18:02:11.004Z",
"operatorMoney": {
"currency": "USD",
"settlementCredit": "68.61", // CREDIT THIS
"voidCredit": "0.00"
},
"cursor": "…"
}
],
"count": 1,
"nextCursor": "…", // NOT null at the tail: an empty page returns the cursor you sent
"hasMore": false // the terminator. Stop on this
}realisedPnl is this settlement’s, not the position’s lifetime
They differ when a position was partly exited before it resolved. Sum realisedPnl for a period; lifetimeRealisedPnl is the position's running total.
Exactly one credit is non-zero
| outcome | settlementCredit | voidCredit |
|---|---|---|
won | $1.00 × contracts, rounded down to the cent, the same rounding as the quoted potentialPayout, so the two agree. | 0.00 |
lost | 0.00 | 0.00. A loss zeroes both, so there is nothing to credit. |
void | 0.00 | An annulled market: everything the player committed, including the platform fee. A split result: the split payout for the player’s contracts, rounded down to the cent, with the fee kept. |
Swipe the table sideways for more columns.
An annulled market refunds the fee as well as the stake. The two fields are separate because a refund and a win are different postings in most operators' books.
An ordinary contract settles at exactly $1.00 or $0.00. The exception is a split result, where the source resolves the contract by dividing the payout between both sides, for example fifty cents a contract to each, or seventy-five and twenty-five. Parity reports it as resolution: "VOID" and outcome: "void", but it is not a refund: the trade stood, each contract pays its side's share of a dollar, voidCredit carries that payout, the platform fee is kept, and realisedPnl is the payout less everything the player committed. Credit voidCredit as the instruction says; do not recompute it from the stake.
A position with a live cash out still being confirmed at the venue waits for that sale to be booked before it settles, so the settlement pays only on the contracts the player still holds.
Combos settle on their own record
Combos are optional and never appear in this register. A combo settles once, as a whole, on its own record and the opt-in combo.settled webhook, which carries the amount to credit with its currency. See Combos (optional).
Every leg must win for a combo to pay. A leg that is voided, or that its market settles at 50 percent, counts as half and halves the payout; any losing leg loses the combo.
Consuming it safely
- Key your credit on the settlement's
id, which is stable, so reprocessing does nothing.positionIdalso works and is what the webhook keys on, so using both never processes a fact twice. - Advance your stored cursor only after the batch is applied. Reading does not consume, so a consumer that crashes mid-batch reads the same page again.
- The register is scoped to your operator in the query itself, so a guessed cursor cannot reach another partner's settlements.
hasMore: falsemeans caught up. Polling about once a minute is enough. A caught-up page with nothing new returns the cursor you sent asnextCursor, so storing it after every poll is safe.- Resume from the stored cursor, never from a time. A settlement is listed once its write has committed, and its
settledAtis stamped before that, so a poll for “settled since my last run” can step past one that committed late and miss it for good. The cursor waits for late writes and cannot. UsesettledFromandsettledToto report on a period.
let cursor = await store.readSettlementCursor(); // undefined on the first run
for await (const s of parity.iterateSettlements({ cursor })) {
// s.operatorMoney.settlementCredit and .voidCredit are exact Decimal strings.
await ledger.creditOnce(s.id, s.externalUserId, s.operatorMoney);
cursor = s.cursor;
await store.writeSettlementCursor(cursor); // only once it is applied
}If you polled with settledFrom: lastRun
Earlier versions of this page showed that loop. Switch to the cursor, and run it once from the beginning (no cursor). Keyed on the settlement id, everything you already credited is skipped and anything the old loop missed is credited once.
The older feed
supersededBy: "/api/v1/settlements".It pages on settledAt, which is not unique, so a page never splits a group of settlements sharing one timestamp. A group larger than limit is delivered whole, so count can exceed limit. Poll with the returned cursor and apply records idempotently on positionId. Its cursor is a time, so it shares the hazard above: a settlement that commits after a later one was served can fall behind it. Use the register above: the same records, with a keyset cursor that waits for late writes.
Every record addresses the contract by contractId
Each record carries contractId, the opaque ctr_… id, the same value GET /api/v1/settlements publishes, and the same one you read on the quote, the order and the position. Correlate on settlementId, positionId and contractId.
Why you cannot be paid twice
Three safeguards, each sufficient on its own:
- The position row is locked inside the settlement transaction, so two concurrent sweeps run one after the other.
- Only a position still marked open is considered.
- The settlement insert carries a unique index on
positionId. If it inserts nothing, no credit is computed, no status is written and no event is emitted.
The third is a database constraint, so it holds even if the others fail.
Voids and amendments
Sources sometimes change a published result. Parity reports the change and does not act on it alone.
| Situation | What Parity does |
|---|---|
| A contract resolves normally | Positions settle against that contract’s own resolution only. A grouped listing elsewhere settles independently and may differ. |
| A contract closes with no published result | It is reported as determined, never guessed. Nothing settles. |
| A resolution changes after positions settled | The contract moves to needs_review, which stops anything further from settling against either value, and a market.resolution_changed event names the affected positions. |
Swipe the table sideways for more columns.
An amendment is a notification, not an instruction
Parity never reverses, adjusts or rewrites a settlement, and nothing claws money back automatically: the source may be fixing a mistake or making one. You receive the list of affected positions and decide.
Proving the period balances
The register answers “what settled”. To check that every money fact of a period agrees (trial balance, cash statement, venue agreement, and the individual findings when it does not), read Reconciliation. Its feed carries position.settled with every fill, fee and collateral movement, ordered and resumable: the stream for a nightly close.
Settlement data is always authenticated
Settlement is published only to the account it belongs to. If you run your own book against Parity's resolutions, read GET /api/v1/settlements, keyset-paginated and scoped to your account. If Parity recorded the positions, use the register above instead of working out who held what yourself.