Skip to content
All library documents

Tracking Outstanding Margin Loans and Interest Across Exchanges

Article Strategy library · Author: 数·狂

Summary

This utility shows how to query outstanding margin borrowing on OKCoin and Huobi and report amounts owed in CNY, BTC, and LTC. It includes interest in the liability total: OKCoin’s fields are added directly, while Huobi’s loan records are filtered by asset type and combine unreturned principal with interest fields. The main routine prints each supported exchange’s outstanding balances.

The example illustrates a practical account-monitoring task rather than a trading signal or strategy. Its usefulness is limited by its support for only two exchanges and the specific API methods and response fields available when it was written. It provides no validation, error handling, or evidence about trading performance, and would need adaptation for current exchange APIs or other assets.

Key ideas

  • The utility reports outstanding borrowed CNY, BTC, and LTC for each configured exchange.
  • Interest is included alongside unpaid principal when calculating the amount due.
  • OKCoin and Huobi use different API calls and response formats to provide loan data.
  • The example is exchange-specific account monitoring, not a trading strategy or performance analysis.

Tags

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