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

What is "position_idx" in the deposit function? #22

Open
steven4354 opened this issue Aug 31, 2021 · 1 comment
Open

What is "position_idx" in the deposit function? #22

steven4354 opened this issue Aug 31, 2021 · 1 comment

Comments

@steven4354
Copy link

Hi I was wondering what the position_idx input here in the deposit function is and how I can get it?

position_idx: Numeric.Input,

We are trying to use mirror js to interact with mirror but after reading searching the docs and testing out the mirror js deposit function for several hours, we are stuck on the position_idx input, it seems we are providing the wrong value (based on our error msg)

How do I get this position_idx input? Thank you!

@crypt0grapher
Copy link

crypt0grapher commented Feb 10, 2022

Hi,
position_idx represents a Collateral Debt Position (CDP) and Mirror's Mint contract handles that.
You get this value on opening a position with mirror.mint.openPosition where mint is an instance of the mirror.js Mirror class (that's part of a short farming flow on the Web App) and provide it to perform activities on your position.

Like in your case, depositing collateral to a CDP would obviously require a position_idx identifying that CDP you're going to update.

I'm sure you've already found the answer, but let me post this here just in case someone's searching for the same.
Not sure if issues are the right place to talk about that though ;)
You might wanna close this one and visit project Discord for questions as an option.

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

No branches or pull requests

2 participants