-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: KIP-3
Are you sure you want to change the base?
KIP-3: send revenue to the KUMO treasury #414
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
37aae75
to
7a06217
Compare
7a06217
to
0747a74
Compare
0747a74
to
521c9b0
Compare
05a98ec
to
3b85772
Compare
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.
521c9b0
to
283907c
Compare
https://www.notion.so/kumos/Split-the-revenue-between-SP-providers-and-the-KUMO-treasury-587a4d1c66a8462eaf61623d1d2d30ba