-
Notifications
You must be signed in to change notification settings - Fork 233
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
Inter Protocol vaults should allow adjustments that don't increase debt when mint limit <= debt outstanding #9837
Labels
bug
Something isn't working
Comments
another way to confirm: I just made a (failing) test: test('repay works regardless of mintLimit', async t => { https://github.com/Agoric/agoric-sdk/blob/dc-test-repay/packages/inter-protocol/test/vaultFactory/test-vault-collateralization.js#L38 ag-mainnet1B/packages/inter-protocol$ yarn test test/vaultFactory/test-vault-collateralization.js -m 'repay*'
yarn run v1.22.19
$ ava test/vaultFactory/test-vault-collateralization.js -m 'repay*'
...
Temporary logging of sent error (Error#1)
Error#1: Minting { brand: Object [Alleged: IST brand] {}, value: 0n } past { brand: Object [Alleged: IST brand] {}, value: 4726n } would hit total debt limit { brand: Object [Alleged: IST brand] {}, value: 1000n }
at checkDebtLimit (.../inter-protocol/src/contractSupport.js:73:6)
at Object.mintAndTransfer (.../inter-protocol/src/vaultFactory/vaultManager.js:802:1)
at Object.commitBalanceAdjustment (.../inter-protocol/src/vaultFactory/vault.js:554:15)
at Object.adjustBalancesHook (.../inter-protocol/src/vaultFactory/vault.js:511:15)
at eval (.../inter-protocol/src/vaultFactory/vault.js:722:16)
at eval (.../pass-style/src/make-far.js:161:31)
Error#1 ERROR_NOTE: Sent as error:captp:far-zoeTest#20001
CapTP near-zoeTest exception: (RemoteError(error:captp:far-zoeTest#20001)#2)
RemoteError(error:captp:far-zoeTest#20001)#2: Minting {"brand":"[Alleged: IST brand]","value":"[0n]"} past {"brand":"[Alleged: IST brand]","value":"[4726n]"} would hit total debt limit {"brand":"[Alleged: IST brand]","value":"[1000n]"}
Error: Minting {"brand":"[Alleged: IST brand]","value":"[0n]"} past {"brand":"[Alleged: IST brand]","value":"[4726n]"} would hit total debt limit {"brand":"[Alleged: IST brand]","value":"[1000n]"}
Error#1 ERROR_NOTE: Sent as error:anon-marshal#10001
Temporary logging of sent error (Error#1)
Error#1 ERROR_NOTE: Sent as error:anon-marshal#10002
Temporary logging of sent error (Error#1)
REJECTED from ava test("repay works regardless of mintLimit"): (RemoteError(error:captp:far-zoeTest#20001)#2)
✘ [fail]: repay works regardless of mintLimit Rejected promise returned by test
ℹ @@ schedule task for:3600, currently: 0 @@
ℹ @@ schedule task for:1800, currently: 0 @@
ℹ @@ schedule task for:1800, currently: 0 @@
ℹ @@ schedule task for:1800, currently: 0 @@
ℹ @@ schedule task for:2, currently: 0 @@
ℹ ----- VFDriver.8 2 giveCollateral 100n
ℹ ----- VFDriver.8 3 giveCollateral 20n
ℹ ----- VFDriver.8 4 setGovernedParam DebtLimit
ℹ ----- VFDriver.8 5 giveCollateral 20n
─
repay works regardless of mintLimit
Rejected promise returned by test. Reason:
Error {
message: 'Minting {"brand":"[Alleged: IST brand]","value":"[0n]"} past {"brand":"[Alleged: IST brand]","value":"[4726n]"} would hit total debt limit {"brand":"[Alleged: IST brand]","value":"[1000n]"}',
}
─
1 test failed this seems to be the same stack trace as observed...
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Inter Protocol vaults have per-collateral global mint limits that prevent new IST from being minted beyond that threshold.
These mint limits can be adjusted by the Economic Committee, independent of the amount of IST that has been minted against that collateral already
In scenarios where the mint limit is adjusted to be below the debt outstanding (even to zero), users should be able to make adjustments to their vaults which do not increase debt outstanding. For example, they should be able to repay debt, add collateral, and/or withdraw collateral (subject to collateralization ratio constraints for the last).
This is not occurring. The EC recently reduced mint limits for stOSMO vaults below the IST debt outstanding, and now users with stOSMO vaults are prevented from adjusting them at all. Users attempting to avoid liquidation are stuck.
To Reproduce
Steps to reproduce the behavior:
Note that in production, you will not have control of #2 and therefore will need to have an existing stOSMO vault open.
Expected behavior
When mint limit is <= current debt outstanding, Vault Manager should prevent new minting of IST but should allow all other vault adjustments
User should be able to:
Platform Environment
Mainnet
Additional context
Error found by user:
Offer failed: Error: Minting {"brand":"[Alleged: IST brand]","value":"[0n]"} past {"brand":"[Alleged: IST brand]","value":"[490607974495n]"} would hit total debt limit {"brand":"[Alleged: IST brand]","value":"[490000000000n]"}
The text was updated successfully, but these errors were encountered: