Claiming Winnings

Guide for claiming winnings from resolved prediction markets using the Python SDK. All claiming operations are gasless — no native tokens required.

Prerequisites

You need a Level 2 client (private key + API credentials):

import os
from dotenv import load_dotenv
from turbine_client import TurbineClient

load_dotenv()

client = TurbineClient(
    host=os.environ["TURBINE_HOST"],
    chain_id=int(os.environ.get("CHAIN_ID", "137")),
    private_key=os.environ["TURBINE_PRIVATE_KEY"],
    api_key_id=os.environ["TURBINE_API_KEY_ID"],
    api_private_key=os.environ["TURBINE_API_PRIVATE_KEY"],
)

How Claiming Works

1

Market resolution

When a market resolves, the winning outcome (YES or NO) is determined by the UMA oracle.

2

Redeem winning tokens

Holders of the winning token can redeem each token for $1 USDC. Losing tokens become worthless.

3

Gasless claim via SDK

The SDK signs an EIP-712 RedeemPositions permit and submits it to the relayer. No native gas is needed.

Check Resolution Status

Before claiming, verify the market is resolved:

Claim from a Single Market

claim_winnings() takes the market's contract address (not the market ID). You can find it from the Market object:

The method performs these steps internally:

1

Query on-chain state

Queries the market contract on-chain for resolution status and condition data.

2

Check balances

Checks your balance of the winning token.

3

Sign permit

Signs an EIP-712 RedeemPositions permit.

4

Submit to relayer

Submits to the relayer for gasless execution.

It raises ValueError if:

  • The market is not resolved yet

  • You hold no winning tokens

Batch Claim from Multiple Markets

Claim winnings from several resolved markets in a single batch transaction:

Markets that are not resolved or where you have no winning tokens are skipped automatically. The method only raises ValueError if none of the markets have claimable winnings.

Find Markets with Claimable Winnings

Scan your positions for resolved markets you can claim from:

Monitor Claim Status

After submitting a claim, track its progress:

CLAIM_ONLY_MODE

The reference bot (examples/price_action_bot.py) supports a claim-only mode that disables trading and only claims winnings from previously traded markets:

This is useful when you want to:

  • Claim winnings without placing new orders

  • Clean up positions from a previous trading session

  • Run a background process that periodically claims resolved markets

Complete Example

A standalone script that discovers and claims all available winnings:

Last updated