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

KIP-3: send revenue to the KUMO treasury #414

Open
wants to merge 6 commits into
base: KIP-3
Choose a base branch
from

Conversation

arthurka-o
Copy link
Contributor

@arthurka-o arthurka-o commented Sep 26, 2023

@arthurka-o arthurka-o marked this pull request as ready for review September 26, 2023 18:24
Copy link
Contributor

@marceljay marceljay left a comment

Choose a reason for hiding this comment

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

Partial review


uint256 internal assetBalance; // deposited asset tracker
// Percent that goes to the depositor. 1e18 = 100%, 9e17 = 90%. Must be in range [0, 1]
uint256 internal kickbackRate;
Copy link
Contributor

Choose a reason for hiding this comment

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

I personally found the variable name already confusing when I first looked into Liquity 2 years ago. Why don't we name it commissionRate or systemFee?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Choose protocolFee as I see it more often than other variants

@@ -634,6 +634,27 @@ contract StabilityPool is KumoBase, CheckContract, IStabilityPool {
return KUSDGain;
}

function _sendGainsToKUMOTreasury(uint256 _assetGain, uint256 _KUSDGain) internal {
uint256 treasuryShare = uint256(DECIMAL_PRECISION).sub(kickbackRate);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is why I was confused about the term Kumo Wallet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, this would be easier if kickbackRate was just feePercentage or commissionRate or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also confused with KUMO Wallet. I feel that KUMO Treasury is more obvious choise.

Arthur Galiullin added 6 commits October 4, 2023 18:16
In this function, we calculate the treasury share
in percents (1 - `kickbackRate`).
Then, if the depositor gains are not zero, we send
Asset and KUSD to the treasury address, and
update pool balances.
By multiplying the gain amount by the kickback rate
and dividing by `DECIMAL_PRECISION`, we get the
amount of gain that depositors get minus treasury
fee.
For every function that sends gains to somewhere,
be it the depositor's trove or depositor's wallet,
now we send a part of the gains to the KUMO
treasury.
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.

None yet

2 participants