Skip to content

Implement SwapPayment model #41

Closed

Description

@codebestia

Represents a swap-routed payment where the payer pays in one token and the merchant settles in another. Specific to Shade's cross-asset capabilities.

Proposed Steps:

  • Create src/shade/models/swap.py.
  • Fields: id, pay_in_token, settle_out_token, amount_in: Decimal, amount_out: Optional[Decimal], routing_path: list[str], slippage_tolerance: float, status, stellar_tx_hash: Optional[str], created_at.
  • Add SwapStatus enum: pending, swapping, completed, failed, slippage_exceeded.
  • Validate 0 < slippage_tolerance < 1.

Acceptance Criteria:

  • SwapPayment.from_dict(...) populates all fields including routing path list.
  • slippage_tolerance outside (0, 1) raises ValueError.
  • status is a SwapStatus enum.

Activity

  1. GBOYEE commented on Jul 20, 2026

    @GBOYEE

    Greetings, I can handle this one. I'll implement it to spec and add tests. I'll open a PR referencing this shortly once assigned.

  2. sainath5001 commented on Jul 20, 2026

    @sainath5001

    Hi, I would like to work on this issue.

    I have worked on similar tasks before involving payment flows, token-based transactions, and model/schema implementations with validation logic. I’m familiar with designing data models, enums, serialization/deserialization (from_dict patterns), and handling validation constraints.

    I can implement the SwapPayment model, SwapStatus enum, and required validations according to the acceptance criteria.

  3. ALIPHATICHYD commented on Jul 20, 2026

    @ALIPHATICHYD
    Contributor

    Hi maintainer
    I'd love to work on this issue
    I have defi experience on this aspect

  4. grantfox-oss commented on Jul 21, 2026

    @grantfox-oss

    🦊 GrantFox — @ALIPHATICHYD has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #41)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  5. added a commit that references this issue on Jul 27, 2026
  6. grantfox-oss commented on Jul 27, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign | FWC26 campaign!

    @ALIPHATICHYD's PR #46 was approved and merged by @codebestia.

    🏆 @ALIPHATICHYD: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (254 total points). Track your full progress on GrantFox.

    👏 Great work, @ALIPHATICHYD! Keep contributing to ShadeProtocol.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions