Skip to main content
POST
/
api
/
v1
/
settlements
/
admin
/
force-check
/
{market_id}
Force Settlement Check
curl --request POST \
  --url https://api.example.com/api/v1/settlements/admin/force-check/{market_id}
{
  "success": true,
  "error": "<string>",
  "status": "<string>",
  "already_settled": true,
  "total_payout": 123,
  "users_credited": 123
}

Usage

result = client.force_settlement_check(market_id="0x1234...abcd")
Use this only when automatic settlement hasn’t triggered. In normal operation, settlements are processed automatically.

Parameters

market_id
string
required
The market ID (condition ID) to check.

When to Use

  • A market has resolved but settlement didn’t trigger automatically
  • WebSocket notification was missed
  • You want to force-check a specific market immediately
This bypasses the normal 5-minute check interval and forces the settlement system to immediately evaluate this market.

Response

success
boolean
Whether settlement was triggered.
error
string
Error message if failed.
status
string
Current settlement status if already in progress.
already_settled
boolean
True if market was already settled.
total_payout
number
Total payout amount (if already settled).
users_credited
integer
Users credited (if already settled).

Example

from polyhush import PolyhushClient

client = PolyhushClient(api_key="your-api-key")

result = client.force_settlement_check(market_id="0x1234...abcd")

if result.get('success'):
    print("✅ Settlement triggered!")
    print("   Check back in a few minutes for completion")
    
elif result.get('already_settled'):
    print("ℹ️ Market already settled")
    print(f"   Total payout: ${result.get('total_payout', 0):.2f}")
    print(f"   Users credited: {result.get('users_credited', 0)}")
    
elif result.get('status'):
    print(f"⏳ Settlement already in progress: {result['status']}")
    
else:
    print(f"❌ Error: {result.get('error')}")

Response (Triggered)

{
  "success": true
}

Response (Already Settled)

{
  "success": false,
  "already_settled": true,
  "total_payout": 50000.00,
  "users_credited": 150
}

Response (In Progress)

{
  "success": false,
  "status": "REDEEMING"
}

Response (Error)

{
  "success": false,
  "error": "Market not yet resolved"
}

Safety

This method is safe to call multiple times. It’s idempotent and won’t double-settle markets that have already been processed.

Debugging Settlement Issues

def debug_settlement(client, market_id):
    """Debug why a settlement isn't working"""
    
    # 1. Check current status
    status = client.get_settlement_status(market_id)
    print(f"Current status: {status['status']}")
    
    if status['settled']:
        print("Market already settled!")
        return
    
    # 2. Check if we have a position
    if not status.get('had_position'):
        print("You don't have a position in this market")
        return
    
    # 3. Try forcing a settlement check
    print("Forcing settlement check...")
    result = client.force_settlement_check(market_id)
    
    if result.get('success'):
        print("Settlement triggered! Waiting...")
        time.sleep(30)
        
        # 4. Re-check status
        new_status = client.get_settlement_status(market_id)
        print(f"New status: {new_status['status']}")
    else:
        print(f"Could not trigger: {result.get('error', result.get('status'))}")