Skip to content

Fix sell ladder prep sizing from slot prices#151

Merged
Lowestofttim merged 2 commits into
mainfrom
codex/sell-prep-slot-prices
Jun 23, 2026
Merged

Fix sell ladder prep sizing from slot prices#151
Lowestofttim merged 2 commits into
mainfrom
codex/sell-prep-slot-prices

Conversation

@Lowestofttim

Copy link
Copy Markdown
Collaborator

Summary

  • Add shared ladder sizing helpers so offer creation, tier classification, coin prep, frontend validation, and Smart Defaults use the same generated sell-slot prices.
  • Update sell-side CAT prep sizing to use each tier's generated max CAT-per-slot instead of tier_xch / mid.
  • Add regression coverage for the reported wide SBX-style ladder mismatch.

Local verification

  • python -m pytest tests/test_sell_ladder_sizing.py -q -> 4 passed
  • python -m pytest tests/test_sell_ladder_sizing.py tests/test_plan_02_14_coin_manager_unit.py tests/test_plan_04_06_coin_prep_endpoints.py tests/test_offer_manager_coin_ids.py tests/test_plan_04_10_smart_defaults_endpoint.py -q -> 155 passed
  • SBX-style local check: naive mid estimate 10,000,000 CAT; live slot-price deployment 5,598,838 CAT; prepared tier-max with 10% headroom 6,901,920 CAT.

Notes

This fixes the current XCH-value sell mode's prep/validation mismatch. A separate token-budget sell mode would still be a product feature rather than part of this bugfix.

Comment thread tests/test_sell_ladder_sizing.py Fixed
@Lowestofttim Lowestofttim force-pushed the codex/sell-prep-slot-prices branch from af38393 to 74d9105 Compare June 23, 2026 11:22
@Lowestofttim Lowestofttim marked this pull request as ready for review June 23, 2026 11:27

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

Copy link
Copy Markdown

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: 74d91052f7

ℹ️ 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 thread src/catalyst/coin_prep_worker.py Outdated
Comment thread src/catalyst/blueprints/smart_defaults.py
@Lowestofttim Lowestofttim merged commit 4df2fd2 into main Jun 23, 2026
9 checks passed
@Lowestofttim Lowestofttim deleted the codex/sell-prep-slot-prices branch June 23, 2026 16:29
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