Skip to content

[Feature] Limit Order Execution via Off-Chain Keepers #174

Description

@AlAfiz

Description: Currently, TradeFlow only supports market orders. We want to allow users to place limit orders. The core contract must store the order intent, allowing off-chain "keepers" to execute the trade when the market price meets the order criteria.
Context / Motivation: Advanced traders require limit orders. Moving this on-chain allows TradeFlow to capture a more sophisticated demographic of DeFi users while rewarding keepers for network maintenance.
Acceptance Criteria: - [ ] Implement a create_limit_order function locking the user's input asset.

  • Implement an execute_limit_order function callable by anyone, which verifies the current pool price satisfies the order.
  • Route a small percentage of the input token as a bounty to the caller (keeper) of the execute function.
  • Allow users to cancel unexecuted limit orders.
    Technical Pointers: Store limit orders in persistent storage mapped by an incremental ID or user Address. Emit a Soroban event (Env::events().publish()) upon order creation so off-chain backend indexing (TradeFlow-API) can track them easily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaignhelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions