Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rivermarkets.com/llms.txt

Use this file to discover all available pages before exploring further.

1. Create an Account

Sign up at app.rivermarkets.com to create your account.

2. Generate an API Key

  1. Log in to your dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Copy the key_id and private_key — the private key is shown only once
The private key signs every request locally (Ed25519). The server only stores the public key, so it never sees your secret.

3. Install the SDK

pip install rivermarkets
The SDK handles request signing for you. If you’d rather implement signing yourself (other languages, raw HTTP), see Authentication for the canonical-string spec.

4. Make Your First Request

Test your credentials by searching for markets. We support ticker search (Kalshi ticker, Polymarket condition_id/slug, river_id) and fuzzy search (“bitcoin”, “fed rates”).
from datetime import date
from rivermarkets import RiverMarkets

client = RiverMarkets(
    key_id="<uuid from Settings → API Keys>",
    private_key="<base64 private key shown once at creation>",
)

# Search for shutdown related markets on Kalshi.
# Filter to active markets that haven't expired yet so the results are tradeable —
# apply both `status=active` and `expiration_date_start` (today's date) for any exchange.
results = client.markets.search_markets(
    q="shutdown",
    exchange_name="KALSHI",
    expiration_date_start=date.today().isoformat(),
    status="active",
)
for market in results.results:
    print(f"River ID: {market.river_id}, Ticker: {market.ticker}")

5. Set Up a Subaccount

Subaccounts let you organize trading activity into separate containers — useful for segregating strategies, clients, or portfolios. You can create them via the UI at Settings → Subaccounts or programmatically:
subaccount = client.subaccounts.create_subaccount(name="My Trading Account")
subaccount_id = subaccount.subaccount_id
Watch the video walkthrough to see how to create a subaccount, add a Polymarket account, and place your first trade.

6. Add Exchange Credentials

Exchange credentials can be added via the UI under Settings → Subaccounts
We use asymmetric encryption — your credentials are never transferred between services or stored in plain text. Credentials are deleted when you delete a subaccount.
Watch this walkthrough to see how to create a subaccount, add a Polymarket account.

7. Place Your First Order

Use the River ID from your market search to place an order:
order = client.orders.create_order(
    subaccount_id=subaccount_id,
    river_id=4552150,       # From market search
    order_type="LIMIT",      # LIMIT or MARKET
    time_in_force="GTC",     # FOK, GTC, GTD, or IOC
    buy_flag=True,           # True=buy, False=sell
    price=0.50,              # Limit price (0-1)
    qty=10,                  # Number of contracts
)
print(f"Order placed: {order.river_order_id}")

8. Check Order Status

order_status = client.orders.get_order(order_id=order.river_order_id)
print(f"Status: {order_status.status}, Filled: {order_status.traded_qty}/{order_status.qty}")
Possible statuses:
StatusDescription
pending_submissionOrder received, awaiting processing
submittedOrder sent to exchange
partially_filledOrder partially executed
filledOrder fully executed
cancelledOrder cancelled
rejectedOrder rejected (see reject_reason)

9. Cancel an Order

result = client.orders.cancel_order(order_id=order.river_order_id)
print(result)
Only orders with status submitted or partially_filled can be cancelled.

Rate Limits

  • Standard: 100 requests/minute
  • Premium: Contact support for higher limits