Build a Bet Settlement Engine with Automatic Market Resolution
FieldFunded’s market resolution API settles bets automatically — poll resolved markets, match by ID, pay out winners. No manual checking, no missed results. This guide builds a production-ready settlement engine in under 100 lines of TypeScript.What You’ll Use
| SDK Method | Endpoint | Purpose |
|---|---|---|
getSettlements() | GET /v1/settlements | Poll for resolved markets |
getEventResult() | GET /v1/events/{id}/result | Get final score |
checkBet() | POST /v1/bets/check | Verify individual bet outcome |
checkParlay() | POST /v1/bets/check-parlay | Verify parlay/accumulator outcome |
Architecture
Step 1: Set Up the SDK
Step 2: Poll for Settlements
FieldFunded’s settlement is gradual. Simple markets (1x2, Winner) resolve within 2-5 minutes of game end. Complex markets (player props, correct score) take 10-30 minutes.Step 3: Match Bets Against Resolved Markets
The key is matching bymarket_id and selection_id — these are unique identifiers that guarantee you’re resolving the correct bet.
Step 4: Resolve and Pay
Step 5: Handle Parlays
For parlays, usecheckParlay(). The API handles void legs automatically (void leg = odds 1.0, recalculates combined odds).
Step 6: Edge Cases
Postponed Games
FieldFunded follows the 48-hour rule: if a game is postponed but resumes within 48 hours, bets remain active. After 48 hours, all markets are refunded.Cancelled / Walkover
Immediate refund. ThegetEventResult() endpoint returns status: 'walkover' or status: 'cancelled'.
Timeout Protection
If some markets haven’t resolved after 30 minutes, they auto-refund. Your settlement loop simply picks up the refund status on the next poll.Step 7: Run the Loop
Production Checklist
- Use
market_id+selection_idfor matching (not market names) - Make resolution idempotent (re-processing won’t double-pay)
- Log every resolution for audit trail
- Handle SDK errors (RateLimitError, ServiceUnavailableError)
- Set up alerts if settlement polling stops
Settlement API Reference
See full endpoint documentation →
Related Guides
- Build a Betting Platform — full-stack architecture that uses this engine
- Build a Parlay Calculator — validate parlays with real odds
- FieldFunded vs Sportradar — why auto settlement is our biggest edge
Get Your Free API Key
Start building in 5 minutes — 10,000 free requests/month
See Pricing
All plans compared side by side
