The Fibrous Bot File under the src folder.
For that is required;
RPC Provider, Public Key and Private Key again.
And also some files are required;
- erc20ETH.json File for the tokens contract and abi.
- formatBalance.ts File to finding correct token decimals for account balance.
Script is written with typescript (ts format), it needs to be converted to js format.
cd src
tsc runBot.ts
After converting js file, run the file.
node runBot.js
Crontab is a Unix-based tool for managing and automating tasks on macOS.
How to use it with terminal:
crontab -e
That script runs the runBot.js file every 30 seconds, save it and exit from edit page:
* * * * * /usr/local/bin/node /amm/src/runBot.js >> /amm/src/output.log 2>&1
* * * * * sleep 30; /usr/local/bin/node /amm/src/runBot.js >> /amm/src/output.log 2>&1
Results will be like below:
Getting token prices...
Max. token in account: eth, Amount of: 143.2087496974167 USD
Best Token: usdc with Profit/Loss: -1.35942
Swap does not make sense. Profit/Loss is not positive.
or
Getting token prices...
Max. token in account: eth, Amount of: 157.5716066121188 USD
Best Token: USDT with Profit/Loss: 0.612732
0.0512819758317154 Amount of eth swapping to USDT. (Slippage is: 0.005)
TX HASH: TX_HASH
For deactivating the crontab job with terminal:
crontab -r