Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Nov 4, 2025

Summary

  • ensure missing venue submissions trigger create replays even when modify/cancel actions are emitted for existing venues
  • stage per-venue emission plans so tracker adjustments and scaling apply to both primary and replayed actions

Bug context

P1 Badge Missing replay for venues that never saw initial create

The new multi‑venue loop only attempts to replay a create when reduceOrderEvents returns shouldEmit == false. When at least one submission already exists, hasLocalOrder becomes true and reduceOrderEvents will emit modify/cancel actions for subsequent events. Because replayMissingTargets is only computed when !shouldEmit, the branch that converts the action to a create for missingTargets is never taken in this case, and resolveOrderTargets skips the venues with no recorded submission. If a create to one venue fails (or a venue was added after the first create) and a modify/cancel event arrives before a no‑op poll, the engine will never send a create for the missing venue, leaving that venue permanently out of sync. The dispatcher rejects work for unregistered venues, but this code path simply omits the work entirely. Consider replaying missing venue submissions even when the current 3Commas action is modify/cancel.

Read specs/multi_venue_emission.adoc


https://chatgpt.com/codex/tasks/task_e_6909752e80088326acc171ddcf989f9a

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +345 to +352
for _, emission := range emissions {
action := emission.action
latestForEmission := emission.latest
emit := true

if fillSnapshot != nil && latestForEmission != nil {
action, emit = e.adjustActionWithTracker(currency, oid, *latestForEmission, action, fillSnapshot, orderLogger, emission.skipExisting)
if !emit {

Choose a reason for hiding this comment

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

P1 Badge Skip tracker-driven take-profit adjustments without 3C action

The call to adjustActionWithTracker now runs only inside the for _, emission := range emissions loop. Because an emission is added earlier only when shouldEmit or needsReplay is already true, any order where reduceOrderEvents returns ActionNone but the fill tracker needs to create/resize a take-profit (the common case when a position changes with no new 3Commas events) no longer reaches this block. In the previous version the tracker adjustment executed before deciding whether to emit and could flip ActionNone into a create/modify. After this refactor those tracker-driven actions are silently skipped, so take-profit orders will stop being placed or resized when the tracker is the only source of change.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@codex provide a fix, keep the spec in mind specs/multi_venue_emission.adoc

Choose a reason for hiding this comment

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

Summary

  • Reapplied fill tracker adjustments before emission gating so tracker-driven take-profit changes can still promote ActionNone into creates or modifies when no direct 3Commas action is pending. engine/engine.goL286-L303

Testing

  • ⚠️ go test ./... (terminated after hanging in the container).
  • ⚠️ go test ./engine... (terminated after hanging in the container).

View task →

Reapplied fill tracker adjustments before emission gating so tracker-driven take-profit changes can still promote ActionNone into creates or modifies when no direct 3Commas action is pending.
@terwey
Copy link
Collaborator Author

terwey commented Nov 4, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@terwey terwey merged commit bddc312 into codex/investigate-multi-wallet-support-for-hyperliquid Nov 4, 2025
1 check passed
@terwey terwey deleted the codex/github-mention-featvenues-add-venue-aware-order-identifi branch November 4, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants