Skip to content

Broker Integration

Headless auth over REST and Selenium, token lifecycle via live probing, order idempotency, per-broker rate limiting, borrow cost modeling, cost budgeting.

Skills
36
Hand off
254
Handed off from
284

Index

All 36 skills in this domain, alphabetically. Hover a row for its situation; open it for the full playbook.

A

alpaca-paper-live-key-separationUse when a bot connects to the Alpaca Trading API and must never cross paper keys with the live endpoint; pins the base URL per environment, checks the key prefix, probes /v2/account and requires an explicit ALLOW_LIVE_TRADING flag.alpaca-apiapi-key-least-privilege-audit-toolUse before deploying a live bot, to audit existing broker API keys for scopes they do not need. Flags withdrawal, transfer and admin rights that turn a leaked execution key into theft.api-keys

B

broker-account-margin-call-handlingUse when a bot trades a Reg T, portfolio or futures margin account and must act before the broker liquidates: tiered maintenance-margin warnings cross-checked against broker excess liquidity, initial-margin order gating and liquidity-aware de-leveraging.margin-callbroker-agnostic-adapter-interfaceUse when strategy code must run across several brokers and should not import kiteconnect, alpaca-py or ibapi directly; defines an adapter contract with Decimal prices, typed exceptions and normalised order status across venues.adapter-patternbroker-api-changelog-diffing-toolUse before upgrading a broker SDK or OpenAPI spec, to diff two schema snapshots for removed endpoints, newly required parameters, enum mutations and type changes so CI fails before the change reaches an order path.api-changelogbroker-api-deprecation-notice-monitoringUse when a long-running bot calls REST endpoints a broker may retire; parses RFC 8594 Sunset and RFC 9745 Deprecation headers plus changelog feeds into one dated migration deadline with an escalation tier.deprecation-monitoringbroker-api-idempotent-cancel-requestsUse when cancelling live orders over an unreliable network. De-duplicates cancel retries and separates a cancel the broker acknowledged from one it completed, so a timeout, 5xx or order-not-found is never read as proof the order is dead.idempotencybroker-api-versioning-migration-playbookUse when moving live order flow from one broker API version to the next: shadow reads, deterministic per-order canary routing that survives retries, latched rollback, and a translator that refuses to silently change time-in-force.api-migrationbroker-failover-secondary-account-routingUse when order flow must continue on a backup broker account after the primary degrades. Classifies which failures are safe to fail over, refuses to re-send an order that may already be working, and pins reducing orders to the account holding the position.failoverbroker-margin-interest-accrual-trackingUse when computing net P&L for a leveraged or short book: tiered blended margin-loan rates, short borrow fees on collateral value, 360 versus 365 day counts, and calendar-day accrual across weekends and holidays.margin-interestbroker-order-type-capability-matrixUse when one strategy runs across brokers with different native order types (bracket, OCO, trailing stop, iceberg, peg, TWAP) and must decide whether to send a native type or emulate it locally while conserving the parent quantity.order-typesbroker-side-order-throttle-detectionUse when a venue queues excess order messages instead of rejecting them, so congestion shows up only as acknowledgement latency. Detects undeclared throttling from an EWMA ACK round-trip baseline and paces dispatch with AIMD backoff.order-throttlebroker-status-page-monitoring-integrationUse when an order or feed failure raises the on-call question of whether the broker is down or your code is. Polls Atlassian Statuspage v2 summary feeds scoped to the components your order flow uses, and requires fresh positive evidence.status-page

D

degiro-unofficial-api-risk-assessmentUse when assessing automated access to DEGIRO through reverse-engineered Web API endpoints. DEGIRO states that API wrappers and custom scripts violate its terms, so the contractual finding comes before session handling or the checkOrder flow.degirodemo-account-realism-gap-assessmentUse before promoting a paper-tested strategy to live capital, to measure how far demo fill latency, slippage, queue depth and partial-fill rates diverge from matched live executions, and derive a Sharpe haircut from the gap.demo-account

E

etrade-oauth1-signature-flowUse when integrating E*TRADE, which signs every request with OAuth 1.0a HMAC-SHA1 rather than OAuth 2.0 bearer tokens. Covers the three-legged flow with oauth_callback=oob, RFC 5849 signature base strings, and the idle and end-of-day expiry rules.etrade

H

headless-broker-auth-patternsUse when a bot must authenticate to a broker with no human at the keyboard. Classifies the broker into one of five auth archetypes before you build, so you do not implement a mechanism the broker neither publishes nor permits.headless-auth

I

ibkr-tws-gateway-headless-launchUse when an Interactive Brokers bot runs on a headless server or container: IB Gateway or TWS under Xvfb with IBC, port probes, daily reset handling, and socket readiness checks before the API session is assumed live.ibkr

M

multi-account-same-strategy-fan-outUse when one master signal must be split across sub-accounts and the per-account quantities must sum exactly to the parent, with deterministic collision-free client order IDs and an auditable pro-rata allocation record.multi-accountmulti-broker-consolidated-position-viewUse when your position or P&L does not match the broker, or positions live across several brokers and exchanges and risk limits need one netted base-currency view. Normalises symbols, converts currencies and reports the breaks against your own ledger.multi-brokermulti-broker-rate-limit-handlingUse when API call volume approaches a broker's limits and risk-critical calls such as cancels must never queue behind data polling. Multi-window token buckets per endpoint class and account, strict tier priority, and structural 429 handling.rate-limiting

O

order-placement-idempotencyUse when a bot places or modifies live orders and must never double-execute or send a duplicate order after a retry, timeout or reconnect, because a timeout means unknown rather than failed. For cancel races see broker-api-idempotent-cancel-requests.idempotency

P

post-only-and-maker-taker-fee-optimizationUse when a limit order must rest rather than execute as a taker. Builds the post-only payload each venue actually accepts (Binance LIMIT_MAKER and GTX, Bybit PostOnly, Coinbase post_only, Kraken oflags=post, FIX ExecInst 6) and refuses marketable prices.post-only

Q

questrade-api-rate-limit-and-account-typesUse when integrating the Questrade IQ API: single-use refresh-token rotation inside a 7-day validity window, the per-session api_server URL, and category rate limits of 30/second for account calls and 20/second for market data.questrade

R

regional-broker-data-residency-constraintsUse when choosing where to run a process that connects to a broker in a specific national market. Separates enforced controls such as SEBI static-IP whitelisting from hosting-region mandates that do not actually bind the deploying entity.cloud-regionrobinhood-unofficial-api-integrationUse when assessing programmatic access to a Robinhood account. Its Customer Agreement requires express written consent before any API reaches the account, and sanctioned alternatives now exist, so the contractual finding usually settles it.robinhood

S

sandbox-credential-leakage-preventionUse when one process runs in both paper and live modes and a misrouted request would burn real capital. An allow-list gate that refuses any outbound call whose parsed hostname and path do not match the declared environment.credential-leakagesandbox-vs-production-endpoint-driftUse before promoting a broker integration from sandbox to live, to compare captured responses for nested schema drift, nullability changes, rate-limit header differences, status-code class changes and endpoints missing from one environment.sandbox-paritysaxo-bank-openapi-integrationUse when routing multi-asset orders through Saxo Bank OpenAPI, which identifies instruments by numeric UIC and requires an explicit AssetType on every order payload. Covers FX spot, equities, futures and options across simulation and live.openapischwab-api-oauth-pkce-flowUse when authenticating against the Charles Schwab Trader API or migrating off TD Ameritrade. Schwab documents a confidential-client authorization-code flow with HTTP Basic auth and no code_challenge, plus a 7-day refresh ceiling.schwab-trader-api

T

tastytrade-api-integrationUse when building or migrating a Tastytrade options or futures bot. Session-token authentication was discontinued on 2025-12-01 in favour of an OAuth2 refresh-token grant, and equity options use the 21-character OCC symbol layout.tastytradetoken-lifecycle-live-probingUse when deciding whether a cached broker token is still usable before trading calls, because documented expiry times lie. The probe has three outcomes, and treating the inconclusive one as invalid causes needless re-authentication.token-expirytradestation-websocket-order-updatesUse when consuming TradeStation's v3 order update stream, which is HTTP chunked streaming rather than a WebSocket. Classifies stream and control frames, detects stalls by heartbeat, and dedupes cumulative fill snapshots across reconnects.tradestation-api

U

upstox-oauth-refresh-token-rotationUse when holding an Upstox API v2 or v3 access token across time. Upstox issues no refresh token and the access token dies at 03:30 IST daily, so this covers expiry derivation, single-flight daily re-authentication and atomic persistence.upstox-api-v2

W

webhook-based-order-fill-notificationsUse when a venue delivers fills by POSTing to an endpoint you host. Check first whether your broker sends webhooks at all, since IBKR, Alpaca, TradeStation and Coinbase Advanced Trade all push fills over a persistent stream instead.webhooks

Z

zerodha-kite-postback-webhook-verificationUse when consuming Zerodha Kite order postbacks. The SHA-256 checksum covers only order_id, order_timestamp and api_secret, so status, filled_quantity and average_price arrive unauthenticated and a verified postback only triggers reconciliation.zerodha-kite-connect