Repository navigation
feat(trading): add atomic batch swaps and quotes - #1129
damilare0813 wants to merge 4 commits into
Conversation
|
@damilare0813 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
✅ PR Ready for ReviewDue to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging. This PR has passed all automated checks:
Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514 |
1 similar comment
✅ PR Ready for ReviewDue to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging. This PR has passed all automated checks:
Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514 |
|
Note for maintainers: I merged origin/main into this branch and fixed batch_trade.rs to match main's signatures for compute_trade_fee and compute_sell_proceeds (commit b278b81). The batch tests have NOT been run, because creator-keys does not compile on main: ContractError assigns discriminant 148 twice (NoRetirementProposed and CircuitBreakerActive). That is a main bug outside this PR and needs fixing on main first. No reviewer requests were on the PR. |
|
@Chucks1093 Synced this PR with the latest |
✅ PR Ready for ReviewDue to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging. This PR has passed all automated checks:
Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514 |
Summary
Add atomic
batch_swap(trader, items)for up to 15 buys and sells, with each item's existing spot-price slippage convention. A later failure rolls back earlier fills, balances, fees and events.get_batch_quoteprices items in order with virtual supplies, including repeated keys, and the execution receipt reports per-item output, price impact and summed fees.The batch authorizes its trader once and reuses the existing buy core and a shared sell core. Public
batch_sellretains its authorization and behavior. Seedocs/batch-swaps.mdfor API, quote and fee semantics.Closes #1094.
Validation
-D warnings, formatting and diff checks passed.