WebSocket subscription
UsesubscribeAll to listen to every event in real time.
TypeScript
Typed single-event subscriptions
For type-narrowed callbacks, use thesubscribe method or the on* convenience helpers.
TypeScript
Subscription options
TypeScript
Connection.onLogs does not auto-reconnect after a WebSocket drop. For long-lived subscriptions, detect WS disconnection and call sub.unsubscribe() + re-subscribe.Poll-based events
For environments without WebSocket support (some mobile wrappers, serverless functions):TypeScript
Parse from transaction logs
If you already have a transaction’s log array (e.g., fromsendAndConfirmTransaction), parse events directly:
TypeScript
Event reference
MarketCreatedEvent
MarketCreatedEvent
Emitted when a new market is created.
| Field | Type | Description |
|---|---|---|
marketId | bigint | Assigned market ID |
marketType | number | 0 = YesNo, 1 = MultiOutcome |
category | number | Category enum (0-6) |
creator | PublicKey | Creator wallet |
question | string | Market question text |
closeTime | bigint | Unix timestamp when betting closes |
BetPlacedEvent
BetPlacedEvent
Emitted when a bet is placed. The amount and side are still encrypted at this point.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
user | PublicKey | Bettor wallet |
encryptedAmount | Uint8Array | 32-byte ciphertext |
encryptedSide | Uint8Array | 32-byte ciphertext |
nonce | bigint | Encryption nonce (u128) |
entryOdds | bigint | Locked odds × ODDS_SCALE |
MarketResolvedEvent
MarketResolvedEvent
Emitted by the Arcium callback after the MPC reveal circuit runs.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
outcome | number | Winning outcome index |
revealedPool0 | bigint | Revealed plaintext pool for outcome 0 |
revealedPool1 | bigint | Revealed plaintext pool for outcome 1 |
revealedPool2 | bigint | Revealed plaintext pool for outcome 2 (multi) |
revealedPool3 | bigint | Revealed plaintext pool for outcome 3 (multi) |
payoutRatio | bigint | Payout per unit stake × ODDS_SCALE |
MarketCancelledEvent
MarketCancelledEvent
Emitted when a market with zero bets is cancelled.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
creator | PublicKey | Creator wallet |
bondReturned | bigint | Amount returned to creator |
CreatorWithdrawnEvent
CreatorWithdrawnEvent
Emitted when the creator pulls their bond + LP fees.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
creator | PublicKey | Creator wallet |
bond | bigint | Bond amount returned |
lpFees | bigint | LP fees earned |
total | bigint | Total transferred |
PayoutClaimedEvent
PayoutClaimedEvent
Emitted when a winner claims their payout.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
user | PublicKey | Claimant wallet |
payoutAmount | bigint | Amount received in micro-USDC |
RefundClaimedEvent
RefundClaimedEvent
Emitted when a bettor claims a refund from an unresolved market.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
user | PublicKey | Claimant wallet |
refundAmount | bigint | Amount refunded in micro-USDC |
ResolutionFlaggedEvent (v0.2+)
ResolutionFlaggedEvent (v0.2+)
Emitted when anyone flags a pending resolution during the challenge window.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
flaggedBy | PublicKey | Wallet that raised the flag |
MarketFinalizedEvent (v0.2+)
MarketFinalizedEvent (v0.2+)
Emitted when a pending resolution is finalized after the challenge window elapses undisputed.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
outcome | number | Winning outcome index |
payoutRatio | bigint | Final payout ratio × ODDS_SCALE |
ResolutionOverriddenEvent (v0.2+)
ResolutionOverriddenEvent (v0.2+)
Emitted when an admin overrides a disputed resolution.
| Field | Type | Description |
|---|---|---|
market | PublicKey | Market PDA |
oldOutcome | number | Original outcome that was disputed |
newOutcome | number | Corrected outcome |
newPayoutRatio | bigint | Recomputed payout ratio |
admin | PublicKey | Admin wallet that performed the override |