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

Selling USDT for ETH #67

Open
BronacusAmmon opened this issue Apr 14, 2020 · 6 comments
Open

Selling USDT for ETH #67

BronacusAmmon opened this issue Apr 14, 2020 · 6 comments

Comments

@BronacusAmmon
Copy link

Hello I've gotten the script working for buying USDT with ETH but when I try and sell the USDT for ETH I get insufficient funds error, even though I am sure I have more USDT than the 3 it would require for this test to submit an order, does anyone have suggestions?

const KrakenClient = require('kraken-api'); const kraken = new KrakenClient(key, secret); var vend = "sell"; var volume = 0.2; var price = 15; (async () => { // Get Ticker Info //var value = await kraken.api('AddOrder', { pair : 'ETHUSDT', type : ${type}, orderType: 'limit', price: ${price}, volume : ${volume}}); var value = await kraken.api('AddOrder', { pair : 'ETHUSDT', type : ${vend}, ordertype: 'limit', price: ${price}, volume: ${volume} }); var arrays = JSON.stringify(value); console.log(arrays); })();

@kroitor
Copy link

kroitor commented Apr 14, 2020

@MallyxTheZealous current price for ETH is around $160. If you set $15 – that's too big of a discrepancy between your price and the actual price. If you really want to spend $3 (and want your order to be closed in some short time), you should set price = near current price (say, 160), and amount (volume) = 3 / 160 = 0.01875. Apart from that it could be related to min limits for the order size. You might want to reach out to Kraken techsupport for an answer then.

@BronacusAmmon
Copy link
Author

BronacusAmmon commented Apr 14, 2020

Thanks @kroitor, I'll try changing the price, I don't want to actually fill this order I'm just trying to make sure it works. Still getting insufficient funds at 0.2 for 155, but I have 50 USDT in the account so I think its something else

@kroitor
Copy link

kroitor commented Apr 14, 2020

@MallyxTheZealous hold on, you can't sell USDT with the ETH/USDT market. You can only buy ETH (for USDT) and sell ETH (for USDT).

Therefore if you have USDT – you can buy ETH, but if you don't have ETH – you can't sell ETH. And you're trying to sell ETH, so, you should be checking your ETH balance, not the USDT balance.

If your ETH balance is zero and you're selling ETH – that's insufficient funds to sell (cannot sell more ETH than you have).

@BronacusAmmon
Copy link
Author

I just checked the tickers you were absolutely right I had gotten the base currencies reversed, thank you for your help

@tuxun
Copy link

tuxun commented Jan 10, 2022

Hello, there, nice discussion, I'm glad to see the problem is solved 👍
Should "we" close the issue? and tag it? It would help the maintainer @BronacusAmmon

@dscotese
Copy link

The maintainer is no longer maintaining this repo. I forked it to https://github.com/dscotese/kraka-djs so that I could add CancellAll, which I have done.

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

4 participants