-
Notifications
You must be signed in to change notification settings - Fork 2
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
Drawdown control w/ user-defined Severity & Penalty Levels #162
Conversation
} | ||
} | ||
|
||
if (deviation == 0) { |
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.
If I have created two arrays of penalty / severity but for some reason at one time the deviation is equal to 0.
I will fall back to the previous formula and my custom penalty won't be respected.
I think we need to replace this with a check of presence / length of penalty / severity arrays
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.
If the deviation equals 0, meaning penalty[i] = 0
, we can assume that's what the user wants imho. It makes a nice fallback to the default behaviour, when using custom severities.
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.
Are we sure that the deviation will stay at zero after the fallback to default formula, as this formula is based on the SLO / SLI delta?
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.
Great changes that will enable more customization on SLA outcome, need to update tests with new createSLA params
new params as uint
Tests updated / Passing ☑️ LFG? |
Specific tests for user defined severity & penalty levels should be added imo, beside that great work. LGTM 👍 |
} | ||
} | ||
|
||
if (deviation == 0) { |
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.
Are we sure that the deviation will stay at zero after the fallback to default formula, as this formula is based on the SLO / SLI delta?
This patch provides an alternate, user-defined reward calculation approach vs the default deviation formula that we use in the SLO registry.
It allows the contract creator to define severity levels, and their respective penalties.
If the SLI is equal or greater than the value of a severity level
severity[i]
, thenpenalty[i]
becomes the deviation.N.B. In DSLA v2.0, deviation = reward.
In a Parametric Staking SLA, this gives the contract creator a way to control the drawdown of the liquidity pool based on the price increase of the underlying asset.
For the DSLA token initial configuration:
25% is also the protocol-level cap on rewards.
The DTK needs to be updated accordingly (I'm on it).