This script automates token swaps and liquidity provision on the Educhain network using Sailfish Finance. The script is built using Node.js and ethers.js, and it supports multiple wallet addresses for repetitive transactions.
- Node.js: Ensure you have Node.js installed. You can download it from Node.js Official Website.
- NPM or Yarn: To manage packages.
- ethers.js: Install via NPM or Yarn.
- Private Keys File: Prepare a file (
pk.txt
) with private keys, each on a new line. - Environment Variables: Create a
.env
file with your RPC URL and other configurations.
-
Clone the repository to your local machine:
git clone <repository-url> cd <repository-name>
-
Install the dependencies:
npm install
-
Create a
.env
file in the root directory:RPC_URL=<Your_Educhain_RPC_URL> REPEAT_COUNT=100
-
Create a
pk.txt
file and insert the private keys, each on a new line:<private_key_1> <private_key_2>
-
Ensure the ABI files are in
./config
directory:ERC20Abi.js
: ABI for standard ERC20 tokens.sailAbi.js
: ABI for Sail token contract.vaultAbi.js
: ABI for Vault contract.
-
To run the script, execute:
node script.js
-
The script will:
- Swap USDC to SAIL.
- Swap USDC to GRASP.
- Add liquidity to the USDC-GRASP pool.
- Repeat the operations for multiple wallets based on your
pk.txt
and repeat count settings.
-
The logs will show the swap results, including timestamps and wallet addresses.
- Change Token Addresses: Edit the contract addresses in the script for different tokens or pools.
- Adjust Retry Settings: Modify
maxRetries
in thesendTransactionWithRetry
function for custom retry logic. - Modify Swap Amounts: Change the
swapAmount
variable to adjust the amount to be swapped. - Adjust Gas Fee Monitoring: Update
targetGwei
inwaitForLowGas
to set the desired gas price threshold.