Skip to content

Codex/create grid ladders dashboard page qx13wx#1018

Closed
carkod wants to merge 2 commits into
masterfrom
codex/create-grid-ladders-dashboard-page-qx13wx
Closed

Codex/create grid ladders dashboard page qx13wx#1018
carkod wants to merge 2 commits into
masterfrom
codex/create-grid-ladders-dashboard-page-qx13wx

Conversation

@carkod
Copy link
Copy Markdown
Owner

@carkod carkod commented May 20, 2026

No description provided.

Copy link
Copy Markdown

@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.

Reviewed commit: f6c0b5168d

ℹ️ 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 +50 to +55
return KucoinGridMarginRules(
futures_leverage=symbol_row.futures_leverage,
qty_precision=0,
multiplier=1,
lot_size=1,
taker_fee_rate=0,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use real symbol contract metadata for grid sizing

_build_margin_sizer hardcodes qty_precision=0, multiplier=1, lot_size=1, and taker_fee_rate=0, so ladder sizing is only correct for that exact contract shape. For symbols with different lot size/multiplier/fees, calculate_grid_levels will reserve the wrong margin and contract counts, which can admit ladders that are not actually affordable when exchange-truth sizing is applied. Populate these fields from exchange/symbol metadata (or reject unsupported symbols) before calculating levels.

Useful? React with 👍 / 👎.

Comment on lines +100 to +104
ladder = create_grid_ladder(
session,
symbol=payload.symbol,
fiat=payload.fiat,
exchange=payload.exchange,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make ladder and level inserts atomic

This flow creates and commits the ladder first, then inserts levels in a separate step; if level insertion fails, the ladder remains persisted without levels. Because active-ladder checks key off ladder status/symbol, that orphaned row can block new ladder creation for the symbol until manual cleanup. Create the ladder and levels in a single transaction (or explicitly rollback the ladder when level insertion fails) so partial writes are not left behind.

Useful? React with 👍 / 👎.

@carkod
Copy link
Copy Markdown
Owner Author

carkod commented May 20, 2026

Superseded by #1020

@carkod carkod closed this May 20, 2026
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.

1 participant