Skip to content

Rename position_deal to lifecycle to conform with grid ladders convention#1064

Merged
carkod merged 4 commits into
masterfrom
rename-position-deal
Jun 17, 2026
Merged

Rename position_deal to lifecycle to conform with grid ladders convention#1064
carkod merged 4 commits into
masterfrom
rename-position-deal

Conversation

@carkod

@carkod carkod commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Closes #1058

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the KuCoin futures “PositionDeal” implementation and call sites to use the exchange_apis.kucoin.futures.lifecycle module name (instead of position_deal), aligning naming with the grid ladders lifecycle convention, while also introducing new trailing-stop reconciliation/cooldown behavior in the KuCoin futures lifecycle.

Changes:

  • Renamed/retargeted imports and monkeypatch paths from exchange_apis.kucoin.futures.position_deal to exchange_apis.kucoin.futures.lifecycle.
  • Added trailing-stop replace cooldown logic and tightened stop-order handling (track trailing order id, selectively cancel trailing stop, filter exchange stop queries by order id).
  • Expanded test coverage around trailing-stop reconciliation, cooldown gating, and “tracked trailing order” behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/exchange_apis/kucoin/futures/lifecycle.py Adds trailing-stop cooldown and “tracked trailing stop” reconciliation/placement behavior; updates class framing to “lifecycle”.
api/exchange_apis/kucoin/futures/futures_deal.py Adds shared stop-order utilities (terminal statuses, tracked stop lookup, selective trailing cancel, exchange stop query by order id, configurable cooldown).
api/tests/test_kucoin_futures_stop_loss.py Updates imports/monkeypatch targets and adds multiple regression tests for trailing-stop tracking/cooldown behavior.
api/tests/test_futures_reversal_integration.py Updates PositionDeal import and monkeypatch target to the new module path.
api/tests/test_bot_model_defaults.py Updates PositionDeal import path.
api/tests/test_anti_wick_exit.py Updates PositionDeal import path.
api/deals/gateway.py Updates PositionDeal import path used by deal routing.
api/bots/routes.py Updates PositionDeal import path used by bot routes.
Comments suppressed due to low confidence (1)

api/exchange_apis/kucoin/futures/lifecycle.py:48

  • The PR description/title focuses on renaming position_deallifecycle, but this diff also introduces new trailing-stop replacement behavior (cooldown + selective cancellation + new reconciliation rules). Please update the PR description (or split into a separate PR) so reviewers/operators can evaluate the behavioral change explicitly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/exchange_apis/kucoin/futures/futures_deal.py
Comment thread api/exchange_apis/kucoin/futures/futures_deal.py
@carkod carkod merged commit 6593b82 into master Jun 17, 2026
14 checks passed
@carkod carkod deleted the rename-position-deal branch June 17, 2026 11:59
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.

Rename position_deal to lifecycle

2 participants