Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
329 stars 208 forks source link

VaultManager does not consider price update and allow vault creation #7670

Closed rowgraus closed 1 year ago

rowgraus commented 1 year ago

Describe the bug

Getting below error in Wallet UI upon attempting to approve vault creation transaction (following txn signing in Keplr):

image.png

To Reproduce

Steps to reproduce the behavior:

  1. Go to Vaults UI
  2. Submit create vault offer
  3. Approve in Wallet UI
  4. Sign Keplr transaction
  5. Get error

Expected behavior

Vault should be created

Platform Environment

Additional context

Add any other context about the problem here.

Screenshots

If applicable, add screenshots to help explain your problem, especially for UI interactions.

Additional comment from Sam on original ticket More context: The UI displays a price of 14.5, with 175% MCR. The numbers in the screenshot above appear to be enforcing a price of 0.151, which was the result of a previous price round. However, the price was since updated to 14.5, which the UI sees, but the contract doesn't seem to be enforcing.

@turadg @dckc I'm soliciting some input here, I'm thinking either the UI or the contract is reading the price from the wrong source. The UI is watching manager0.quotes, is that correct? How can we make sure the contract and UI are in sync?

turadg commented 1 year ago

@Chris-Hibbert figured out that we may need to clear the lockedQuote after a liquidation.

The locked liquidation price (lockedQuote) should clear when the auction begins. Also need to check that the locked period isn't longer than the StartFrequency.

Chris-Hibbert commented 1 year ago

Also need to check that the locked period isn't longer than the StartFrequency.

computeRoundTiming asserts this. The was a conceivable issue if the lockedPrice was to be zeroed at the end of the auction. Since it'll be zeroed at the start, there's no interaction.