Hey Yomoo! Thanks a lot for the help. I’m glad to find I was not too far from the solution.
However, I am not exactly sure on how to call the function. How should I initialize the connection with the smart contract / import the function?
I saw this solution via ethers.js. Should I go with that or is there an easier solution?
import { Contract, utils } from "ethers"
const LENDING_POOL_ADDRESS = await addressesProvider.getLendingPool();
const weth = new Contract(WETH_ADDRESS, WethAbi, signer);
const lendingPool = new Contract(LENDING_POOL_ADDRESS, LendingPoolAbi, signer);
// Approve LendingPool to spend user's funds
await weth.approve(LENDING_POOL, constants.MaxUint256);
// On successful deposit onBehalf address receives the aToken
await lendingPool.deposit(WETH, utils.parseEther(amount), onBehalf, 0);