Skip to content
All library documents

Building a Custom Exchange Adapter with an HTTP Service

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

Summary

This document describes using a platform-provided service function to expose an HTTP endpoint from a JavaScript strategy, then connecting that endpoint to a generic exchange protocol. Its example wraps selected OKX operations in a reusable strategy template: public ticker retrieval, account balance retrieval, and a pass-through interface for other API calls. The service reads request fields, selects a protocol implementation based on the configured exchange label, and returns JSON responses.

The article outlines template parameters, request handling, API signing, symbol conversion, and a small test strategy that calls the adapter through familiar exchange methods. It argues that the same pattern can integrate venues missing from the platform, provided their API details are implemented. The example covers only a limited set of operations and is not a complete exchange integration. It provides a walkthrough and sample calls, but no independent reliability, security, or trading-performance evaluation.

Key ideas

  • A strategy-hosted HTTP service can connect a generic exchange protocol to custom API logic.
  • A template can wrap exchange-specific authentication, requests, and response conversion behind familiar methods.
  • The example implements ticker, account, and generic API calls for a selected venue.
  • Other exchanges require their own API mappings and protocol handling.
  • The walkthrough demonstrates functionality but does not establish production reliability or performance.

Tags

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