Skip to content

Commit

Permalink
modify active strategy filter
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed Feb 15, 2024
1 parent 7d477db commit e6d56af
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type StrategyProps = {
};

function isActiveStrategy([buy, sell]: readonly [Order, Order]) {
return !!buy.A || !!buy.B || !!sell.A || !!sell.B;
return !!buy.y || !!sell.y;
}

@PositionTemplate()
Expand Down Expand Up @@ -81,7 +81,10 @@ export class EthereumCarbonDefiStrategyContractPositionFetcher extends CustomCon
const strategies = await Promise.all(getStrategies).then(matrix => matrix.flat());
const definitions: StrategyDefinition[] = [];
for (const { id, owner, tokens, orders } of strategies) {
if (!isActiveStrategy(orders)) continue;
if (!isActiveStrategy(orders)) {
console.log('inactive', id);
continue;
}
definitions.push({ address, positionKey: id, owner, tokens });
}
return definitions;
Expand Down

0 comments on commit e6d56af

Please sign in to comment.