Skip to content

Implement batch buy and sell operations for gas-efficient multi-key trading #1003

Description

@Chucks1093

Summary

Add batch buy and sell functions to the platform contract allowing users to execute trades across multiple creator keys in a single transaction, reducing total gas cost.

Scope

  • batch_buy(orders[{key_id, amount, max_slippage_bps}]) — executes all or reverts
  • batch_sell(orders[{key_id, amount, min_slippage_bps}]) — executes all or reverts
  • Per-order error returned if any single order fails (partial fill mode optional)
  • Total fee and net cost returned in response
  • BatchTradeExecuted event emitted with order count and total volume

Acceptance Criteria

  • All orders execute atomically or entire batch reverts in strict mode
  • Slippage protection applied per order within batch
  • Per-order fee computed correctly in batch context
  • BatchTradeExecuted event includes correct order count and volume
  • Partial fill mode returns per-order success or failure flags

ETA

24 hours

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions