Skip to content

Commit

Permalink
Logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwschau committed Oct 25, 2024
1 parent 7af7388 commit eefff3e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ function aggregateVaultPnlTicks(
const vaultCreationTimes: DateTime[] = _.map(vaults, 'createdAt').map(
(createdAt: string) => { return DateTime.fromISO(createdAt); },
).sort((a: DateTime, b: DateTime) => { return a.diff(b).milliseconds; });
console.log(JSON.stringify(vaultCreationTimes));
return aggregatedPnlTicks.filter((aggregatedTick: AggregatedPnlTick) => {
// Get number of vaults created before the pnl tick was created by binary-searching for the
// index of the pnl ticks createdAt in a sorted array of vault createdAt times.
Expand All @@ -666,6 +667,7 @@ function aggregateVaultPnlTicks(
DateTime.fromISO(aggregatedTick.pnlTick.createdAt),
(a: DateTime, b: DateTime) => { return a.diff(b).milliseconds; },
) + 1;
console.log(`Num vaults created: ${numVaultsCreated}, num ticks: ${aggregatedTick.numTicks}, createdAt: ${aggregatedTick.pnlTick.createdAt}`)
// Number of ticks should be strictly greater than number of vaults created before it
// as there should be a tick for the main vault subaccount.
return aggregatedTick.numTicks > numVaultsCreated;
Expand Down

0 comments on commit eefff3e

Please sign in to comment.