Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add multiplier to kerosine DV #130

Closed
wants to merge 6 commits into from
Closed

Conversation

gnkz
Copy link

@gnkz gnkz commented Dec 3, 2024

This PR adds a new way to calculate the kerosine denominator so

KerosineDV = (tvl - x*dyadSupply) / kerosineSupply

Where x can be set by the owner to be applied over time

@gnkz gnkz requested a review from coffeexcoin December 3, 2024 17:33
@gnkz gnkz changed the title feat: add multiplier to denominator feat: add multiplier to kerosine DV Dec 3, 2024
@gnkz gnkz marked this pull request as ready for review December 4, 2024 12:49

uint256 dyadSupply = DYAD.totalSupply();

uint256 tvl = _getTvl();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a super expensive operation - are we able to bypass the check for TVL and instead just multiply the adjusted kerosene supply by dyadMultiplier?

For instance for 1.25x:

x = (c - d) / k
becomes
x = (c - d) / (1.25 * k)

It seems to me this should have the same effect?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original idea for the new kerosine deterministic value was:

x = (c - 1.25 * d) / k

Since the KeroseneVault contract is not upgradeable we cannot modify directly how the kero DV is calculated there, the only way was to use a new KerosineDenominator contract and calculate the denominator in such way that

(c - d) / new denom = (c - 1.25*d) / k

@gnkz gnkz closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants