Skip to main content

Quickstart

Get your first signed order submitted in 5 minutes.

Prerequisites

  • Python 3.10+ or Go 1.26.7+
  • An Outpost endpoint (staging or production)
  • An HMAC key pair for feed ingestion (optional for read-only agents)

Install the SDK

Python
pip install poltrading-client
Go
go get github.com/jonah-space/poltrading/sdk

Step 1: Configure Authentication

# Python
from poltrading import OutpostClient

client = OutpostClient(
base_url="https://outpost-staging.poltrading.com",
hmac_key="your-hex-hmac-key", # Optional for read-only
)
// Go
import "github.com/jonah-space/poltrading/sdk"

client := sdk.NewClient(
sdk.WithBaseURL("https://outpost-staging.poltrading.com"),
sdk.WithHMACKey("your-hex-hmac-key"),
)

Step 2: Fetch Markets

markets = client.list_markets()
for market in markets:
print(f"Market: {market['conditionId']}")
markets, err := client.ListMarkets(ctx)
if err != nil {
log.Fatal(err)
}
for _, m := range markets {
fmt.Printf("Market: %s\n", m.ConditionID)
}

Step 3: Get a Quote

quote = client.get_quote("0x0000...0001")
print(f"Price: {quote['price']}")
quote, err := client.GetQuote(ctx, "0x0000...0001")
if err != nil {
log.Fatal(err)
}
fmt.Printf("Price: %s\n", quote.Price)

Step 4: Submit an Order

order = client.submit_order(
market_id="0x0000...0001",
payload=signed_order_bytes, # Your signed order
deadline=int(time.time()) + 300,
)
print(f"Order result: {order}")
result, err := client.SubmitOrder(ctx, &sdk.Order{
MarketID: "0x0000...0001",
Payload: signedOrderBytes,
Deadline: time.Now().Add(5 * time.Minute).Unix(),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Order result: %+v\n", result)

Step 5: Verify Health

health = client.healthz()
print(f"Status: {health['status']}, Backend: {health['backend']}")
health, err := client.Healthz(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status: %s, Backend: %s\n", health.Status, health.Backend)

Next Steps