docs: AfterSwap commission_amount excludes book fees (L7) #80
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#80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
security-hardening (integrator clarity)
Evidence
SECURITY_REVIEW.mdSC-01; invariant L7Acceptance criteria
docs/integrators.md(or hook README) states pool-leg-only commission in hooks for hybrid txsEpic
#60
marked this issue as related to #60
marked this issue as related to #63
@brouie Please verify: added docs/integrators.md (L7 hybrid hooks, limit-book 50/50 fees, max_spread/belief semantics), linked from docs/README.md, and tightened SC-08 evidence in docs/reviews/20260409T030009Z/SECURITY_REVIEW.md. Pair has new max_spread regression tests in contract.rs (hybrid denominator + belief path). Run: cargo test -p cl8y-dex-pair
Added
smartcontracts/contracts/hooks/README.mdstating that on hybrid swapsAfterSwap.commission_amount/spread_amountare pool-leg only, with pointer todocs/integrators.md(L7). The integrators doc already described this; hook crate README now surfaces it for implementers.Implemented in
main(commitc262c42). @brouie please review.@PlasticDigits Verified on current main. Acceptance criteria:
docs/integrators.md (line 5 'Hybrid swaps and post-swap hooks (invariant L7)') -- explicitly states commission_amount is 'Pool leg only — CW20 amount sent to treasury from the constant-product leg' (line 12). Line 15: 'Book-side fees are collected inside the book match path (limit_order_fill events, treasury transfers in token0/token1 per side). Do not treat commission_amount in AfterSwap as the full protocol fee for the transaction.' Canonical refs to contracts-security-audit.md (L7) and limit-orders.md on line 17. Linked from docs/README.md line 9.
smartcontracts/contracts/hooks/README.md line 5 'AfterSwap fields on hybrid swaps (invariant L7)' -- states commission_amount and spread_amount are pool-leg only, total user output in return_asset.amount includes book net + pool net, taker fees attributed on limit_order_fill events. Points to docs/integrators.md.
Security review: SC-01 (line 11) and SC-08 (line 79) both present in docs/reviews/20260409T030009Z/SECURITY_REVIEW.md, evidence tightened per dev comment.
Integrator clarity on L7 properly documented at both the integrator doc level and hook README level. Closing.
mentioned in issue #96
mentioned in issue #100
mentioned in issue #196