The source code can be found on Github here.
For example code interacting with LendingPool methods, checkout integration guides 👇🏻
Asset / Debt Management
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)
amount of an
asset into the protocol, minting the same
amount of corresponding aTokens, and transferring them to the
referralCode is emitted in deposit event and can be for third party referral integrations.
💡 When depositing, the
LendingPool contract must have**
allowance()to spend funds on behalf of
msg.sender** for at-least**
amount** for the
asset being deposited. This can be done via the standard ERC20
function withdraw(address asset, uint256 amount, address to)
amount of the underlying
asset, i.e. redeems the underlying token and burns the aTokens.
💡 When withdrawing
aToken that will be burned by lendingPool .
|asset||address||address of the underlying asset, not the aToken|
|amount||uint256||amount deposited, expressed in wei units. Use type(uint).max to withdraw the entire balance.|
|to||address||address that will receive the asset|