Skip to content

Commit

Permalink
Refactor DCA order filtering logic
Browse files Browse the repository at this point in the history
Removed the current timestamp check from DCA order filtering in `getActiveDcaOrders`. This ensures that orders are filtered solely based on their `inUsed` and `inDeposited` values, improving the accuracy of the active orders list.
  • Loading branch information
skynetcap committed Oct 31, 2024
1 parent 482875e commit dc44af1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ public List<JupiterDca> getDcaAccounts(PublicKey user) {
}

public List<JupiterDca> getActiveDcaOrders() {
long now = Instant.now().getEpochSecond();
return getDcaAccounts().stream()
.filter(dca -> dca.getNextCycleAt() > now && dca.getInUsed() < dca.getInDeposited())
.filter(dca -> dca.getInUsed() <= dca.getInDeposited())
.collect(Collectors.toList());
}

Expand Down

0 comments on commit dc44af1

Please sign in to comment.