Problem
The deposit method in src/modules/vault.ts constructs and submits the transaction immediately without simulating it first, as noted by an existing TODO, which could lead to failed transactions consuming network fees.
Expected behavior
The deposit method calls simulateTransaction on the built operation first. If the simulation fails, it throws a descriptive error before prompting the user for a signature.
Files to update
Project relevance
This protects Liquidity Providers from paying network fees for transactions that will inevitably revert due to slippage or insufficient funds.
Acceptance criteria
Problem
The
depositmethod insrc/modules/vault.tsconstructs and submits the transaction immediately without simulating it first, as noted by an existingTODO, which could lead to failed transactions consuming network fees.Expected behavior
The
depositmethod callssimulateTransactionon the built operation first. If the simulation fails, it throws a descriptive error before prompting the user for a signature.Files to update
src/modules/vault.tsProject relevance
This protects Liquidity Providers from paying network fees for transactions that will inevitably revert due to slippage or insufficient funds.
Acceptance criteria
rpc.Api.isSimulationSuccessbeforebuildAndSubmitis called