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

Close leveraged margin position #665

Open
djeck1432 opened this issue Feb 26, 2025 · 2 comments
Open

Close leveraged margin position #665

djeck1432 opened this issue Feb 26, 2025 · 2 comments

Comments

@djeck1432
Copy link
Owner

You will create the main part of contract logic by implementing close_position function, where we will put the debt token back in our pool and return to the user part they earned.

  • Check position is open
  • Write position as closed in the storage, save the needed values for later use in the current function
  • Add debt amount to the debt token pool
  • Swap debt amount on Ekubo using exact-output swap(from traded_token to debt_token)
  • Transfer to the user initial_amount + traded_amount - swapped_amount of the base token they opened position with
  • Write tests and docstrings
@covenantebube
Copy link

GM, my name is covenant, a returning contributor on this platform, and i will love to take up this issue as i am very proficient in frontend and smart contract technologies.

I Like pineapple
Telegram handle: wisdom@704093
ETA: 12hrs

@Daveside9
Copy link

please let me take on this, I will implement the close_position function, ensuring proper position validation, debt repayment, token swaps on Ekubo, user fund returns, and storage updates. I will also write tests and documentation.

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

No branches or pull requests

3 participants