-
Notifications
You must be signed in to change notification settings - Fork 63
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
SIP-420: Treasury market #2354
Open
dbeal-eth
wants to merge
32
commits into
main
Choose a base branch
from
treasury-market
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SIP-420: Treasury market #2354
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noisekit
reviewed
Jan 19, 2025
noisekit
reviewed
Jan 19, 2025
noisekit
reviewed
Jan 19, 2025
noisekit
reviewed
Jan 19, 2025
noisekit
reviewed
Jan 19, 2025
noisekit
reviewed
Jan 19, 2025
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.
just two nitpicks
Comment on lines
149
to
160
|
||
// | ||
uint256 newlySaddledValue = accountCollateralValue - | ||
(saddledCollateral[accountId] * accountCollateralValue) / | ||
accountCollateral; |
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.
nit: should there be a comment here? I think it would be worth adding anyway
if the loan is repaid early, an additional penalty on the amount of the loan that had been paid so far should be charged.
* use minimumCredit to prevent withdrawal of funds by any means * subtract from artificialDebt in order to allow for repayment of loan (does not work if artificialDebt is insufficient) * add rebalance to unsaddle * move saddledCollateral = 0 to correct place * add tests corresponding to audits
noisekit
force-pushed
the
treasury-market
branch
from
January 30, 2025 00:51
c6a45fc
to
7e02989
Compare
rather than the old one during migration
Co-authored-by: __CalabashSquash__ <[email protected]>
* add missing comments * fix spellings * fix not delegated case * refactor code to make for easier modelling and less gas a bit
we cant do a rebalance at beginning of saddle becuase that defeats the purpose of absorbing the correct amount of debt
noisekit
force-pushed
the
treasury-market
branch
from
January 31, 2025 05:26
0dc9292
to
518ee19
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this implements sip-420.
notes:
migrateDelegation
function to the core system. This is becuase it needs to be possible for a user to actually migrate their account from the current v3 SC pool without repaying their debt. (on optimism the legacymrket can be directly conneted)some deployment invariants exist WRT the creation of the pool (ex. limit to only one collateral type, no minting through v3, etc.). For more information see the corresponding deployments PR Synthetixio/synthetix-deployments#619