Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Margin] Add ekubo swap method #695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

CBoYXD
Copy link
Collaborator

@CBoYXD CBoYXD commented Mar 2, 2025

No description provided.

@CBoYXD CBoYXD requested a review from faurdent March 2, 2025 13:41
@CBoYXD CBoYXD linked an issue Mar 2, 2025 that may be closed by this pull request
Copy link
Collaborator

@faurdent faurdent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also miss the composite type with data required for the swap(PoolKey, slippage limits and price for this pool, we are collecting this data on the backend). We will pass it to functions that utilize swap functionality to keep everything swap-related in one place.

treasury_balances: Map<(ContractAddress, ContractAddress), TokenAmount>,
pools: Map<ContractAddress, TokenAmount>,
positions: Map<ContractAddress, Position>,
}


#[generate_trait]
impl InternalImpl of InternalTrait {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to implement Locker trait which will contain the swap logic



#[derive(Copy, Drop, Serde)]
pub struct SwapResult {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we need it there as we will only return Delta. You can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MarginContract] Ekubo integration
2 participants