CoinAlpha / hummingbot

Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain
https://www.hummingbot.org
Apache License 2.0
172 stars 84 forks source link

Feat/coin cap rate source #365

Closed petioptrv closed 1 year ago

petioptrv commented 1 year ago

Before submitting this PR, please make sure:

A description of the changes proposed in the pull request:

This PR is associated to bounty issue: https://github.com/hummingbot/hummingbot/issues/6517.

This PR introduces the CoinCap rate source for the rate oracle. It is possible to obtain an API key here.

CoinCap adds an alternative to CoinGecko, and its API allows for price streaming, which is included in this PR.

Note that CoinCap's API uses asset names rather than symbols, which means users must configure an asset map like 'BTC:bitcoin,DOGE:dogecoin' to the assets_map of the rate source's config.

Note also that the only consequence of a faulty API key (or no API key) is that the user will have lower rate limits. If a faulty API key is detected, the client will issue a warning log.

The PR had to make significant changes to the configuration modules in order to allow configuring a secret API key in the client config map.

Tests performed by the developer:

Tips for QA testing:

Obtain an API key here and run a full test on the functionality of the rate provider. Please not that the global token must be configured to USD in order for rate --token {TOKEN} to work. That is because CoinCap only supports USD as a quote, and that rate functionality cannot perform conversions. However, the rate --pair {BASE}-{QUOTE} will work with pairs that don't include USD as quote.

geneuinely07 commented 1 year ago

[ch43278]

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to Shortcut Story #43278: Port CoinCap Rate Oracle Data Source to OSS.

mrhzysbl commented 1 year ago

Test run: https://hummingbot.testrail.io/index.php?/runs/view/4816

petioptrv commented 1 year ago

Closing this PR to re-open towards Foundation: https://github.com/hummingbot/hummingbot/pull/6534