Performs terra swap trades for luna/bLuna arbitrage and is able to watch collateral at Anchor to repay UST deposited in case of liquidation risk.
Last updated Feb 4, 2026
17
Stars
2
Forks
1
Issues
0
Stars/day
Attention Score
6
Language breakdown
Python 96.1%
JavaScript 3.9%
▸ Files
click to expand
README
terratrader
What it does
This bot can perform Terraswap trades for you. It trades on the Luna/bLuna pair.Installation
- Create virtual environment:
python -m venv venv . venv/bin/activatepip install -r requirements.txt
Using it
Set the environment variables:
PKprivate key of your wallet to trade with (read section below on how to find it)
. venv/bin/activate(if not done yet)python cli.pywill start the CLI
Commands
price: Show price for selling/buyingamount-luna: Set the luna amount for buying bLunaamount-bluna: Set the bLuna amount for selling bLunainv-sell-price: Sets the price for when to sell bLunabuy-price: Sets the price for when to buy bLunaspread: Sets the maximum spread (default 0,5%)mode-buy: Sets the bot to buying mode (will toggle automatically when bought)mode-sell: Sets the bot to selling mode (will toggle automatically when sold)buy: Manually buys bLunasell: Manually sells bLunabot: Starts the bot. Stop it with [Ctrl]+[C]
Finding your private key
- Export the "private key" in your Terra Station
- Decode this base64 string and take the encoded key from the dict
npm install -g crypto-jsexport NODEPATH=/usr/local/lib/nodemodules(check that the path is correct, may need to delete "local")node scripts/decodepk.js [ENCODEDPK] [WALLET_PASSWORD]
🔗 More in this category