fix(pair): bound hybrid book leg in the no-belief slippage path (#273) #746
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!746
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/273-hybrid-noblief-slippage-floor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A hybrid swap with no
belief_pricewhose book leg fills materially worse than the pool fair rate was accepted — the no-belief metric measured only the pool leg's spread, so book degradation only enlarged the denominator. Folds the book leg's shortfall vs the pool's realized net rate (pool_net_return/pool_input) into the spread numerator.Direction 1 only (non-breaking; no
Swapschema change). Net-vs-net avoids false-rejecting a book that's only short by its own fee. Meets AC1/AC2/AC3. Formula chosen via an adversarial design pass; PoC drain → reject (0.83), legit hybrid → pass (0.0036), pool-only → #197 byte-identical.Directions 2 (
min_return) + 3 (mandatory belief/min_receive, the pure-pool_input==0case) are flagged on #273 as the frontend/router-coordinated follow-up — making the guard mandatory would break book swaps in the dapp until the frontend sends a floor.Tests: PoC
hybrid_no_belief_book_far_below_pool_rejected(fails pre-fix) + 2 max_spread unit tests. Suite 415/0.GitLab #273
mentioned in commit
016972a77b