Codex/create grid ladders dashboard page qx13wx#1018
Conversation
There was a problem hiding this comment.
💡 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".
| return KucoinGridMarginRules( | ||
| futures_leverage=symbol_row.futures_leverage, | ||
| qty_precision=0, | ||
| multiplier=1, | ||
| lot_size=1, | ||
| taker_fee_rate=0, |
There was a problem hiding this comment.
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 👍 / 👎.
| ladder = create_grid_ladder( | ||
| session, | ||
| symbol=payload.symbol, | ||
| fiat=payload.fiat, | ||
| exchange=payload.exchange, |
There was a problem hiding this comment.
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 👍 / 👎.
|
Superseded by #1020 |
No description provided.