Skip to content

Question about minimum amount in createOrder #4914

Closed
@jackpotcityco

Description

OS: Windows 10
Programming Language version: Node.js
CCXT version: #465
Exchange: Coinegg
Node.js 11.9.0 installed
Method: createOrder

Hello!

I am trying to createOrder on exchange coinegg for ETH/BTC with below code:

(async () => {
    let exchange = new ccxt.coinegg(); // default id
    await exchange.loadMarkets();
    exchange.apiKey = "mypublicapikey";
    exchange.secret = "myprivateapikey";

    try {
        if (exchange.has['createOrder']) {

            const order = await exchange.createOrder("ETH/BTC", "limit", "buy", 0.01, 0.034);
            returnedvalue = JSON.stringify(order);
        }
    } catch (e) {

        if (e instanceof ccxt.NetworkError) {
            console.log(exchange.id + ' failed due to a network error:' + e.message);
        } else if (e instanceof ccxt.ExchangeError) {
            console.log(exchange.id + ' failed due to a exchange error:' + e.message);
        } else {
            console.log(exchange.id + ' failed with:' + e.message);
        }
    }
})();

The error I get when executing the code is:

coinegg failed due to a exchange error: 
coinegg Pending order amount must be above 0.001 BTC

When looking at the JSON response for coinegg (coinegg.load_markets). This can be seen in the minimum limit:
amount":{"min":1e-8 which is: (0.00000001)

As seen I put 0.01 in the amount parameter which is larger than: 0.00000001 ?
Then the error message says that amount must be above 0.001 BTC. I am not sure if something is wrong or if I miss something about the amount parameter?

If I change the amount to: 0.003, then it works. But then I assume the below, but that is "cost" and not amount?
0.03 * 0.034 = 0,00102 (greater than 0.001)

"ETH/BTC":{"limits":{"amount":{"min":1e-8,"max":100000000},
"price":{"min":1e-8,"max":100000000},"cost":{}},"precision":{"amount":8,"price":8},"taker":0.001,"maker":0.001,
"id":"ethbtc","symbol":"ETH/BTC","base":"ETH",
"quote":"BTC","baseId":"eth","quoteId":"btc","active":true,"info":["ETH","0.03529","0.03521911","0.03553505","0.035553",
"0.034155",12151,418.5931,2.26]}

Thank you!

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions