I created a simple button in my dapp to make a deposit in aave. I am in Kovan testnet, and I am depositing 50 DAI. The amount of estimated gas fee is 0.000805ETH. This is the code:

const aaveDepositHandler = () => {
    lendingPoolInstance.methods.deposit('0xff795577d9ac8bd7d90ee22b6c1703490b6512fd', '50000000000000000000', account, 0).send({from: account})
    .on('transactionHash', (hash) => {

Now, when I make a deposit directly in Aave interface, the amount of estimated gas fee is 0.000279ETH.

I don't really understand why my dapp is consuming more gas than the Aave interface, if I am only calling the deposit function, same as Aave interface does. I even compared the "data" and it is exactly the same in both cases:


I would like to understand why this happens, and how I can reduce the amount of gas fee to the same level as Aave interface when I deposit.

1 Answer 1


The gas setting can be adjusted in the front end. this is probably what Aave does. On your end if you don't provide these settings, metamask will just fetch what ever it's using to get gas price.

Look up the estimateGas method. This is how the gas price is returned to metamask.

Or your transaction option also accept these argumnets.

const options = {from:account, gasPrice:'100000000000', gasLimit:'..."}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.