Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
76ec29a
feat: Add Lighter spot and perpetual exchange connectors
smartcrypto0 Apr 7, 2026
5800cbf
Merge branch 'development' into feat/lighter-connectors-unified
smartcrypto0 Apr 8, 2026
df3079b
feat: use lighter-sdk pypi clients and remove vendored signers
smartcrypto0 Apr 9, 2026
6e7d9d3
chore: refresh lighter spot and perp integration artifacts
smartcrypto0 Apr 9, 2026
79a5536
fix: resolve pre-commit failures for lighter connector PR
smartcrypto0 Apr 10, 2026
1ee7c82
fix: guard smoke test module-level code to prevent pytest collection …
smartcrypto0 Apr 10, 2026
789cace
Merge branch 'development' into feat/lighter-connectors-unified
nikspz Apr 10, 2026
12d73ed
(fix) stabilize lighter connector tests and cleanup
smartcrypto0 Apr 10, 2026
f702c16
(test) increase lighter connector diff coverage
smartcrypto0 Apr 10, 2026
8001351
(fix) use safe __new__ in lighter exchange tests
smartcrypto0 Apr 11, 2026
b876f79
fix: update lighter connectors with QA-validated code, remove dev art…
smartcrypto0 Apr 22, 2026
3096f77
Merge branch 'development' into feat/lighter-connectors-unified
smartcrypto0 Apr 22, 2026
be26832
Merge branch 'development' into feat/lighter-connectors-unified
nikspz Apr 22, 2026
e68571e
lighter: credential validation, EOA removal, perp auth fix, arb impro…
smartcrypto0 Apr 22, 2026
de02b54
fix(lighter): update tests for config field renames and auth behavior…
smartcrypto0 Apr 22, 2026
4595a61
fix(lighter_perpetual): use live fee schema in _get_fee, fix LIMIT_MA…
smartcrypto0 Apr 22, 2026
4c2b744
style: fix flake8 E301/E127 in lighter_perpetual connector and tests
smartcrypto0 Apr 23, 2026
ca439e0
fix(lighter): add public key param to all 4 connectors, fix spot auth…
smartcrypto0 Apr 23, 2026
42e9d22
style: fix isort blank line after inline import in connect_command.py
smartcrypto0 Apr 23, 2026
04327ec
feat(lighter): add market order support for spot and perp connectors
smartcrypto0 Apr 24, 2026
48d7c6a
fix(lighter): reliability patches, rate limiting, candles feed, marke…
smartcrypto0 Apr 27, 2026
4ab4b6f
fix(lighter): apply reliability, auth, funding, balance, and test fixes
smartcrypto0 May 4, 2026
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
8 changes: 5 additions & 3 deletions hummingbot/client/command/balance_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pandas as pd

from hummingbot.client.config.config_validators import validate_decimal, validate_exchange
from hummingbot.client.config.config_validators import validate_decimal, validate_derivative, validate_exchange
from hummingbot.client.performance import PerformanceMetrics
from hummingbot.client.settings import AllConnectorSettings
from hummingbot.core.rate_oracle.rate_oracle import RateOracle
Expand Down Expand Up @@ -40,11 +40,13 @@ def balance(self, # type: HummingbotApplication
if args is None or len(args) == 0:
safe_ensure_future(self.show_asset_limits())
return
if len(args) != 3 or validate_exchange(args[0]) is not None or validate_decimal(args[2]) is not None:
exchange = args[0].lower() if len(args) > 0 else ""
is_invalid_exchange = validate_exchange(exchange) is not None
is_invalid_derivative = validate_derivative(exchange) is not None
if len(args) != 3 or (is_invalid_exchange and is_invalid_derivative) or validate_decimal(args[2]) is not None:
self.notify("Error: Invalid command arguments")
self.notify_balance_limit_set()
return
exchange = args[0]
asset = args[1].upper()
amount = float(args[2])
if balance_asset_limit.get(exchange) is None:
Expand Down
62 changes: 53 additions & 9 deletions hummingbot/client/command/connect_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
if not cs.use_ethereum_wallet and not cs.uses_gateway_generic_connector() if cs.name != "probit_kr"}


def _lighter_account_index(api_keys: Dict[str, str]) -> Optional[str]:
"""Return the account index from stored Lighter credentials, used as a fallback identifier."""
return next((v for k, v in api_keys.items() if "account_index" in k and v), None)


class ConnectCommand:
def connect(self, # type: HummingbotApplication
option: str):
Expand All @@ -41,20 +46,43 @@ async def connect_exchange(self, # type: HummingbotApplication
connector_config = ClientConfigAdapter(AllConnectorSettings.get_connector_config_keys(connector_name))
if Security.connector_config_file_exists(connector_name):
await Security.wait_til_decryption_done()
api_key_config = [value for key, value in Security.api_keys(connector_name).items() if "api_key" in key]
if api_key_config:
api_key = api_key_config[0]
prompt = (
f"Would you like to replace your existing {connector_name} API key {api_key} (Yes/No)? >>> "
)
stored_keys = Security.api_keys(connector_name)
# For Lighter connectors, show the derived public address rather than the key index.
is_lighter = connector_name.startswith("lighter")
if is_lighter:
from hummingbot.connector.lighter_common.lighter_key_utils import fetch_lighter_public_key
acct_idx = stored_keys.get(f"{connector_name}_account_index") or ""
key_idx = stored_keys.get(f"{connector_name}_api_key_index") or ""
public_key = await fetch_lighter_public_key(connector_name, acct_idx, key_idx)
if public_key:
prompt = (
f"Would you like to replace your existing {connector_name} key "
f"(public key: {public_key}) (Yes/No)? >>> "
)
else:
account_id = _lighter_account_index(stored_keys)
if account_id:
prompt = (
f"Would you like to replace your existing {connector_name} key "
f"(account index: {account_id}) (Yes/No)? >>> "
)
else:
prompt = f"Would you like to replace your existing {connector_name} key (Yes/No)? >>> "
else:
prompt = f"Would you like to replace your existing {connector_name} key (Yes/No)? >>> "
api_key_config = [v for k, v in stored_keys.items() if "api_key" in k]
if api_key_config:
prompt = (
f"Would you like to replace your existing {connector_name} API key "
f"{api_key_config[0]} (Yes/No)? >>> "
)
else:
prompt = f"Would you like to replace your existing {connector_name} key (Yes/No)? >>> "
answer = await self.app.prompt(prompt=prompt)
if self.app.to_stop_config:
self.app.to_stop_config = False
return
if answer.lower() in ("yes", "y"):
previous_keys = Security.api_keys(connector_name)
previous_keys = stored_keys
await self._perform_connect(connector_config, previous_keys)
else:
await self._perform_connect(connector_config)
Expand Down Expand Up @@ -138,7 +166,23 @@ async def _perform_connect(self, connector_config: ClientConfigAdapter, previous
Security.update_secure_config(connector_config)
err_msg = await self.validate_n_connect_connector(connector_name)
if err_msg is None:
self.notify(f"\nYou are now connected to {connector_name}.")
if connector_name.startswith("lighter"):
from hummingbot.connector.lighter_common.lighter_key_utils import fetch_lighter_public_key
new_keys = Security.api_keys(connector_name)
acct_idx = new_keys.get(f"{connector_name}_account_index") or ""
key_idx = new_keys.get(f"{connector_name}_api_key_index") or ""
public_key = await fetch_lighter_public_key(connector_name, acct_idx, key_idx)
if public_key:
self.notify(f"\nYou are now connected to {connector_name} (public key: {public_key}).")
else:
account_id = _lighter_account_index(new_keys)
msg = (
f"\nYou are now connected to {connector_name} (account index: {account_id})."
if account_id else f"\nYou are now connected to {connector_name}."
)
self.notify(msg)
else:
self.notify(f"\nYou are now connected to {connector_name}.")
safe_ensure_future(TradingPairFetcher.get_instance(client_config_map=ClientConfigAdapter).fetch_all(client_config_map=ClientConfigAdapter))
else:
self.notify(f"\nError: {err_msg}")
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions hummingbot/connector/derivative/lighter_perpetual/dummy.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cdef class dummy():
pass
2 changes: 2 additions & 0 deletions hummingbot/connector/derivative/lighter_perpetual/dummy.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cdef class dummy():
pass
Loading
Loading