Skip to content

Commit

Permalink
Merge branch 'staging' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
micahalcorn committed Jul 3, 2023
2 parents dd07e0c + 6322ce9 commit 9b46434
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions client/components/vote-escrow/LockupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,8 @@ const LockupForm: FunctionComponent<LockupFormProps> = ({ existingLockup }) => {
// as specified here: https://github.com/OriginProtocol/ousd-governance/blob/master/contracts/OgvStaking.sol#L21
const votingDecayFactor = 1.8;

// block.timestamp of when OgvStaking.sol was launched
const epoch = 1657584000;
const duration = lockupDuration * SECONDS_IN_A_MONTH;
// Since we'll be using blockTimestamp from CURRENT block, calculation will be
// a hair outdated... but it's negligible
const start = blockTimestamp > epoch ? blockTimestamp : epoch; // In prod, should always be blockTimestamp
const end = start + duration;
const dist = end - epoch; // Distance between end of staking period and the very beginning when staking was launched
const multiplier = dist / 365 / 86400;
const veOgvFromOgvLockup = lockupAmount * votingDecayFactor ** multiplier;
const veOgvFromOgvLockup =
lockupAmount * votingDecayFactor ** (lockupDuration / 12);

const ogvLockupRewardApy = getRewardsApy(
veOgvFromOgvLockup,
Expand Down

0 comments on commit 9b46434

Please sign in to comment.