Every service on this page is public. An unauthenticated client can call them.
client, err := polyester.New(polyester.Config{HydrateCatalogs: true})
if err != nil { log.Fatal(err) }
defer client.Close()
if err := client.WaitForCatalogs(ctx); err != nil { log.Fatal(err) }Streams use Messages() on typed subscriptions. Managed order-book / overview books use Updates().
Symbols
Prefer "BTC-USDT". Resolve via catalogs after WaitForCatalogs, or pass symbolID.
Market overview
import "github.com/Fabric-Labs/polyester-sdk-go/services"
overview, err := client.MarketOverview.List(ctx, nil, 50, "", false)
sub, err := client.MarketOverview.CreateSubscription(ctx, services.MarketOverviewCreateSubscriptionOptions{
Limit: 50,
})
for rows := range sub.Updates() { _ = rows; break }Candles
Alias: client.Candles โ client.MarketData.
symbol := "BTC-USDT"
result, err := client.Candles.GetCandles(ctx, &symbol, nil, "1h", 200, nil, nil, false)
sub, err := client.Candles.SubscribeCandles(ctx, &symbol, nil, "1m")
for c := range sub.Messages() { fmt.Println(c.Close); break }Row candle results are newest-first, with an included open candle prepended; use index 0 for
latest and reverse/sort by TsSec for indicators. Candle columns are oldest-first.
Order book
book, err := client.Orderbook.Get(ctx, "BTC-USDT", 20)
sub, err := client.Orderbook.CreateSubscription(ctx, services.CreateSubscriptionOptions{
Symbol: "BTC-USDT",
Depth: 50,
})
for b := range sub.Updates() { fmt.Println(b.BookSeq); break }Public trades
symbol := "BTC-USDT"
tape, err := client.MarketData.GetTrades(ctx, &symbol, nil, 20, nil)
sub, err := client.MarketData.SubscribeTrades(ctx, &symbol, nil)
for t := range sub.Messages() { fmt.Println(t.Price); break }Private fills are client.Trades, not the public tape.
Heatmap & chain analytics
client.Heatmap and client.ChainAnalytics for L2 heatmap and chain analytics reads.
Streaming model
Centrifugo WebSocket + Protobuf. Details: Streaming.
Related
- Order book ยท Candles ยท Public trades ยท Market overview
Related Topics
Authentication Configure Ed25519 API keys, Account ID, and env-based wiring for bots. Trading Place, modify, cancel, and batch spot orders; use triggers with the Go SDK. Streaming Subscribe with Messages() channels, handshake-before-return, and fail-closed overflow. Accounts & balances Funding vs trading balances, holds, subaccounts, policies, and transfer history. Deposits & withdrawals Deposit addresses, trading withdraws, internal transfers, and funding flows. Server-side usage Long-running bots, process lifecycle, catalogs, and configuration tips. Error handling Classify Go SDK errors with errors.As, retry with idempotency keys, handle queue overflow. Production trading operations Operate, test, troubleshoot, and upgrade an automated Go trading system safely.