Skip to content

docs: replace buyAmount with minBuyAmount/maxBuyAmount split - #4

Open
jean-neiverth wants to merge 2 commits into
mainfrom
docs/min-max-buy-amount-split
Open

docs: replace buyAmount with minBuyAmount/maxBuyAmount split#4
jean-neiverth wants to merge 2 commits into
mainfrom
docs/min-max-buy-amount-split

Conversation

@jean-neiverth

Copy link
Copy Markdown
Contributor

Summary

Reflects the on-chain change from bleu/byos-contracts#38 and the design decisions from the byos-service-ts grill-me session.

  • design-document.md: Replace buyAmount with minBuyAmount/maxBuyAmount across proposal schema, order-flow diagrams, envelope check, simulation, scoring, solution shape, and residue. Add "Floor and ceiling" subsection under order-flow and "Post-settlement slippage accounting" subsection under penalties.
  • contracts.md: Update Trampoline floor references, Executed event signature (3 → 4 fields), FloorNotMet error description, and add post-settlement accounting to interaction description.
  • glossary.md: Update Proposal and Trampoline definitions. Add "Floor and ceiling" term.
  • guides/sub-solver-integration.md: Replace floor-margin guidance with floor/ceiling explanation. Add aggressive-slippage guidance, update signing section (7-field struct), add two pre-launch checklist items.
  • service.md: Update envelope check, add third penalty-loop path for slippage accounting, note buy_token_ref_price in solutions table, update surplus definition.

Test plan

Reflects the on-chain change from bleu/byos-contracts#38 and the
design decisions from the byos-service-ts grill-me session.

Key changes across all docs:
- ProposalData struct goes from 6 to 7 fields
- minBuyAmount is the on-chain revert floor (delta check)
- maxBuyAmount is the clearing-price commitment (scoring, gas cut, settlement)
- New envelope rules: sell orders enforce order.buyAmount <= minBuyAmount <= maxBuyAmount;
  buy orders hard-reject minBuyAmount != maxBuyAmount
- New post-settlement slippage accounting section under penalties
- solutions table stores buy_token_ref_price for ETH conversion
- Glossary adds "Floor and ceiling" term
- Sub-solver integration guide updated with aggressive-slippage guidance
… claim functions

Document the slippage ledger model (threshold clearing, credit payouts,
GET /slippage-balance endpoint) from byos-service-ts#48 across all docs.
Fix the stale nonce paragraph that claimed the Trampoline was storage-free
when nonces are enforced on-chain. Correct the residue section to reflect
that claimToken/claimTokens exist for non-trade-token strays. Add the
post-settlement-slippage-accounting anchor, fix the contracts.md link,
and explicitly call out partial-fill order support.
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