kryptonite

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 17 Imported by: 0

README

Kryptonite Logo

kryptonite

Go Reference Go Report Card Issues License Release

Automated crypto swapping bot, written in Go. Supports multiple protocols like Uniswap, Curve, SushiSwap, Balancer, etc using 1inch AggregatorV4 router. Under active development.

Not production ready yet

Table of Contents

Introduction

This project started as a hobby to figure out a way to keep an eye on the crypto market while juggling my day job. The Crypto market is highly volatile. Cryptocurrencies can fluctuate in price drastically within seconds you have your eyes off the screen. Unless you are a trader by profession, you cannot actively manage your portfolio, or make any meaningful and profitable moves or prevent a loss.

For people with assets on a hosted wallet or an exchange like Coinbase or Binance, you can set limit and stop loss orders. However, for people with crypto assets in a self-custodial wallet (not on exchanges like Coinbase or Binance), there are limited options.

With Kryptonite, you can set limit buy/sell, stop-loss orders and execute them automatically on your behalf, without manually confirming each time (although you can choose to confirm each one manually). Kryptonite can react to a market crash quickly and execute your stop loss order to protect your investment/profits. Importantly, Kryptonite strives to reduce your anxiety levels in an uncertain market.

Think of Kryptonite as an "Autopilot for Crypto Swapping". Kryptonite does not execute swaps on exchanges like Coinbase and Binance, simply because you cannot access your wallet's private key. Private keys are required by Kryptonite to execute an order on your behalf.

Features

  • Bundled with a webserver UI to view past swaps, current metrics and portfolio performance so far (under development)
  • Executes Buy/Sell/Stop Loss orders manually using confirmations from you via the telegram bot
  • Executes Buy/Sell/Stop Loss orders automatically based on set limits
  • Supports multiple protocols like Uniswap, Curve, SushiSwap, Balancer, etc using the 1inch Aggregation protocol API

Benchmarks

Setup

Requirements

Parameters

The following command line parameters are supported.

Parameter Description Type Default
privateKey Your wallet private key string
publicKey Your wallet public address string
chainId Chain to use. Allowed options: 1 (Ethereum), 10 (Optimism), 56 (Binance Smart Chain), 137 (Polygon/Matic), 42161 (Arbitrum) integer 1
stableToken Stable token (ERC20) to use. Example: USDC, USDT, DAI string USDC
targetToken Target ERC20 token to hold. Example: WETH, WMATIC, LINK. string WETH
slippagePercent Slippage tolerance during swap. Example: 1, 2, ..50 integer 1
redisAddress Redis server host. Example: 192.168.1.100:6379 string
botToken Telegram bot token used to send and receive transaction confirmations string
chatId Your telegram chat id. You will receive this when you authorize yourself with the bot for the first time. string
password Password to share with the bot to authorize yourself as the admin string kryptonite
profitPercent Profit percent at which the bot will execute a sell order integer 50
stopLossPercent Loss percent at which the bot will execute a stop loss order integer 25
mode Mode of operation. Allowed options: MANUAL, AUTO string MANUAL

Usage

docker run -d --name kryptonite pravinba9495/kryptonite:latest kryptonite \
                --privateKey=<PRIVATE_KEY> \
                --publicKey=<PUBLIC_ADDRESS> \
                --chainId=<CHAIN_ID> \
                --stableToken=<STABLE_TOKEN> \
                --targetToken=<TARGET_TOKEN> \
                --slippagePercent=<SLIPPAGE_PERCENT> \
                --redisAddress=<REDIS_ADDRESS> \
                --botToken=<BOT_TOKEN> \
                --chatId=<CHAT_ID> \
                --password=<PASSWORD> \
                --profitPercent=<PROFIT_PERCENT> \
                --stopLossPercent=<STOP_LOSS_PERCENT> \
                --mode=<MODE_OF_OPERATION>

Disclaimer

By using Kryptonite, you understand and agree that there might be bugs in the code that could potentially lead to financial loss. You and only you are responsible for the use of this tool and any financial loss that it may cause. Nobody else shall be held accountable in this regard. Stop using this tool if you do not agree to this. Do conduct your own due diligence and consult your financial advisor before making any investment decisions.

Documentation

Kryptonite documentation is hosted at Read the docs.

Development

Kryptonite is still under active development. Contributions are always welcome!

Contributors

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL