Skip to content
All library documents

Building a Generic Exchange Adapter for Quant Trading APIs

Article FMZ forum · Author: 发明者量化-小小梦

Summary

This guide explains how to connect a custom exchange to a hosted quantitative trading platform through a generic protocol plugin. The plugin runs an HTTP endpoint that receives JSON requests, identifies the requested operation by method name, forwards parameters to the exchange API, and returns data in the platform’s expected format. The hosted strategy and plugin may run on separate machines, so the configured service address must be reachable by the host.

Examples describe mapping market data, candles, order-book depth, public trades, account balances, orders, and order placement or cancellation. The adapter must handle the exchange’s own authentication rules and convert its response fields into the required schemas. The guide also discusses passing extra credentials through key fields and includes a Go implementation example. These examples are integration guidance, not a security review; credential handling, network exposure, error behavior, and exchange-specific API changes require careful implementation. No performance or trading results are reported.

Key ideas

  • A generic HTTP plugin can translate a platform’s method-based JSON requests into exchange API calls.
  • The adapter must normalize market data, account, and order responses to the platform’s expected schemas.
  • Public market-data operations and authenticated account or trading operations may require different signing logic.
  • The example routes ticker, depth, trades, candles, balances, orders, and trades through method dispatch.
  • Extra exchange credentials can be parsed from supplied key fields, which makes secure handling an implementation concern.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.