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

Open leveraged margin position #666

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

Open leveraged margin position #666

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 open_margin_position function, which allows our users to use our pools to open bigger positions.

  • Verify that tokens provided by user are on Pragma, validate allowance and amount, check that tokens have different addresses. User can't have more than one active position at once.
  • Calculate how much our user needs to borrow from our pools using appropriate internal function, if this amount is bigger than we have in our pools, throw an error.
  • Take calculated amount from the pool by subtracting it from the correct storage entry.
  • Transfer token from the user
  • Swap calculated amount on Ekubo
  • Write Position structure to the storage
  • Add reentrancy guard
  • Write tests and docstring
@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 backend and smart contract technologies(solidity, cairo and rust).

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

@Daveside9
Copy link

i will love to take on this, I will implement the open_margin_position function, ensuring proper validation, borrowing logic, token transfers, swaps, and storage updates while securing it with a reentrancy guard. I will also write comprehensive 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