Skip to content

Commit

Permalink
bittrex ceiling order type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 19, 2021
1 parent 4fa8a8f commit 2cacccf
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions js/bittrex.js
Expand Up @@ -759,13 +759,20 @@ module.exports = class bittrex extends Exchange {
const isCeilingMarket = (uppercaseType === 'CEILING_MARKET');
const isCeilingOrder = isCeilingLimit || isCeilingMarket;
if (isCeilingOrder) {
let cost = this.safeFloat2 (params, 'ceiling', 'cost');
params = this.omit (params, [ 'ceiling', 'cost' ]);
if (cost === undefined) {
if (price === undefined) {
cost = amount;
} else {
cost = amount * price;
let cost = undefined;
if (isCeilingLimit) {
request['limit'] = this.priceToPrecision (symbol, price);
cost = this.safeFloat2 (params, 'ceiling', 'cost', amount);
params = this.omit (params, [ 'ceiling', 'cost' ]);
} else if (isCeilingMarket) {
cost = this.safeFloat2 (params, 'ceiling', 'cost');
params = this.omit (params, [ 'ceiling', 'cost' ]);
if (cost === undefined) {
if (price === undefined) {
cost = amount;
} else {
cost = amount * price;
}
}
}
request['ceiling'] = this.costToPrecision (symbol, cost);
Expand Down

0 comments on commit 2cacccf

Please sign in to comment.