Skip to content

Feat/lighter connectors v3#2

Open
smartcrypto0 wants to merge 22 commits into
developmentfrom
feat/lighter-connectors-v3
Open

Feat/lighter connectors v3#2
smartcrypto0 wants to merge 22 commits into
developmentfrom
feat/lighter-connectors-v3

Conversation

@smartcrypto0
Copy link
Copy Markdown
Owner

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • Tests all pass
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

Tests performed by the developer:

Tips for QA testing:

smartcrypto0 and others added 22 commits April 8, 2026 01:03
…ifacts, fix MANIFEST.in

- Updated all lighter spot and perp connector files with April 21 QA-tested code
- Updated all lighter spot and perp unit tests to match new connector code
- Added NaN guard to perpetual_market_making to prevent crash on empty orderbook
- Removed vendored binary include lines from MANIFEST.in (*.dll *.so *.dylib)
- Removed dev testing scripts and JSON artifacts from scripts/
- All 234 lighter unit tests pass; 4731 total connector tests pass
- QA verified: Spot 6/6, Perp 18/18 on live mainnet (April 21, 2026)
… changes

- Rename lighter_api_key -> lighter_api_key_private_key and
  lighter_api_secret -> lighter_api_key_index in test fixtures
- Remove lighter_private_key kwarg (EOA removal)
- Rewrite test_get_signer_private_key_precedence_and_validation:
  now only _api_key is checked (no _private_key/_api_secret fallback)
- Rewrite test_get_api_key_index_and_account_index:
  now only _api_key_index attr is checked
- Wrap _update_balances() calls with assertRaises(IOError) for both
  success:False and empty data responses (implementation now raises)
- Apply same config field rename fixes to perp utils and derivative tests
  (remove lighter_perpetual_private_key field, EOA removal)

All 234 lighter connector tests pass.
… and hex key validation

- Add lighter_api_key_public_key optional param to LighterExchange.__init__()
- Store as self._api_key_public_key and use in authenticator property
  (falls back to account_index when not provided)
- Add _is_hex_private_key() to spot exchange, matching perp implementation
- Update _get_signer_private_key() to validate hex format before accepting key
- Add lighter_api_key_public_key field to LighterConfigMap (mainnet + testnet)
- Add lighter_perpetual_api_key_public_key field to LighterPerpetualConfigMap (mainnet + testnet)
- Add lighter_perpetual_api_key_public_key optional param to LighterPerpetualDerivative.__init__()
- All 4 connectors now consistently accept and use the public key credential
- Fix connect_command.py to handle previous_keys kwarg correctly
- Update all unit tests: 234 lighter tests pass, 6894/6895 full suite pass
  (1 failure is pre-existing decibel_perpetual unrelated to lighter)
…t orders, auth hardening, and test coverage improvements
- Fix F811 duplicate test method definitions in test_lighter_perpetual_derivative
- Remove F401 unused import in perpetual derivative test
- Fix false-cancel guard, partial-fill orphan, WS channel hardening
- Fix perp balance available field, stale cross-margin freeze
- Fix open order margin deduction local guard
- Fix unmatched private event reconcile for perp
- Add public key display in TUI connect command
- Improve balance_command derivative validator
- All 847 lighter connector tests pass, 82.76% coverage
@smartcrypto0 smartcrypto0 marked this pull request as ready for review May 4, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants