ts-client: Fix serum taker fee computation (#573)
This commit is contained in:
parent
2f4976e81f
commit
3600b6592c
|
@ -81,7 +81,7 @@ export class Serum3Market {
|
|||
this.name === 'USDT/USDC'
|
||||
? { maker: -0.5, taker: 1 }
|
||||
: { maker: -2, taker: 4 };
|
||||
return taker ? ratesBps.maker * 0.0001 : ratesBps.taker * 0.0001;
|
||||
return taker ? ratesBps.taker * 0.0001 : ratesBps.maker * 0.0001;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1612,12 +1612,12 @@ export class MangoClient {
|
|||
const limitPrice = serum3MarketExternal.priceNumberToLots(price);
|
||||
const maxBaseQuantity = serum3MarketExternal.baseSizeNumberToLots(size);
|
||||
const isTaker = orderType !== Serum3OrderType.postOnly;
|
||||
const maxQuoteQuantity = new BN(
|
||||
const maxQuoteQuantity = new BN(Math.ceil(
|
||||
serum3MarketExternal.decoded.quoteLotSize.toNumber() *
|
||||
(1 + Math.max(serum3Market.getFeeRates(isTaker), 0)) *
|
||||
serum3MarketExternal.baseSizeNumberToLots(size).toNumber() *
|
||||
serum3MarketExternal.priceNumberToLots(price).toNumber(),
|
||||
);
|
||||
));
|
||||
|
||||
const payerTokenIndex = ((): TokenIndex => {
|
||||
if (side == Serum3Side.bid) {
|
||||
|
|
Loading…
Reference in New Issue