Skip to main content

1. Connect wallet and register

Go to patly.duckdns.org, connect your MetaMask wallet, and create an account. You’ll receive an API key — save it. Or via curl:
curl -X POST http://patly.duckdns.org/register \
  -H "Content-Type: application/json" \
  -d '{"wallet": "0xYOUR_POLYMARKET_WALLET"}'
{
  "api_key": "vRkrRS5q...",
  "wallet":  "0x...",
  "message": "Save your API key — it won't be shown again."
}

2. Install the library

pip install patly

3. Add to your bot

import patly, os

# Add once at startup
patly.init(
    api_key=os.getenv("PATLY_API_KEY"),
    pk=os.getenv("PK"),
)

# Replace your existing redeem call — no other changes:
patly.redeem(position["slug"], side)

4. Add to .env

PATLY_API_KEY=your_api_key_here
# PK is already in your .env from your trading bot
That’s it. Patly handles everything else — signing, payment, relaying.
Your private key is used only for local cryptographic signing. It is never transmitted to Patly or any third party. Only the resulting signature is sent. This is identical to how MetaMask works.

Direct usage (without bot integration)

from patly import Patly

p = Patly(api_key="your_key", pk="your_pk")

# Redeem a specific position
result = p.redeem("btc-updown-15m-1234567890", "YES")
print(result["tx_hash"])

# Check status
print(p.status())

# View history
for r in p.history():
    print(r["slug"], r["status"])