Authentication

Platform-specific authentication flows for Polymarket and Kalshi.


Polymarket Authentication

API Key Derivation

Polymarket uses wallet-based authentication:

// 1. Derive API key from wallet
POST https://clob.polymarket.com/auth/derive-api-key
Body: {
  address: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  nonce: 1
}

Response: {
  apiKey: "...",
  secret: "...",
  passphrase: "..."
}

Request Signing

Every trading request must be signed:

MoltMarket handles this automatically.


Kalshi Authentication

Token-Based Auth

Auto-Refresh

Tokens expire every 30 minutes. MoltMarket auto-refreshes.


Security Best Practices

  1. Never commit API keys - Use environment variables

  2. Rotate keys quarterly - Generate new keys every 90 days

  3. Use separate keys for testing - Demo vs production

  4. Monitor API key usage - Check for unauthorized access


Last updated