Skip to content

Commit

Permalink
fixup! Feat/sepolia (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmellis committed Nov 14, 2023
1 parent b3dc303 commit 9e55e5e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/utils/src/prices/premiums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ export const estimatePremiumPrice = ({
vTokenToEth: bigint;
now: number;
}): [vToken: bigint, price: bigint] => {
const premiumThreshold = now - getChainConstant(PREMIUM_DURATION, network);
const premiumDuration = getChainConstant(PREMIUM_DURATION, network, 0);
const premiumThreshold = now - premiumDuration;

if (!holding || holding.dateAdded < premiumThreshold) {
return [Zero, Zero];
}

const maxPremium = 5 * 10 ** 18; // 5 vTokens
const timeStep = 60 * 60; // 1 hour
// const endValue = maxPremium * 2 ** (-PREMIUM_DURATION / timeStep)
const endValue = 4882812500000000;
const timeStep = 60 * 60;
const endValue = maxPremium * 2 ** (-premiumDuration / timeStep);
// const endValue = 4882812500000000;
const elapsed = now - holding.dateAdded;

const p = maxPremium * 2 ** (-elapsed / timeStep) - endValue;
Expand Down

0 comments on commit 9e55e5e

Please sign in to comment.