Which function is to call for borrowing with collateral in Aave?

Expert

Which function is to call for borrowing with collateral in aave v3? - for writing collateral swap smart contract

Answers 1

Borrowing is performed by calling borrow on the Pool contract. The Aave collateral swap feature works by using flashloan to allow users to swap while in a leveraged position. This [contract](https://github.com/aave/aave-v3-periphery/blob/master/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol) takes inputs from the Paraswap API, so you will need to check the Aave interface to see how these API calls are made if you want to re-use this contract;