This tool is open source. Feel free to use / copy / modify it.
Use at your own risk! This is not a financial tool, you can loose all your coins! It is just an experimental tool and should not be used to to try to gain money!
This tool tries to trade Strk vs Eth on Starknet via the Avnu Dex aggregator . It tries to gain the amount of tokens.
Used tech / Prerequisites:
- NodeJs
- Starknet Sdk
- Avnu Sdk
- clone git repo
- run
script npm install
- copy the .env.example to .env and set the Private and Public key
- in th package.json change the path's of the .env and data file to your liking (and also name and place the related files accordingly)
"prod": "npm run build && node --env-file=prod.env dist/app.js"
- then run
script npm run prod
(if you first want to try it on Testnet you can run 'npm run dev', but at creation of this Sepolia was not yet supported by Avnu and Görli was about to die)
- USE_TESTNET - true/false
- ETH_TOKEN - eth token address
- STARK_TOKEN - strk token address (in theory you could also use another supported token address to trade against eth)
- WALLET - your public wallet address
- X - your private key
- SELL_PERCENT - percent of your total amount that should be traded within one trade
- MIN_GAIN_ETH - How much ETH should be gained when selling STRK
- MIN_GAIN_STRK - How much STRK should be gained when selling ETH
- TRADE_FILE - relative path to the trading data file, make sure it exists and has the initial content:
[
{
"hash": "initial",
"status": "SUCCEEDED",
"matchedBy": "initial"
}
]
- Initially it gets your token balances
- It then get the trading quotes from Avnu
- If the ratio is good enough the trade is concluded
- Then in the future if the price goes in the other direction it then tries to sell the stack back to gain coins.
Run script npm run report-prod
to get a short summary of your trades
Run script npm extract-prod
to to extract already matched trades in ha separate file