Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ coverage.xml
# External SDK files
/**/.chain_cookie
/**/.injective_cookie


#logs
/logs
2 changes: 1 addition & 1 deletion bin/path_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
hummingbot.set_prefix_path(os.getcwd())
else:
# Dev environment.
from os.path import join, realpath
import sys
from os.path import join, realpath
sys.path.insert(0, realpath(join(__file__, "../../")))
14 changes: 14 additions & 0 deletions conf/scripts/conf_v2_triangular_arb_1.ymlasa
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
markets: {}
candles_config: []
controllers_config: []
config_update_interval: 60
script_file_name: v2_triangular_arb.py
cex_connector_main: kucoin
cex_connector_proxy: kucoin
dex_connector: splash_cardano_mainnet
arb_asset: ERG
arb_asset_wrapped: RSERG
proxy_asset: ADA
stable_asset: ''
min_arbitrage_percent: 0.01
min_arbitrage_volume: 2
14 changes: 14 additions & 0 deletions conf/scripts/conf_v2_triangular_arb_1.ymldsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
markets: {}
candles_config: []
controllers_config: []
config_update_interval: 60
script_file_name: v2_triangular_arb.py
cex_connector_main: kucoin
cex_connector_proxy: kucoin
dex_connector: splash_cardano_mainnet
arb_asset: ''
arb_asset_wrapped: RSERG
proxy_asset: ADA
stable_asset: USDT
min_arbitrage_percent: 0.01
min_arbitrage_volume: 2
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ services:
volumes:
- "./certs:/home/gateway/certs"
environment:
- GATEWAY_PASSPHRASE=Sp09135546636
- GATEWAY_PASSPHRASE=a
2 changes: 1 addition & 1 deletion hummingbot/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import decimal
import logging

import pandas as pd
import decimal

FLOAT_PRINTOUT_PRECISION = 8

Expand Down
3 changes: 1 addition & 2 deletions hummingbot/client/command/gateway_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ async def _prompt_for_wallet_address(
prompt=f"Enter your {chain}-{network} wallet private key >>> ",
is_password=True
)
self.notify(f"fetched private key {wallet_private_key}")
self.logger().info("fetched private key %s", wallet_private_key)

self.app.clear_input()
if self.app.to_stop_config:
return
Expand Down
5 changes: 2 additions & 3 deletions hummingbot/client/command/silly_commands.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio
from typing import (
TYPE_CHECKING,
)
from typing import TYPE_CHECKING

from hummingbot.core.utils.async_utils import safe_ensure_future

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/client/command/start_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ async def start_market_making(self, # type: HummingbotApplication
self.strategy_task: asyncio.Task = safe_ensure_future(self._run_clock(), loop=self.ev_loop)
self.notify(f"\n'{self.strategy_name}' strategy started.\n"
f"Run `status` command to query the progress.")
self.logger().info("start command initiated.")
self.logger().debug("start command initiated.")

if self._trading_required:
self.kill_switch = self.client_config_map.kill_switch_mode.get_kill_switch(self)
Expand Down
18 changes: 1 addition & 17 deletions hummingbot/client/command/stop_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def stop(self, # type: HummingbotApplication

async def stop_loop(self, # type: HummingbotApplication
skip_order_cancellation: bool = False):
self.logger().info("stop command initiated.")
self.logger().debug("stop command initiated.")
self.notify("\nWinding down...")

# Restore App Nap on macOS.
Expand All @@ -31,22 +31,6 @@ async def stop_loop(self, # type: HummingbotApplication

if isinstance(self.strategy, ScriptStrategyBase):
await self.strategy.on_stop()
print("passed the strat on stop")
self.strategy_task.cancel()
print("passed the task stop")
RateOracle.get_instance().stop()
print("passed the rate oracle stop")
if self.clock:
self.clock.remove_iterator(self.strategy)
print("removed the iterator")
success = await self._cancel_outstanding_orders()
print("passed and cancelled the ]outstanding orders")
# Give some time for cancellation events to trigger
await asyncio.sleep(2)
if success:
# Only erase markets when cancellation has been successful
self.markets = {}
print("every thing ok")

if self._trading_required and not skip_order_cancellation:
# Remove the strategy from clock before cancelling orders, to
Expand Down
6 changes: 1 addition & 5 deletions hummingbot/client/config/config_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
by ConfigVar.
"""

from typing import (
Optional,
Callable,
Union,
)
import inspect
from typing import Callable, Optional, Union

# function types passed into ConfigVar
RequiredIf = Callable[[str], Optional[bool]]
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/client/config/trade_fee_schema_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from hummingbot.client.config.fee_overrides_config_map import fee_overrides_config_map
from hummingbot.client.settings import AllConnectorSettings
from hummingbot.core.data_type.trade_fee import TradeFeeSchema, TokenAmount
from hummingbot.core.data_type.trade_fee import TokenAmount, TradeFeeSchema


class TradeFeeSchemaLoader:
Expand Down
1 change: 1 addition & 0 deletions hummingbot/client/hummingbot_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ async def _cancel_outstanding_orders(self) -> bool:
self.logger().error("Error canceling outstanding orders.", exc_info=True)
success = False

await asyncio.sleep(5)
if success:
self.notify("All outstanding orders canceled.")
return success
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/client/tab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .tab_example_tab import TabExampleTab
from .order_book_tab import OrderBookTab
from .tab_example_tab import TabExampleTab

__all__ = [
OrderBookTab,
Expand Down
5 changes: 3 additions & 2 deletions hummingbot/client/tab/data_types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import asyncio

from dataclasses import dataclass
from typing import Optional, Type

from prompt_toolkit.widgets import Button
from typing import Type, Optional

from hummingbot.client.ui.custom_widgets import CustomTextArea

from .tab_base import TabBase


Expand Down
4 changes: 3 additions & 1 deletion hummingbot/client/tab/order_book_tab.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import asyncio
from typing import TYPE_CHECKING, Any, Dict

import pandas as pd

from typing import TYPE_CHECKING, Dict, Any
if TYPE_CHECKING:
from hummingbot.client.hummingbot_application import HummingbotApplication

from hummingbot.client.ui.custom_widgets import CustomTextArea

from .tab_base import TabBase


Expand Down
8 changes: 3 additions & 5 deletions hummingbot/client/tab/tab_base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from abc import (
ABCMeta,
abstractmethod,
)
from typing import TYPE_CHECKING, Dict, Any
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING, Any, Dict

if TYPE_CHECKING:
from hummingbot.client.hummingbot_application import HummingbotApplication

Expand Down
5 changes: 4 additions & 1 deletion hummingbot/client/tab/tab_example_tab.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from typing import TYPE_CHECKING, Dict, Any
from typing import TYPE_CHECKING, Any, Dict

if TYPE_CHECKING:
from hummingbot.client.hummingbot_application import HummingbotApplication

from hummingbot.client.ui.custom_widgets import CustomTextArea

from .tab_base import TabBase


Expand Down
5 changes: 3 additions & 2 deletions hummingbot/client/ui/scroll_handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from prompt_toolkit.layout.containers import Window
from prompt_toolkit.buffer import Buffer
from typing import Optional

from prompt_toolkit.buffer import Buffer
from prompt_toolkit.layout.containers import Window


def scroll_down(event, window: Optional[Window] = None, buffer: Optional[Buffer] = None):
w = window or event.app.layout.current_window
Expand Down
6 changes: 3 additions & 3 deletions hummingbot/client/ui/stdout_redirection.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env python

from __future__ import unicode_literals
from asyncio import get_event_loop

from contextlib import contextmanager
import threading
import sys
import threading
from asyncio import get_event_loop
from contextlib import contextmanager

__all__ = [
'patch_stdout',
Expand Down
1 change: 1 addition & 0 deletions hummingbot/connector/connector_base.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ from hummingbot.core.event.event_logger cimport EventLogger
from hummingbot.core.event.event_reporter cimport EventReporter
from hummingbot.core.network_iterator cimport NetworkIterator


cdef class ConnectorBase(NetworkIterator):
cdef:
EventReporter _event_reporter
Expand Down
10 changes: 6 additions & 4 deletions hummingbot/connector/connector_base.pyx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import asyncio
import time
from decimal import Decimal
from typing import Dict, List, Set, Tuple, TYPE_CHECKING, Union
from typing import TYPE_CHECKING, Dict, List, Set, Tuple, Union

from hummingbot.client.config.trade_fee_schema_loader import TradeFeeSchemaLoader
from hummingbot.connector.constants import s_decimal_0, s_decimal_NaN
from hummingbot.connector.in_flight_order_base import InFlightOrderBase
from hummingbot.connector.utils import split_hb_trading_pair, TradeFillOrderDetails
from hummingbot.connector.constants import s_decimal_NaN, s_decimal_0
from hummingbot.connector.utils import TradeFillOrderDetails, split_hb_trading_pair

from hummingbot.core.clock cimport Clock
from hummingbot.core.data_type.limit_order import LimitOrder

from hummingbot.core.data_type.cancellation_result import CancellationResult
from hummingbot.core.data_type.common import OrderType, TradeType
from hummingbot.core.data_type.limit_order import LimitOrder
from hummingbot.core.data_type.market_order import MarketOrder
from hummingbot.core.event.event_logger import EventLogger
from hummingbot.core.event.events import MarketEvent, OrderFilledEvent
Expand Down
5 changes: 1 addition & 4 deletions hummingbot/connector/exchange/binance/binance_order_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

from hummingbot.core.data_type.common import TradeType
from hummingbot.core.data_type.order_book import OrderBook
from hummingbot.core.data_type.order_book_message import (
OrderBookMessage,
OrderBookMessageType
)
from hummingbot.core.data_type.order_book_message import OrderBookMessage, OrderBookMessageType


class BinanceOrderBook(OrderBook):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
from typing import (
ClassVar as _ClassVar,
Iterable as _Iterable,
Mapping as _Mapping,
Optional as _Optional,
Union as _Union,
)

from google.protobuf import descriptor as _descriptor, message as _message
from google.protobuf.internal import containers as _containers, enum_type_wrapper as _enum_type_wrapper

DESCRIPTOR: _descriptor.FileDescriptor

Expand Down
15 changes: 10 additions & 5 deletions hummingbot/connector/exchange/cube/cube_ws_protobufs/trade_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
from typing import (
ClassVar as _ClassVar,
Iterable as _Iterable,
Mapping as _Mapping,
Optional as _Optional,
Union as _Union,
)

from google.protobuf import descriptor as _descriptor, message as _message
from google.protobuf.internal import containers as _containers, enum_type_wrapper as _enum_type_wrapper

DESCRIPTOR: _descriptor.FileDescriptor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import aiohttp
import asyncio
import logging
import time
import ujson
from typing import Any, Dict, Optional

from typing import (
Any,
Dict,
Optional,
)
import aiohttp
import ujson

from hummingbot.connector.exchange.ndax.ndax_auth import NdaxAuth
from hummingbot.connector.exchange.ndax import ndax_constants as CONSTANTS, ndax_utils
from hummingbot.connector.exchange.ndax.ndax_auth import NdaxAuth
from hummingbot.connector.exchange.ndax.ndax_websocket_adaptor import NdaxWebSocketAdaptor
from hummingbot.core.api_throttler.async_throttler import AsyncThrottler
from hummingbot.core.data_type.user_stream_tracker_data_source import UserStreamTrackerDataSource
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/connector/exchange/ndax/ndax_auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import hashlib
import hmac
from typing import Dict, Any
from typing import Any, Dict

from hummingbot.core.utils.tracking_nonce import get_tracking_nonce_low_res

Expand Down
2 changes: 1 addition & 1 deletion hummingbot/connector/exchange/ndax/ndax_constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A single source of truth for constant variables related to the exchange
from hummingbot.core.api_throttler.data_types import RateLimit, LinkedLimitWeightPair
from hummingbot.core.api_throttler.data_types import LinkedLimitWeightPair, RateLimit

EXCHANGE_NAME = "ndax"

Expand Down
6 changes: 1 addition & 5 deletions hummingbot/connector/exchange/ndax/ndax_in_flight_order.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from decimal import Decimal
from typing import (
Any,
Dict,
Optional,
)
from typing import Any, Dict, Optional

from hummingbot.connector.in_flight_order_base import InFlightOrderBase
from hummingbot.core.data_type.common import OrderType, TradeType
Expand Down
10 changes: 2 additions & 8 deletions hummingbot/connector/exchange/ndax/ndax_order_book.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import logging
from typing import Any, Dict, List, Optional

from typing import (
Optional,
Dict,
List, Any)
import hummingbot.connector.exchange.ndax.ndax_constants as CONSTANTS
from hummingbot.connector.exchange.ndax.ndax_order_book_message import NdaxOrderBookMessage
from hummingbot.core.data_type.order_book import OrderBook
from hummingbot.core.data_type.order_book_message import (
OrderBookMessage,
OrderBookMessageType,
)
from hummingbot.core.data_type.order_book_message import OrderBookMessage, OrderBookMessageType
from hummingbot.logger import HummingbotLogger

_logger = None
Expand Down
Loading