fix: timestamp

This commit is contained in:
Kirill Litvinov
2024-03-12 13:44:14 +03:00
parent 5cb1bfb9d9
commit c814d41dc1
3 changed files with 5 additions and 5 deletions

View File

@@ -119,10 +119,10 @@ class IndexerService {
};
readonly getAmountAt = (amount: number, timestamp?: number): BigNumber => {
const currentTime = Date.now() / 1000;
const finalTimestamp = timestamp !== undefined ? timestamp / 1000 : Date.now() / 1000;
// sqrt
return BigNumber(amount).dividedBy(this.getK(timestamp ?? currentTime));
return BigNumber(amount).dividedBy(this.getK(finalTimestamp));
};
/**