I am creating a flash loan arbitrage project, where i am using uniswap v3 for first swap, do i need to add code for adding liquidity too? I wrote code just for swap. I know without liquidity we can't swap. Its kinda confusing. help me.
you don't need to add liquidity. Instead, you'll be utilizing the existing liquidity pools to perform the swaps. If there is a sufficient liquidity for the assets you are swapping, your arbitrage should be working.
When you execute a flash loan, you borrow the funds from lenders like AAVE, perform the arbitrage by swapping tokens, and then repay the loan, this all happens within a single transaction.