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

Quote price value is different/smaller than the contract computed value causing the buy cover tx to fail #59

Open
mixplore opened this issue Jan 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mixplore
Copy link
Contributor

Context

A user has trouble purchasing a cover, turned out they were getting a PriceExceedsMaxPremiumInAsset from the contract when trying to execute the tx. After further investigation, it looks like the premium value we get from the cover router is different (smaller) from the one in the contract. See the repro steps below:

  1. Connect wallet with account: 0xE4994082A0E7f38B565e6c5f4afD608de5EDDfBb
  2. Go to https://app.nexusmutual.io/cover/buy/get-quote?productId=68
  3. Insert amount value: 205
  4. Change cover asset to DAI
  5. Change payment asset to NXM

Pasted Graphic

  1. Check Network Tab for cover router fetch quote call and check premiumInNXM value (14712328767123287)

Pasted Graphic 2

  1. Click Buy cover button
  2. Check dev console for Tenderly simulation link:

Pasted Graphic 1

  1. Run simulation on Tenderly
  2. Scroll down to debug code and notice premiumInNXM param value (17917808219178082) - it’s different from the one in the quote endpoint response
    Pasted Graphic 3
@mixplore mixplore added the bug Something isn't working label Jan 12, 2024
@mixplore mixplore changed the title Quote endpoint value for premium (cover price) is diffr Quote price value is different/smaller than the contract computed value Jan 12, 2024
@mixplore mixplore changed the title Quote price value is different/smaller than the contract computed value Quote price value is different/smaller than the contract computed value causing the buy cover tx to fail Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant