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

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Nov 14, 2025

No description provided.

Fixes #108: Default Hyperliquid venue ID may never be created
- Remove early return when existing venue has same (type, wallet) but different ID
- Always attempt to upsert the default venue (hyperliquid:default)
- Handle unique constraint violations gracefully with informative logging
- Ensures canonical default venue identifier exists or logs why it cannot

Fixes #107: Respect user-specified deal worker and resync settings
- Remove user-configurable flags for deal-workers and resync-interval
- Remove corresponding environment variable support
- These settings are now determined solely by ThreeCommas plan tier
- Prevents rate limit violations from user misconfiguration
- Users cannot override rate-limit-aware tier defaults
@terwey terwey force-pushed the claude/fix-open-issues-01GXGqSDu8SeCZDYSR2xA6WV branch from 0425ca0 to 02e4361 Compare November 14, 2025 17:01
- Update specs/rate_limit.adoc to clarify DealWorkers and ResyncInterval
  are tier-determined only, not user-configurable
- Update specs/multi_venue_emission.adoc to document conflict handling
  for default venue creation
- Add unit tests for #108 (default venue with conflicting user venue)
- Tests ensure issue #108 won't regress in the future
@terwey terwey force-pushed the claude/fix-open-issues-01GXGqSDu8SeCZDYSR2xA6WV branch from 02e4361 to 9c65fad Compare November 14, 2025 17:05
@terwey terwey changed the title Claude/fix open issues 01 gx gq s du8 se czdysr2x a6 wv FIx #107 and #108 Nov 14, 2025
@terwey terwey marked this pull request as ready for review November 14, 2025 17:10
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 180 to 186
existingVenue, err := s.queries.GetVenueByTypeAndWallet(ctx, sqlcgen.GetVenueByTypeAndWalletParams{
Type: defaultHyperliquidVenueType,
Wallet: wallet,
})
if err == nil {
// A venue with this (type, wallet) already exists.
// If it has a different ID than the default, we should use it instead of trying to create a duplicate.
if existingVenue.ID != string(defaultHyperliquidVenueID) {
// There's already a user-defined venue with this type and wallet.
// No need to create a separate default venue - just return success.
return nil
}
// The existing venue has the default ID, so we can proceed with the upsert.
} else if !errors.Is(err, sql.ErrNoRows) {
return err
}
hasConflictingVenue := err == nil && existingVenue.ID != string(defaultHyperliquidVenueID)

Choose a reason for hiding this comment

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

P1 Badge Handle errors when querying existing venues

The new logic queries GetVenueByTypeAndWallet to detect conflicting venues but ignores any error other than the implicit ErrNoRows. If this lookup fails (e.g., transient database failure), execution continues as though no error occurred and later code may return nil or a different error while the real cause is hidden. The previous implementation surfaced these errors, so this change regresses error handling and can mask storage failures. The function should still return the query error unless it is ErrNoRows.

Useful? React with 👍 / 👎.

Return errors from GetVenueByTypeAndWallet query unless they are
sql.ErrNoRows. The previous version silently ignored database failures
which could mask storage issues.
@terwey
Copy link
Collaborator Author

terwey commented Nov 14, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ 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 65dcddc into main Nov 14, 2025
1 check passed
@terwey terwey deleted the claude/fix-open-issues-01GXGqSDu8SeCZDYSR2xA6WV branch November 14, 2025 17:30
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.

3 participants