fixed maxQuoteQuantity bug
This commit is contained in:
parent
664d4f70cd
commit
22a313e02b
|
@ -842,9 +842,9 @@ export class MangoClient {
|
||||||
|
|
||||||
const feeTier = getFeeTier(0, nativeToUi(mangoGroup.nativeSrm || 0, SRM_DECIMALS));
|
const feeTier = getFeeTier(0, nativeToUi(mangoGroup.nativeSrm || 0, SRM_DECIMALS));
|
||||||
const rates = getFeeRates(feeTier);
|
const rates = getFeeRates(feeTier);
|
||||||
const maxQuoteQuantity = new BN(spotMarket['_decoded'].quoteLotSize.toNumber() * rates.taker).mul(
|
const maxQuoteQuantity = new BN(
|
||||||
spotMarket.baseSizeNumberToLots(size).mul(spotMarket.priceNumberToLots(price)),
|
spotMarket['_decoded'].quoteLotSize.toNumber() * (1 + rates.taker),
|
||||||
);
|
).mul(spotMarket.baseSizeNumberToLots(size).mul(spotMarket.priceNumberToLots(price)));
|
||||||
|
|
||||||
if (maxBaseQuantity.lte(new BN(0))) {
|
if (maxBaseQuantity.lte(new BN(0))) {
|
||||||
throw new Error('size too small')
|
throw new Error('size too small')
|
||||||
|
|
Loading…
Reference in New Issue