Switch grid ladders - #1142
Conversation
b994e24 to
6e27a38
Compare
6e27a38 to
3206612
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b994e242e6
ℹ️ 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".
| table, | ||
| sa.Column("enable_grid_ladders", sa.Boolean(), nullable=True), | ||
| ) | ||
| op.execute(f"UPDATE {table} SET enable_grid_ladders = false") |
There was a problem hiding this comment.
Expose the switch through the settings contract
The migration disables grid ladders for every deployment, but this commit only adds the field to the database model: PUT /autotrade-settings/bots still validates requests with the pinned pybinbot.AutotradeSettingsSchema, while terminal/src/features/autotradeApiSlice.ts and the Autotrade form omit the field. Consequently, operators cannot re-enable pending ladders through the shipped API/dashboard and must modify the database directly; update the shared settings contract and terminal control alongside this default-off migration.
AGENTS.md reference: AGENTS.md:L9-L15
Useful? React with 👍 / 👎.
| self.crud.update_logs( | ||
| ladder.id, | ||
| { | ||
| "event": "grid_ladders_disabled", | ||
| "reason": "enable_grid_ladders is off; leaving pending until enabled", | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Avoid logging the disabled state on every lifecycle pass
When the switch remains off and a pending ladder exists, streaming/main.py revisits its symbol on every loop and this branch appends another identical entry to the ladder's JSON logs column each time. Over a prolonged disablement this produces thousands of database writes and an ever-growing log payload that is returned by ladder reads; record the transition once or suppress consecutive duplicate disabled events.
Useful? React with 👍 / 👎.
No description provided.