All supply and borrow actions are done via LendingPool.

<aside> 💡 Always get latest LendingPool from the AddressProvider

</aside>

Supply into LendingPool

<aside> 💡 On deposit, LendingPool pulls funds from the msg.sender and transfers aTokens to onBehalf address.

</aside>

ERC20

Native ETH / MATIC

Only ERC20 tokens can be deposited into the LendingPool. If you want to use your native ETH (or MATIC in case of polygon), you can use wethGateway contract to easily wrap.

Borrow from LendingPool

<aside> 💡 onBehalfOf must have enough collateral via deposit() or have delegated credit to msg.sender via approveDelegation(). See the Credit Delegation guide for more details.

</aside>

ERC20