Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
/ kelp Public archive

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges

License

Notifications You must be signed in to change notification settings

stellar-deprecated/kelp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kelp

GitHub last commit Github All Releases license

GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests

Kelp is a free and open-source trading bot for the Stellar universal marketplace.

Kelp includes several configurable trading strategies, and its modular design allows you to customize your algorithms, exchange integrations, and assets. You can define your own parameters or use the existing repository to quickly implement a trading bot. With Kelp, you could be up and trading on Stellar in a matter of minutes.

Kelp is pre-configured to:

  • Make spreads and make markets
  • Create liquidity and facilitate price-discovery for ICOs
  • Price and trade custom stablecoins
  • Mimic order books from other exchanges

To learn more about the Stellar protocol check out this community video. You can also search Stellar's Q&A.

Table of Contents

Be Smart and Go Slow

Whenever you trade on Stellar, you are trading with volatile assets, in volatile markets, and you risk losing money. Period. Use Kelp at your own risk. There is no guarantee you'll make a profit from using our bots or strategies. In fact, if you set bad parameters or market conditions change, Kelp might help you lose money very fast. So be smart and go slow.

Getting Started

To get started with Kelp, either download the pre-compiled binary for your platform from the Github Releases Page or compile Kelp from source.

There is one binary associated with this project: trader. Once the binary is downloaded, run the bot by following the instructions in Running the Trader Bot.

Compile from Source

To compile Kelp from source:

  1. Download and setup Golang.
  2. Install Glide for dependency management.
  3. Clone the repo into $GOPATH/src/github.com/lightyeario/kelp: git clone git@github.com:lightyeario/kelp.git
  4. Change to the kelp directory and install the dependencies: glide install
  5. Build the binaries: go install github.com/lightyeario/kelp/...
  6. Confirm one new binary in $GOPATH/bin: trader.

Running the Trader Bot

The Trader Bot places orders on the Stellar marketplace based on the selected strategy. Configuration files specify the Stellar account and strategy details.

trader has three required parameters which are:

  • botConf: .cfg file with the account details as defined here.
  • stratType: the strategy you want to run (sell, buysell, balanced, mirror, delete).
  • stratConf: .cfg file specific to your chosen strategy, find the strategies here.

Example:

trader --botConf traderConf.cfg --stratType buysell --stratConf buysell.cfg

Components

Kelp includes an assortment of strategies, price feeds, and extensions you can build around. Kelp also enables you to create your own trading strategies.

Strategies

Strategies are at the core of the trader bot. Without them it's just lazy, capable of nothing, thinking of nothing, doing nothing, like our friend scooter here. The strategies give your bot purpose. Each approaches the market in a different way and is designed to achieve a particular goal.

The following strategies are available out of the box with Kelp:

  • sell:

    • What: creates sell offers based on a reference price with a pre-specified liquidity depth
    • Why: To sell tokens at a fixed price or at a price that changes based on an external reference price
    • Who: An issuer could use Sell to distribute tokens from an ICO pre-sale
    • Complexity: Beginner
  • buysell:

    • What: creates buy and sell offers based on a specific reference price and a pre-specified liquidity depth while maintaining a spread.
    • Why: To make the market for tokens based on a fixed or external reference price.
    • Who: Anyone who wants to create liquidity for a stablecoin or fiat token
    • Complexity: Beginner
  • balanced:

    • What: dynamically prices two tokens based on their relative demand. For example, if more traders buy token A from the bot (the traders are therefore selling token B), the bot will automatically raise the price for token A and drop the price for token B.
    • Why: To let the market surface the true price for one token in terms of another.
    • Who: Market makers and traders for tokens that trade only on Stellar
    • Complexity: Intermediate
  • mirror:

    • What: mirrors an orderbook from another exchange by placing the same orders on Stellar after including a spread. Note: covering your trades on the backing exchange is not currently supported out-of-the-box.
    • Why: To hedge your position on another exchange whenever a trade is executed to reduce inventory risk while keeping a spread
    • Who: Anyone who wants to reduce inventory risk and also has the capacity to take on a higher operational overhead in maintaining the bot system.
    • Complexity: Advanced
  • delete:

    • What: deletes your offers from both sides of the specified orderbook. Note: does not need a strategy-specific config file.
    • Why: To kill the offers placed by the bot. This is not a trading strategy but is used for operational purposes only.
    • Who: Anyone managing the operations of the bot who wants to stop all activity by the bot.
    • Complexity: Beginner

Price Feeds

Price Feeds fetch the price of an asset from an external source. The following price feeds are available out of the box with Kelp:

Configuration Files

Each strategy you implement needs a configuration file. The format of the configuration file is specific to the selected strategy. You can use these files to customize parameters for your chosen strategy. For more details, check out the examples section of the readme.

Exchanges

Exchange integrations provide data to trading strategies and allow you to hedge your positions on different exchanges. The following exchange integrations are available out of the box with Kelp:

Extensions

Kelp can easily be extended because of its modular plugin based architecture. You can create new flavors of the following components: Strategies, PriceFeeds, and Exchanges.

These interfaces make it easy to create extensions:

  • Strategy - API for a strategy used by the trader bot
  • SideStrategy - API for a strategy that is applied to a single side of the orderbook. Can be used in conjunction with compose.go to build a Strategy using principles of composition.
  • PriceFeed - API for price of an asset
  • Exchange - API for crypto exchanges

Examples

It's easier to learn with examples! Take a look through the walkthrough guides and sample configuration files below.

Walkthrough Guides

Configuration Files

Reference config files are in the examples folder. Specifically, the following sample configuration files are included:

Questions & Improvements