added referrer rebates accrued to calculations

This commit is contained in:
dd 2021-06-22 09:25:17 -04:00
parent 2950e7c7b8
commit ecd854f601
1 changed files with 4 additions and 1 deletions

View File

@ -74,7 +74,9 @@ async function balanceWallets(
for (let i = 0; i < NUM_MARKETS; i++) { for (let i = 0; i < NUM_MARKETS; i++) {
const oo = liqorOpenOrders[i]; const oo = liqorOpenOrders[i];
if ( if (
parseFloat(oo.quoteTokenTotal.toString()) > 0 || parseFloat(oo.quoteTokenTotal.toString()) +
parseFloat(oo['referrerRebatesAccrued'].toString()) >
0 ||
parseFloat(oo.baseTokenTotal.toString()) > 0 parseFloat(oo.baseTokenTotal.toString()) > 0
) { ) {
console.log( console.log(
@ -364,6 +366,7 @@ async function runPartialLiquidator() {
} }
const marketVal = const marketVal =
openOrdersAccount.quoteTokenTotal.toNumber() + openOrdersAccount.quoteTokenTotal.toNumber() +
openOrdersAccount['referrerRebatesAccrued'].toNumber() +
openOrdersAccount.baseTokenTotal.toNumber() * prices[i]; openOrdersAccount.baseTokenTotal.toNumber() * prices[i];
if (marketVal > maxMarketVal) { if (marketVal > maxMarketVal) {
maxMarketIndex = i; maxMarketIndex = i;