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

How to "sell all" for a particular product? #440

Open
jsho5150 opened this issue May 13, 2021 · 1 comment
Open

How to "sell all" for a particular product? #440

jsho5150 opened this issue May 13, 2021 · 1 comment

Comments

@jsho5150
Copy link

Not an issue, but I was wondering if someone could provide an example of the simplest way to sell all of the units of a particular coin through when using this tool. (Just Market order sell is fine.)

Basically I created script that uses this library to buy an unknown number of units at a specified price and then I attempt to sell them later on, but I don't know how many that I currently own. (I was hoping to avoid making calls that deal with pagination as I don't yet understand how to deal with the returned data in those cases.)

I tried just setting a high value for the "funds" argument in my order sell call, but that only works part of the time. (Other times I get an "insufficient funds" response.

Sorry if I should be posting questions via some other method, but I don't use github very often.

Thanks

@sachin-aag
Copy link

I guess the easiest way would be to use get__accounts to find the amount of currency you have. Then you can place a sell market order with the size argument instead of the funds argument.

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