Monitor the mempool via bloxroute or block native api for transactions that have 2% or higher slippage. This is the first filter. Then take the transaction details for all identified transactions. Details include slippage, liquidity pool info, swap amount and gas.
Next you will you will need to build a caching system to cache all liquidity pool info for all pools para swap api monitors. this data will need to be fetched 2x a second using rotating proxies from smart proxy (or similar)You will also need to create a fee table with the following fees-platform trading fees (fetched from para swap api) and flash loan fee. **
Now you have all the data you need you take the filtered transaction (transactions that have over 2% slippage) and calculate the the transaction details and the max slippage together example of the transaction was $100 and the slippage is 10% the max slippage is $110. Take this number and see it it is equal or greater then the liquidity pool volume. If it is then move to the next calculation. If not end transaction. For the next calculation take the slippage amount in our scenario it’s $10 and minus all fees for that transaction using the fee table. If the transaction is profitable minus all fees included gas then send to para swap to transact. The gas is a very simple calculation take the gas from the targeted transaction and add 1 gwei for the buy and subtract 1 gwei for the sell transaction. **
The buy transaction is the slippage amount minus 1% in our scenario it would be $9 . The sell is what was bought. Both transactions need to happen in the same block due to flash loans.
Flash loan provider 1. Equalizer 2 (backup) AAVE. All data fetching and transactions are para swap Node is Alchemy. All contracts should be optimized for gas fees. simple logging system. **
Security-use libraries for encryption and secure data storage, and code obfuscation techniques for keys, contracts and source code. I’d also like a hacking circuit breaker.
This is the whole bot if you would like me to did into an area for you I’d be happy to. I’d like 2 prices 1 for everything pre transaction and a second for everything post identification and calculations.