Skip to content

Scope proposal: classify confirmed live spot exit residuals using execution evidence #370

Closed

Description

@AmazingZ-sys

Problem

A completed live spot exit can leave an exchange balance below a tradable increment. Treating that residual as an ordinary open strategy position can block shutdown/re-entry or keep health checks reporting exposure requiring another exit. Deleting the balance or fabricating a fill would also be incorrect.

Existing quick-trade balance dust metadata and the backtest lot-size fix #222 do not implement persistent evidence-based classification for live strategy exit residuals.

Proposed scope for maintainer agreement

  • Preserve exact stored quantities, cost evidence and exchange balances.
  • Classify only when a completed exit and exchange trading rules support the conclusion, with no active conflicting order.
  • Retain classification evidence and clear it when a real new fill changes exposure.
  • Keep ordinary strategies, grid/fill-ledger paths and trading venues explicitly scoped.
  • Agree on the durable representation, migration and threshold policy before implementation; do not promote a deployment-specific constant to a platform invariant.

Required regression coverage

  • A confirmed residual is distinguished from tradable exposure without changing its quantity.
  • Active orders, unsettled fills, missing evidence, locked balances and unrelated accounts are excluded.
  • A subsequent fill clears stale classification.
  • Health, position presentation and execution decisions agree on the classification.
  • Migration and rollback behavior are verified in an isolated database.

Please confirm this scope before implementation because it affects trading execution and persistent schema.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions