Wallet Integration
Predictu is designed so that operators keep full control of player wallets. The platform never holds player funds. Instead, every balance operation — debits, credits, refunds, and rollbacks — is routed through secure server-to-server callbacks to the operator’s own wallet system.
How It Works
Every time a player’s balance needs to change — whether from buying shares, selling a position, winning a settled market, or receiving a refund — Predictu sends a signed callback to the operator’s registered endpoint. The operator processes the request against their own wallet system and responds with the updated balance.
Supported Operations
The wallet integration supports every balance operation that occurs during trading and settlement:
- Balance queries — Check a player’s current balance before executing a trade.
- Debits — Deduct funds when a player purchases shares in a prediction market.
- Credits for wins — Add funds when a market resolves in the player’s favor.
- Credits for sells — Add funds when a player sells their position back to the market.
- Refunds — Return the original purchase amount when a market is voided or cancelled.
- Rollbacks — Reverse a debit when a trade fails after the balance was already adjusted.
- Loss notifications — Inform the operator when a market resolves against a player. No funds move, but the event is recorded.
Currency Handling
The wallet integration supports both whole currency units and subunit formats. During onboarding, operators specify their preferred format, and all amounts are automatically converted in both directions. This means operators can receive amounts in whichever format their existing wallet system expects, with no additional development work.
Reliability and Failover
The wallet integration is built for resilience:
- Automatic retries — Network errors and transient failures trigger automatic retries with exponential backoff. The system makes multiple attempts before giving up.
- Idempotency — Every callback includes a unique request identifier. If the same request is received twice (due to retries), the operator can safely ignore the duplicate.
- Rollback guarantees — If a debit succeeds but the subsequent trade recording fails, the system automatically sends a rollback to restore the player’s balance.
- Error escalation — Permanent failures (such as player-not-found or business rule violations) are immediately surfaced to the trading engine, which rejects the trade cleanly.
Integration Benefits
The wallet integration architecture provides several key advantages for operators:
- No fund custody — Predictu never holds or controls player funds. The operator’s existing compliance and custody arrangements remain unchanged.
- Use existing infrastructure — The integration works with any wallet system that can receive HTTP callbacks. No migration required.
- Full transaction visibility — Every callback and its response is logged, providing a complete audit trail for reconciliation.
- Consistent state — The compensating transaction pattern ensures the operator’s wallet is always in sync with Predictu’s internal state, even when errors occur.
