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

Non sensible error, when MangroveOrder fails #864

Open
peterMangrove opened this issue Nov 15, 2022 · 1 comment
Open

Non sensible error, when MangroveOrder fails #864

peterMangrove opened this issue Nov 15, 2022 · 1 comment
Labels
bug Something isn't working LiquidityProvider Priority 3 Priority 3 on a scale from 1 to 5. triage Issue should be triaged

Comments

@peterMangrove
Copy link
Contributor

peterMangrove commented Nov 15, 2022

Describe the bug
When running a FoK order using MangroveOrder and giving a price that you know is not high enough for the order to go through, then the error returned is not usable. You either have to take the transaction hash and run it with cast run <hash> or do something like this:

let result = await market.buy({
  volume: 2000,
  price: 1.00425999,
  mangroveOrder: { fillOrKill: true },
}).catch( e =>  a=e);


let callResult = await mgv._provider.call(a.transaction);
mgv.orderContract.interface.decodeFunctionResult(
  "take",
  callResult
)

To Reproduce
Make sure to use a volume and price that makes the order fail.
let result = await market.buy({ volume: 2000, price: 1.00425999, mangroveOrder: { fillOrKill: true }, })

Expected behavior
It should have a usable return value. In this case it should be the revert reason given by take; "mgvOrder/mo/noPartialFill" (Note: the revert reason name may have changed"

Additional context
The issue can maybe be resolved by using this package: https://www.npmjs.com/package/eth-revert-reason

@peterMangrove peterMangrove added bug Something isn't working triage Issue should be triaged labels Nov 15, 2022
@peterMangrove
Copy link
Contributor Author

This is closely related to #186.

@peterMangrove peterMangrove added the Priority 3 Priority 3 on a scale from 1 to 5. label Feb 8, 2023
@sync-by-unito sync-by-unito bot closed this as completed Jun 19, 2023
@espendk espendk reopened this Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LiquidityProvider Priority 3 Priority 3 on a scale from 1 to 5. triage Issue should be triaged
Projects
None yet
Development

No branches or pull requests

3 participants