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: RWA Offboarding Checklist #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

amusingaxl
Copy link
Contributor

No description provided.

spell/rwa-checklists.md Outdated Show resolved Hide resolved
spell/rwa-checklists.md Outdated Show resolved Hide resolved
spell/rwa-checklists.md Outdated Show resolved Hide resolved
spell/rwa-checklists.md Outdated Show resolved Hide resolved
* [ ] Increase Ilk Debt Ceiling (set DC + increase Global DC)
* [ ] File Ilk `pip` in the `spotter`
* [ ] File Ilk `mat` in the `spotter`
* [ ] Poke `spotter` to pull in the price
Copy link
Member

Choose a reason for hiding this comment

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

Q: Should we sanity check if the price is reasonable?

Copy link
Contributor Author

@amusingaxl amusingaxl Nov 20, 2024

Choose a reason for hiding this comment

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

There's actually a correct way to calculate it. We should probably add it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

* [ ] `bump` `RwaLiquidationOracle` with new computed increased price (`val`)
* [ ] ensure `val` is set accordingly with autoline max debt ceiling (`line`)
* [ ] `val` should enable DAI to be drawn over the loan period while taking into account the configured `ink` amount, interest rate and liquidation ratio (see below)
* [ ] New `val` is calculated with `line * [(1 + duty) ** years] * mat` - rounded up - and makes sense in context of the [rate mechanism](https://github.com/makerdao/developerguides/blob/master/mcd/intro-rate-mechanism/intro-rate-mechanism.md). Minimum duration is usually in the Exec Doc of the spell with the RWAXXX ilk onboarding.
* [ ] Comment explaining `val` formula (`Debt ceiling * [ (1 + RWA stability fee ) ^ (minimum deal duration in years) ] * liquidation ratio`) is present
* [ ] Accompanying comment above `bump` line in format `// XXM * 1.XX^X * X.XX as a WAD` corresponding to the `val` calculation formula (e.g. `// 15M * 1.03^2 * 1.00 as a WAD`) is present along with the calculation formula on the line above
* [ ] IF combining `val` of multiple RWA ilks being combined, `val` calculation is done once per ilk and added to make the total, with workings provided in code comments. The existing `val` value can be retrieved by calling `read()` on `PIP_RWAXX` and converting the result into decimal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check these.

* [ ] `RwaLiquidationOracle.tell(ilk)` call is present
* [ ] IF `RWAXYZ_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool)

## RWA Offboarding Checklist
Copy link
Member

Choose a reason for hiding this comment

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

Should we require removal from the IlkRegistry here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The thing is that we usually don't remove anything from the ilk registry. I'm not sure if we should do it for this specific case only.


## RWA Offboarding Checklist

* IF there is debt in the RWA Vault (`vat.urns(ilk, RWAXYZ_A_URN).art > 0`), proceed with the write-off (i.e.: vault is in default):
Copy link
Member

Choose a reason for hiding this comment

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

Is there a situation where the RWA Vault has surplus when being offboarded? In this case, what should be done with it? (send it to surplus buffer?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean by surplus? ink > art?

* [ ] IF the stability fee for the ilk is not zero (`jug.ilks(ilk).duty > 1 * RAY`), `jug.drip(ilk)` call is present
* [ ] `RwaLiquidationOracle.cull(ilk, RWAXYZ_A_URN)` call is present
* OTHERWISE IF there is no more debt remaining in the vault (`vat.urns(ilk, RWAXYZ_A_URN).art == 0`):
* [ ] The debt ceiling (`vat.ilks(ilk).line`) is currently being set to `0`.
Copy link
Member

Choose a reason for hiding this comment

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

Should we deny the Join on the Vat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RWAs gem joins are permissioned, so in theory there's no harm in leaving the permission there.
We should have a general checklist for "scuttling" contracts (aka the removal of all permissions in the system for a contract) that covers it.

* [ ] The debt ceiling (`vat.ilks(ilk).line`) is `0` OR is currently being set to `0`.
* [ ] `RwaLiquidationOracle.tell(ilk)` call is present
* [ ] IF `RWAXYZ_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool)
* [ ] IF the stability fee for the ilk is not zero (`jug.ilks(ilk).duty > 1 * RAY`), `jug.drip(ilk)` call is present

Choose a reason for hiding this comment

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

Could there be a case soft liquidation has been called but stability fee for the ilk is not zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes... All Centrifuge vaults have non-zero stability fees, and some of them have been put under soft liquidation.


* IF there is debt in the RWA Vault (`vat.urns(ilk, RWAXYZ_A_URN).art > 0`), proceed with the write-off (i.e.: vault is in default):
* IF soft liquidation `.tell(ilk)` has **NOT** been called for the ilk in a previous spell:
* [ ] The value of `RwaLiquidationOracle.ilks(ilk).tau` MUST be zero, OTHERWISE the offboarding can only happen in a future spell.

Choose a reason for hiding this comment

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

Can the rest of checklist still happen except RwaLiquidationOracle.cull(ilk, RWAXYZ_A_URN)? (eg. Set Debt ceiling to 0) If then I'd prefer further specify to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it makes sense. I'll amend this.

* [ ] Oracle price is updated via `DssExecLib.updateCollateralPrice(ilk)`
* IF soft liquidation explicitly requested to be triggered (via `.tell(ilk)`) AND debt ceiling (`vat.ilks(ilk).line`) is `0` (OR is being set to `0` in the current spell)
* [ ] `RwaLiquidationOracle.tell(ilk)` call is present
* [ ] IF `RWAXYZ_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool)
Copy link
Contributor

Choose a reason for hiding this comment

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

This has been in the spell-reviewer-mainnet-checklist but I'm unsure it was followed in the previous spells.
(eg. soft liquidation for RWA005-A )

Could you guide me where I can find related code or help me understand why this is needed?

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.

3 participants