mirror of
https://github.com/ZigZagExchange/zksync-lite-market-maker.git
synced 2025-12-17 07:04:23 +01:00
Merge pull request #98 from TrooperCrypto/master
remove FEE_TOKEN if no longer available for fees
This commit is contained in:
@@ -199,18 +199,26 @@ async function handleMessage(json) {
|
||||
const newQuoteFee = MARKETS[marketId].quoteFee;
|
||||
console.log(`marketinfo ${marketId} - update baseFee ${oldBaseFee} -> ${newBaseFee}, quoteFee ${oldQuoteFee} -> ${newQuoteFee}`);
|
||||
if (FEE_TOKEN) break
|
||||
if(
|
||||
marketInfo.baseAsset.enabledForFees &&
|
||||
!FEE_TOKEN_LIST.includes(marketInfo.baseAsset.id)
|
||||
) {
|
||||
FEE_TOKEN_LIST.push(marketInfo.baseAsset.id);
|
||||
}
|
||||
if(
|
||||
marketInfo.quoteAsset.enabledForFees &&
|
||||
!FEE_TOKEN_LIST.includes(marketInfo.quoteAsset.id)
|
||||
) {
|
||||
FEE_TOKEN_LIST.push(marketInfo.quoteAsset.id);
|
||||
}
|
||||
if(marketInfo.baseAsset.enabledForFees) {
|
||||
if (!FEE_TOKEN_LIST.includes(marketInfo.baseAsset.id)) {
|
||||
FEE_TOKEN_LIST.push(marketInfo.baseAsset.id);
|
||||
}
|
||||
} else {
|
||||
const index = FEE_TOKEN_LIST.indexOf(marketInfo.baseAsset.id);
|
||||
if (index >= 0) {
|
||||
FEE_TOKEN_LIST.splice(index, 1);
|
||||
}
|
||||
}
|
||||
if(marketInfo.quoteAsset.enabledForFees) {
|
||||
if (!FEE_TOKEN_LIST.includes(marketInfo.quoteAsset.id)) {
|
||||
FEE_TOKEN_LIST.push(marketInfo.quoteAsset.id);
|
||||
}
|
||||
} else {
|
||||
const index = FEE_TOKEN_LIST.indexOf(marketInfo.quoteAsset.id);
|
||||
if (index >= 0) {
|
||||
FEE_TOKEN_LIST.splice(index, 1);
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user