Skip to content

Integrate Ekubo Swapping #4

Description

@josephchimebuka

Develop a Cairo function that integrates with the Ekubo protocol to perform token swaps inside the SwapX contract. The function should:

  • Be named swap_token_to_stable(token_in, token_out, amount_in)
  • Use the Ekubo Router interface to perform the actual swap (see: [Ekubo Integration Guide](https://docs.ekubo.org/integration-guides/swapping))
  • Assume that token_in has already been deposited by the user into the SwapX contract
  • Update internal user balances to reflect the change in tokens (decrease token_in, increase token_out)
  • Emit a TokenSwapped(user, token_in, token_out, amount_in, amount_out) event to signal the result of the swap

This feature enables conversion to stablecoins, which is essential for off-ramping.

Metadata

Metadata

Assignees

Type

No type
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