Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for evm #1

Open
wants to merge 4 commits into
base: feat/support-aura
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion hummingbot/client/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def get_connector_spec_from_market_name(market_name: str) -> Optional[Dict[str,
connector = 'halotrade'
network = chain
chain = 'aura'
else:
elif chain in ['auraevm']:
connector = 'halotradeevm'
network = 'mainnet'
chain = 'auraevm'
else:
connector, network = market_name.split(f"_{chain}_")
return GatewayConnectionSetting.get_connector_spec(connector, chain, network)
return None
Expand Down
10 changes: 6 additions & 4 deletions hummingbot/connector/gateway/amm/gateway_aura_amm.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import asyncio
from decimal import Decimal
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union

from hummingbot.connector.gateway.amm.gateway_evm_amm import GatewayEVMAMM
from hummingbot.connector.gateway.gateway_in_flight_order import GatewayInFlightOrder
from hummingbot.core.data_type.cancellation_result import CancellationResult
from hummingbot.core.data_type.in_flight_order import OrderState, OrderUpdate
from hummingbot.core.data_type.trade_fee import TokenAmount
from hummingbot.core.event.events import TradeType
from hummingbot.core.gateway import check_transaction_exceptions
from hummingbot.core.utils.async_utils import safe_ensure_future, safe_gather

if TYPE_CHECKING:
from hummingbot.client.config.config_helpers import ClientConfigAdapter

Expand Down Expand Up @@ -66,6 +66,7 @@ async def stop_network(self):
if self._get_gas_estimate_task is not None:
self._get_gas_estimate_task.cancel()
self._get_chain_info_task = None

@property
def ready(self):
return all(self.status_dict.values())
Expand Down Expand Up @@ -149,6 +150,7 @@ def parse_price_response(
# return None
return Decimal(str(price))
return None

async def _status_polling_loop(self):
await self.update_balances(on_interval=False)
while True:
Expand Down Expand Up @@ -213,7 +215,7 @@ async def update_order_status(self, tracked_orders: List[GatewayInFlightOrder]):
new_state=OrderState.FILLED,
)
self._order_tracker.process_order_update(order_update)
else:
else:
order_update: OrderUpdate = OrderUpdate(
client_order_id=tracked_order.client_order_id,
trading_pair=tracked_order.trading_pair,
Expand Down Expand Up @@ -247,4 +249,4 @@ async def get_allowances(self):
pass

async def all_trading_pairs(self):
pass
pass
1 change: 1 addition & 0 deletions hummingbot/connector/gateway/common_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Chain(Enum):
ETHEREUM = ('ethereum', 'ETH')
TEZOS = ('tezos', 'XTZ')
AURA = ('aura', 'AURA')
AURAEVM = ('auraevm', 'AURA')

def __init__(self, chain: str, native_currency: str):
self.chain = chain
Expand Down
1 change: 1 addition & 0 deletions hummingbot/core/data_type/trade_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def fee_amount_in_token(
def _are_tokens_interchangeable(self, first_token: str, second_token: str):
interchangeable_tokens = [
{"WETH", "ETH"},
{"WAURA", "AURA"},
{"WBNB", "BNB"},
{"WMATIC", "MATIC"},
{"WAVAX", "AVAX"},
Expand Down
2 changes: 2 additions & 0 deletions hummingbot/core/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def check_transaction_exceptions(
gas_limit_threshold: int = 0
elif chain == Chain.AURA.chain:
gas_limit_threshold: int = 0
elif chain == Chain.AURAEVM.chain:
gas_limit_threshold: int = 0
else:
raise ValueError(f"Unsupported chain: {chain}")
if gas_limit < gas_limit_threshold:
Expand Down
3 changes: 2 additions & 1 deletion hummingbot/core/utils/gateway_config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"tezos": "XTZ",
"kujira": "KUJI",
"euphoria": "EAURA",
"xstaxy": "AURA"
"xstaxy": "AURA",
"auraevm": "AURA",
}

SUPPORTED_CHAINS = set(native_tokens.keys())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def is_closed(self):
def _are_tokens_interchangeable(first_token: str, second_token: str):
interchangeable_tokens = [
{"WETH", "ETH"},
{"WAURA", "AURA"},
{"WBTC", "BTC"},
{"WBNB", "BNB"},
{"WMATIC", "MATIC"},
Expand Down
Empty file.
Loading