Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feat/connector…
Browse files Browse the repository at this point in the history
…-coinzoom
  • Loading branch information
TheHolyRoger committed Apr 1, 2021
2 parents 38476e0 + 809ad21 commit 720e84d
Show file tree
Hide file tree
Showing 50 changed files with 826 additions and 686 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ We created hummingbot to promote **decentralized market-making**: enabling membe

| logo | id | name | ver | doc | status |
|:---:|:---:|:---:|:---:|:---:|:---:|
| <img src="assets/ascend_ex_logo.png" alt="AscendEx" width="90" /> | ascend_ex | [AscendEx](https://ascendex.com/en/global-digital-asset-platform) | 1 | [API](https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/beaxy_logo.png" alt="Beaxy" width="90" /> | beaxy | [Beaxy](https://beaxy.com/) | 2 | [API](https://beaxyapiv2trading.docs.apiary.io/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="https://i.ibb.co/m0YDQLd/Screen-Shot-2019-03-14-at-10-53-42-AM.png" alt="Binance" width="90" /> | binance | [Binance](https://www.binance.com/) | 3 | [API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/binanceus_logo.png" alt="Binance US" width="90" /> | binance_us | [Binance US](https://www.binance.com/) | 3 | [API](https://github.com/binance-us/binance-official-api-docs/blob/master/rest-api.md) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/binance_perpetual_logo.png" alt="Binance Perpetual" width="90" /> | binance_perpetual | [Binance Futures](https://www.binance.com/) | 1 | [API](https://binance-docs.github.io/apidocs/futures/en/) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
|<img src="assets/bittrex_logo.png" alt="Bittrex Global" width="90" height="30" />| bittrex | [Bittrex Global](https://global.bittrex.com/) | 3 | [API](https://bittrex.github.io/api/v3) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/bitfinex_logo.png" alt="Bitfinex" width="90" /> | bitfinex | [Bitfinex](https://www.bitfinex.com/) | 2 | [API](https://docs.bitfinex.com/docs/introduction) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/bitmax_logo.png" alt="BitMax" width="90" /> | bitmax | [BitMax](https://bitmax.io/en/global-digital-asset-platform) | 1 | [API](https://bitmax-exchange.github.io/bitmax-pro-api/#bitmax-pro-api-documentation) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/blocktane_logo.png" alt="Blocktane" width="90" /> | blocktane | [Blocktane](https://blocktane.io/) | 2 | [API](https://blocktane.io/api) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="https://i.ibb.co/h9JdGDW/cbp.jpg" alt="Coinbase Pro" width="90" /> | coinbase_pro | [Coinbase Pro](https://pro.coinbase.com/) | * | [API](https://docs.pro.coinbase.com/) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/coinzoom_logo.png" alt="CoinZoom" width="90" /> | coinzoom | [CoinZoom](https://trade.coinzoom.com/landing) | * | [API](https://api-docs.coinzoom.com/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
Expand Down
Binary file added assets/ascend_ex_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/bitmax_logo.png
Binary file not shown.
14 changes: 6 additions & 8 deletions hummingbot/client/command/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@
"send_error_logs",
"script_enabled",
"script_file_path",
"manual_gas_price",
"ethereum_chain_name",
"ethgasstation_gas_enabled",
"ethgasstation_api_key",
"ethgasstation_gas_level",
"ethgasstation_refresh_time",
"gateway_enabled",
"gateway_cert_passphrase",
"gateway_api_host",
Expand Down Expand Up @@ -240,9 +235,12 @@ async def inventory_price_prompt(
exchange = config_map["exchange"].value
market = config_map["market"].value
base_asset, quote_asset = market.split("-")
balances = await UserBalances.instance().balances(
exchange, base_asset, quote_asset
)
if global_config_map["paper_trade_enabled"].value:
balances = global_config_map["paper_trade_account_balance"].value
else:
balances = await UserBalances.instance().balances(
exchange, base_asset, quote_asset
)
if balances.get(base_asset) is None:
return

Expand Down
3 changes: 3 additions & 0 deletions hummingbot/client/command/create_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ async def prompt_a_config(self, # type: HummingbotApplication
config: ConfigVar,
input_value=None,
assign_default=True):
if config.key == "inventory_price":
await self.inventory_price_prompt(self.strategy_config_map, input_value)
return
if input_value is None:
if assign_default:
self.app.set_text(parse_config_default_to_text(config))
Expand Down
5 changes: 0 additions & 5 deletions hummingbot/client/command/start_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
from hummingbot.client.settings import (
STRATEGIES,
SCRIPTS_PATH,
ethereum_gas_station_required,
required_exchanges,
)
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.core.utils.kill_switch import KillSwitch
from typing import TYPE_CHECKING
from hummingbot.client.config.global_config_map import global_config_map
from hummingbot.core.utils.eth_gas_station_lookup import EthGasStationLookup
from hummingbot.script.script_iterator import ScriptIterator
from hummingbot.connector.connector_status import get_connector_status, warning_messages
if TYPE_CHECKING:
Expand Down Expand Up @@ -142,9 +140,6 @@ async def start_market_making(self, # type: HummingbotApplication
self.clock.add_iterator(self._script_iterator)
self._notify(f"Script ({script_file}) started.")

if global_config_map["ethgasstation_gas_enabled"].value and ethereum_gas_station_required():
EthGasStationLookup.get_instance().start()

self.strategy_task: asyncio.Task = safe_ensure_future(self._run_clock(), loop=self.ev_loop)
self._notify(f"\n'{strategy_name}' strategy started.\n"
f"Run `status` command to query the progress.")
Expand Down
6 changes: 1 addition & 5 deletions hummingbot/client/command/status_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from hummingbot.client.config.security import Security
from hummingbot.user.user_balances import UserBalances
from hummingbot.client.settings import required_exchanges, ethereum_wallet_required, ethereum_gas_station_required
from hummingbot.client.settings import required_exchanges, ethereum_wallet_required
from hummingbot.core.utils.async_utils import safe_ensure_future

from typing import TYPE_CHECKING
Expand Down Expand Up @@ -186,10 +186,6 @@ async def status_check_all(self, # type: HummingbotApplication
else:
self._notify(" - ETH wallet check: ETH wallet is not connected.")

if ethereum_gas_station_required() and not global_config_map["ethgasstation_gas_enabled"].value:
self._notify(f' - ETH gas station check: Manual gas price is fixed at '
f'{global_config_map["manual_gas_price"].value}.')

loading_markets: List[ConnectorBase] = []
for market in self.markets.values():
if not market.ready:
Expand Down
4 changes: 0 additions & 4 deletions hummingbot/client/command/stop_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import threading
from typing import TYPE_CHECKING
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.core.utils.eth_gas_station_lookup import EthGasStationLookup
if TYPE_CHECKING:
from hummingbot.client.hummingbot_application import HummingbotApplication

Expand Down Expand Up @@ -45,9 +44,6 @@ async def stop_loop(self, # type: HummingbotApplication
if self.strategy_task is not None and not self.strategy_task.cancelled():
self.strategy_task.cancel()

if EthGasStationLookup.get_instance().started:
EthGasStationLookup.get_instance().stop()

if self.markets_recorder is not None:
self.markets_recorder.stop()

Expand Down
2 changes: 1 addition & 1 deletion hummingbot/client/config/config_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def get_erc20_token_addresses() -> Dict[str, List]:
address_file_path = TOKEN_ADDRESSES_FILE_PATH
token_list = {}

resp = requests.get(token_list_url, timeout=3)
resp = requests.get(token_list_url, timeout=1)
decoded_resp = resp.json()

for token in decoded_resp["tokens"]:
Expand Down
26 changes: 0 additions & 26 deletions hummingbot/client/config/global_config_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,32 +298,6 @@ def global_token_symbol_on_validated(value: str):
type_str="decimal",
validator=lambda v: validate_decimal(v, Decimal(0), inclusive=False),
default=50),
"ethgasstation_gas_enabled":
ConfigVar(key="ethgasstation_gas_enabled",
prompt="Do you want to enable Ethereum gas station price lookup? >>> ",
required_if=lambda: False,
type_str="bool",
validator=validate_bool,
default=False),
"ethgasstation_api_key":
ConfigVar(key="ethgasstation_api_key",
prompt="Enter API key for defipulse.com gas station API >>> ",
required_if=lambda: global_config_map["ethgasstation_gas_enabled"].value,
type_str="str"),
"ethgasstation_gas_level":
ConfigVar(key="ethgasstation_gas_level",
prompt="Enter gas level you want to use for Ethereum transactions (fast, fastest, safeLow, average) "
">>> ",
required_if=lambda: global_config_map["ethgasstation_gas_enabled"].value,
type_str="str",
validator=lambda s: None if s in {"fast", "fastest", "safeLow", "average"}
else "Invalid gas level."),
"ethgasstation_refresh_time":
ConfigVar(key="ethgasstation_refresh_time",
prompt="Enter refresh time for Ethereum gas price lookup (in seconds) >>> ",
required_if=lambda: global_config_map["ethgasstation_gas_enabled"].value,
type_str="int",
default=120),
"gateway_api_host":
ConfigVar(key="gateway_api_host",
prompt=None,
Expand Down
9 changes: 6 additions & 3 deletions hummingbot/client/hummingbot_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from hummingbot.client.errors import InvalidCommandError, ArgumentParserError
from hummingbot.client.config.global_config_map import global_config_map, using_wallet
from hummingbot.client.config.config_helpers import (
get_erc20_token_addresses,
get_strategy_config_map,
get_connector_class,
get_eth_wallet_private_key,
Expand Down Expand Up @@ -194,10 +193,14 @@ def _initialize_market_assets(market_name: str, trading_pairs: List[str]) -> Lis
return market_trading_pairs

def _initialize_wallet(self, token_trading_pairs: List[str]):
# Todo: This function should be removed as it's currently not used by current working connectors

if not using_wallet():
return
if not self.token_list:
self.token_list = get_erc20_token_addresses()
# Commented this out for now since get_erc20_token_addresses uses blocking call

# if not self.token_list:
# self.token_list = get_erc20_token_addresses()

ethereum_wallet = global_config_map.get("ethereum_wallet").value
private_key = Security._private_keys[ethereum_wallet]
Expand Down
Loading

0 comments on commit 720e84d

Please sign in to comment.