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

Kelp

Kelp logo

GitHub last commit Github All Releases license

Godoc Go Report Card Build Status Contributors

Kelp is a free and open-source trading bot for the Stellar universal marketplace and for centralized exchanges such as Binance, Kraken, CoinbasePro, etc.

Kelp includes several configurable trading strategies and exchange integrations. You can define your own parameters or use the sample configurations to quickly get up and running with a trading bot in a matter of minutes. The modular design allows you to easily create new trading strategies, exchange integrations, and assets to give you full control over the bot.

Kelp is built to:

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

To learn more about the Stellar protocol check out Stellar Videos on Coinbase Earn, or this video about the Stellar DEX created by Lumenauts, or read more about it on the Stellar Website.

Be Smart and Go Slow

Important Disclaimer: Be Smart and Go Slow. Whenever you trade on Stellar, you are trading with volatile assets, in volatile markets, and you risk losing money. Kelp is an experimental software that contains bugs. 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.

Your use of Kelp is governed by the Apache 2.0 open-source license. Please note that SDF’s interactions with you are governed by the SDF Terms of Service and Privacy Policy.

Kelp GUI screenshot

Table of Contents

Getting Started

How To Get Kelp

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: kelp. Once the binary is downloaded, run the bot by following the instructions in Running Kelp.

Download Kelp Binary

You can find the pre-compiled binary for your platform from the Github Releases Page.

Here is a list of binaries for the most recent release v1.10.0:

Platform Architecture Binary File Name
MacOS (Darwin) 64-bit kelp-v1.10.0-darwin-amd64.tar
Windows 64-bit kelp-v1.10.0-windows-amd64.tar
Linux 64-bit kelp-v1.10.0-linux-amd64.tar
Linux 64-bit arm kelp-v1.10.0-linux-arm64.tar
Linux 32-bit arm5 kelp-v1.10.0-linux-arm5.tar
Linux 32-bit arm6 kelp-v1.10.0-linux-arm6.tar
Linux 32-bit arm7 kelp-v1.10.0-linux-arm7.tar

After you untar the downloaded file, change to the generated directory (kelp-v1.10.0) and invoke the kelp binary.

Here's an example to get you started (replace filename with the name of the file that you download):

tar xvf filename
cd kelp-v1.10.0
./kelp

To run the bot in simulation mode, try this command:

./kelp trade -c sample_trader.cfg -s buysell -f sample_buysell.cfg --sim

Compile from Source

Note for Windows Users: You should use a Bash Shell to follow the steps below. This will give you a UNIX environment in which to run your commands and will enable the ./scripts/build.sh bash script to work correctly.

To compile Kelp from source:

  1. Download and setup Golang v1.13 or later.
    • Confirm that $GOPATH is set, and that GOBIN=$GOPATH/bin
    • Confirm that $PATH includes the full filepath of $GOBIN
  2. Install Glide for dependency management
    • curl https://glide.sh/get | sh
  3. Install Yarn and NodeJs to build the Kelp GUI
  4. Clone the repo into $GOPATH/src/github.com/stellar/kelp:
    • git clone [email protected]:stellar/kelp.git
    • Change to kelp directory for all following commands: cd $GOPATH/src/github.com/stellar/kelp
  5. Install the dependencies:
    • glide install
  6. Install the astilectron-bundler binary into $GOBIN
    • go get -u github.com/asticode/go-astilectron-bundler/...
    • go install github.com/asticode/go-astilectron-bundler/astilectron-bundler
  7. Build the binaries using the provided build script (the go install command will produce a faulty binary):
    • ./scripts/build.sh
  8. Confirm one new binary file exists with version information.
    • ./bin/kelp version
  9. Set up CCXT to use an expanded set of priceFeeds and orderbooks (see the Using CCXT section for details)
    • sudo docker run -p 3000:3000 -d franzsee/ccxt-rest:v0.0.4

Running Kelp

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

These are the following commands available from the kelp binary:

  • trade: Trades with a specific strategy against the Stellar universal marketplace
  • exchanges: Lists the available exchange integrations along with capabilities
  • strategies: Lists the available strategies along with details
  • version: Version and build information
  • help: Help about any command

The trade command has three required parameters which are:

  • botConf: full path to the .cfg file with the account details, sample file here.
  • strategy: the strategy you want to run (sell, sell_twap, buysell, balanced, pendulum, mirror, delete).
  • stratConf: full path to the .cfg file specific to your chosen strategy, sample files here.

Kelp sets the X-App-Name and X-App-Version headers on requests made to Horizon. These headers help us track overall Kelp usage, so that we can learn about general usage patterns and adapt Kelp to be more useful in the future. Kelp also uses Amplitude for metric tracking. These can be turned off using the --no-headers flag. See kelp trade --help for more information.

Here's an example of how to start the trading bot with the buysell strategy:

kelp trade --botConf ./path/trader.cfg --strategy buysell --stratConf ./path/buysell.cfg

If you are ever stuck, just run kelp help to bring up the help section or type kelp help [command] for help with a specific command.

Using CCXT

You can use the CCXT library via the CCXT REST API Wrapper to fetch prices and orderbooks from a larger number of exchanges. You will need to run the CCXT REST server on localhost:3000 so Kelp can connect to it.

The CCXT-REST server must be running on port 3000 before you start up the Kelp bot. You can list the exchanges (./kelp exchanges) to get the full list of supported exchanges via CCXT.

Note: this integration is still experimental and is also incomplete. Please use at your own risk.

CCXT-rest can be run in any one of the following ways.

Download CCXT Binary

We have compiled the ccxt-rest v0.0.4 server as a binary for all x86 platforms (linux, darwin, windows). This is the version that Kelp currently uses.

You can find these pre-compiled binaries of the CCXT-rest server in the releases tab here.

Run CCXT using Docker

Install docker (linux: sudo apt install -y docker.io) and run the CCXT-REST docker image configured to port 3000 (linux: sudo docker run -p 3000:3000 -d franzsee/ccxt-rest:v0.0.4). You can find more details on the CCXT_REST github page.

Using Postgres

Postgres v12.1 or later must be installed for Kelp to automatically write trades to a sql database along with updating the trader config file.

Examples

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

Walkthrough Guides

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.

The following reference config files are in the examples folder:

Winning Educational Content from StellarBattle

SDF sponsored a Kelp StellarBattle in August/September 2020, here were the winning results (announcement):

Components

Kelp includes an assortment of strategies, price feeds, and plugins you can use to customize your bot. Kelp also enables you to create your own trading strategies.

click to expand Components section

Strategies

Strategies are at the core of Kelp. 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 (source):

    • 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
  • sell_twap (source):

    • What: creates sell offers based on a reference price spread over the day for a given daily sale amount
    • Why: To sell tokens consistently using the time-weighted-average-price (TWAP) metric
    • Who: An issuer could use SellTwap to distribute tokens from an ICO pre-sale in a consistent manner
  • buysell (source):

    • 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
  • balanced (source):

    • What: dynamically prices two tokens based on their relative demand (like AMMs). 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. This strategy does not allow you to configure the order size but can run out of assets. This is a mean-reversion strategy.
    • Why: To let the market surface the true price for one token in terms of another.
    • Who: Market makers and traders for tokens that have a neutral view on the market
  • pendulum (source):

    • What: dynamically prices two tokens based on their relative demand (like AMMs). 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. This strategy allows you to configure the order size but runs the risk of running out of one of the two assets. This is a mean-reversion strategy.
    • Why: To let the market surface the true price for one token in terms of another.
    • Who: Market makers and traders for tokens that have a neutral view on the market
  • mirror (source):

    • What: mirrors an orderbook from another exchange by placing the same orders on Stellar after including a spread.
    • 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.
  • delete (source):

    • 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.

Refer to this Pull Request to see an example template of a new trading strategy.

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:

  • crypto: fetches the price of tokens from CoinMarketCap
  • fiat: fetches the price of a fiat currency from the CurrencyLayer API
  • exchange: fetches the price from an exchange you specify, such as Kraken or Poloniex. You can also use the CCXT integration to fetch prices from a wider range of exchanges (see the Using CCXT section for details)
  • fixed: sets the price to a constant
  • function: uses a pre-defined function to combine the above price feed types into a single feed. We currently support only two types
    • max - max(exchange/ccxt-binance/XLM/USDT/mid,exchange/ccxt-coinbasepro/XLM/USD/mid)
    • invert - invert(exchange/ccxt-binance/XLM/USDT/mid)

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:

  • sdex ("sdex") (source): The Stellar Decentralized Exchange
  • kraken ("kraken") (source): Kraken - recommended to use ccxt-kraken instead
  • kraken (via CCXT) ("ccxt-kraken") (source): Kraken via CCXT - full two-way integration (tested)
  • binance (via CCXT) ("ccxt-binance") (source): Binance via CCXT - full two-way integration (tested)
  • coinbasepro (via CCXT) ("ccxt-coinbasepro") (source): Coinbase Pro via CCXT - full two-way integration (tested)
  • poloniex (via CCXT) ("ccxt-poloniex") (source): Poloniex via CCXT - only tested on priceFeeds and one-way mirroring
  • bittrex (via CCXT) ("ccxt-bittrex") (source): Bittrex via CCXT - only tested on priceFeeds and onw-way mirroring

Plugins

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 plugins:

  • Strategy (source) - API for a strategy
  • PriceFeed (source) - API for price of an asset
  • Exchange (source) - API for crypto exchanges

Directory Structure

The folders are organized to make it easy to find code and streamline development flow. Each folder is its own package without any sub-packages.

github.com/stellar/kelp
├── api/            # API interfaces live here (strategy, exchange, price feeds, etc.)
├── cmd/            # Cobra commands (trade, exchanges, strategies, etc.)
├── examples/       # Sample config files and walkthroughs
├── model/          # Low-level structs (dates, orderbook, etc.)
├── plugins/        # Implementations of API interfaces (sell strategy, kraken, etc.)
├── support/        # Helper functions and utils
├── trader/         # Trader bot logic; uses other top-level packages like api, plugins, etc.
├── glide.yaml      # Glide dependencies
├── main.go         # main function for our kelp binary
└── ...

Accounting

You can use Stellar-Downloader to download trade and payment data from your Stellar account as a CSV file.

Community

click to expand Community section

Contributing

See the Contribution Guide and then please sign the Contributor License Agreement.

Changelog

See the Changelog.

Code of Conduct

See the Code of Conduct.

Project Improvements

Public Assets

click to expand Public Assets section

TEST1 and TEST2 issued by the GCL4KBYTRA3QYI4JTN4FWVYVYNI67W2M6XMDUB2V6ZLWFASIYHWEJPHU account are test assets used to test Kelp on the production Stellar Network. These assets have no value and are marked as auth_required with the intent to close them off from the rest of the Stellar ecosystem. No trustlines will be accepted against these assets. As part of our testing process, you may observe a market and trades between these two tokens. It is not intended for any of these assets to represent any meaningful volume on the Stellar Network.

Comments
  • Fill Tracker cannot unmarshal string into Go struct field Price._embedded.records.price.n of type int32

    Fill Tracker cannot unmarshal string into Go struct field Price._embedded.records.price.n of type int32

    Describe the bug

    Getting the following error in the latest build of Kelp when trying to fetch trades:

    error when running an iteration of fill tracker: error when fetching trades: error while fetching trades in SDEX (cursor=???????????????-?): json: cannot unmarshal string into Go struct field Price._embedded.records.price.n of type int32
    

    Please provide us with the relevant information in this quick form (1 minute) so we can track who is being faced with an outage on Kelp because of the Protocol 18 upgrade, and can help you get back online as quickly as possible https://forms.gle/G1Ud6HZjubaP6qS1A


    Expected behavior

    I think the correct behavior in this situation is for the bot to parse trade values (and price) correctly

    Frequency

    The frequency is: since at least 2021/10/06 17:48:15 UTC

    Steps To Reproduce

    1. Run Kelp on SDEX with fill tracking enabled.
    2. Execute a trade against your bot.
    3. When the fill tracker runs, it will try and parse the trade and will fail with the above error

    Possible Solution

    This bug can be fixed by patching the price parsing logic by either upgrading the library or running a parallel library import with the fix (since we are using an old version of the SDK)

    Your Environment

    All versions of Kelp as off October 6th 2021

    Context

    I am unable to run any trading template that uses the fill tracker such as the balanced or mirror templates because of this bug.

    Attachments

    None

    References

    See this PR 3915 in the stellar/go repo for the change made to horizon need to switch over from using Price to using TradePrice

    See updated Go SDK: https://github.com/stellar/go/releases/tag/horizonclient-v8.0.0-beta.0

    Version of horizon released: https://github.com/stellar/go/releases/tag/horizon-v2.9.0rc1

  • "maker only" mode for buysell

    Desired Behavior

    The bot should have a mode where it tries to only make orders that do not cross any existing orders (maker only orders).

    Impact

    This can help you avoid unnecessary wash trades if someone else is also market-making but your price feeds or preferences are causing you to place slightly different orders.

    Feature Suggestion

    Without the DEX protocol itself supporting maker-only orders, anything done in the bot will be a best effort. However, I believe that the basic flow is simply: each time re-evaluating orders to place:

    • first load all orders for the asset pair from the DEX
    • check if the order you'd be placing will cross with an existing order. If it would, do not place it.

    References

    Bots aimed at centralized exchanges will generally have this feature because centralized exchanges usually price maker vs. taker orders quite differently.

    Example: https://github.com/DeviaVir/zenbot#strategies

    Additional context

    I believe this should be a flag/parameter for buysell. There's an argument that it could be its own strategy, but I think it's better as a parameter because it might apply to various different strategies (could apply to sell as well, maybe even to balanced).

    Specification

    (updated by @nikhilsaraf: flag should be optional and in the strategy config file but execution by the framework, augment the strategy interface to support this. This should be handled by either the framework or the exchange implementation but the framework can do the threading of the flag. For the SDEX implementation we can filter out orders by querying the orderbook to find and delete the intersection between existing orderbook and orders we want to create)

  • [ad-hoc] [2] Question about running the kelp on Kubernetes

    [ad-hoc] [2] Question about running the kelp on Kubernetes

    Hi,

    I am trying to run the kelp on Kubernetes. One pod runs the kelp container and another one the ccxt-container. I have tried to run kelp with the server command as follows:

    command: [ "./bin/kelp"] args: ["server","--no-electron","--ccxt-rest-url","$(CCXT_REST_URL)"]

    Where CCXT_REST_URL is the ip address of the service that is exposing the ccxt pod.

    Run initializes correctly. However, when building the ui I get the following error: "exec: "xdg-open": executable file not found in $PATH". Do you know what this might be?

    Below the final lines of the log file:

    2020/11/12 14:43:53 ... all CCXT instances initialized 2020/11/12 14:43:53 generating contents of /go/src/github.com/stellar/kelp/gui/web/build ... 2020/11/12 14:43:54 yarn run v1.22.5 2020/11/12 14:43:54 $ react-scripts build 2020/11/12 14:43:56 Creating an optimized production build... 2020/11/12 14:44:39 Compiled successfully. 2020/11/12 14:44:39 2020/11/12 14:44:39 File sizes after gzip: 2020/11/12 14:44:39 2020/11/12 14:44:39 191.89 KB build/static/js/2.8611f4f2.chunk.js 2020/11/12 14:44:39 20.42 KB build/static/js/main.935887f0.chunk.js 2020/11/12 14:44:39 6.08 KB build/static/css/main.4195cb50.chunk.css 2020/11/12 14:44:39 762 B build/static/js/runtime~main.a8a9905a.js 2020/11/12 14:44:39 2020/11/12 14:44:39 The project was built assuming it is hosted at the server root. 2020/11/12 14:44:39 You can control this with the homepage field in your package.json. 2020/11/12 14:44:39 For example, add this to build it for GitHub Pages: 2020/11/12 14:44:39 2020/11/12 14:44:39 "homepage" : "http://myname.github.io/myapp", 2020/11/12 14:44:39 2020/11/12 14:44:39 The build folder is ready to be deployed. 2020/11/12 14:44:39 You may serve it with a static server: 2020/11/12 14:44:39 2020/11/12 14:44:39 yarn global add serve 2020/11/12 14:44:39 serve -s build 2020/11/12 14:44:39 2020/11/12 14:44:39 Find out more about deployment here: 2020/11/12 14:44:39 2020/11/12 14:44:39 https://bit.ly/CRA-deploy 2020/11/12 14:44:39 2020/11/12 14:44:39 Done in 45.86s. 2020/11/12 14:44:39 ... finished generating contents of /go/src/github.com/stellar/kelp/gui/web/build 2020/11/12 14:44:39 2020/11/12 14:44:39 starting server on port 8000 2020/11/12 14:44:39 sleeping for 1 seconds before showing the ready string indicator... 2020/11/12 14:44:40 Serving frontend and API server on HTTP port: 8000 2020/11/12 14:44:40 exec: "xdg-open": executable file not found in $PATH

  • No orderConstraints for trading pair XLM/EUR

    No orderConstraints for trading pair XLM/EUR

    Describe the bug

    I'm not able to get the XLM/EUR pair to work with kraken or with ccxt-kraken with the mirror strategy.

    With kraken it says panic: krakenExchange could not find orderConstraints for trading pair XLM/EUR. Try using the "ccxt-kraken" integration instead.

    With ccxt-kraken it says 2020/05/12 15:48:55 cannot make 'mirror' strategy: makeFn failed: error when making the 'ccxt-kraken' exchange: error making a ccxt exchange: error when initializing Ccxt exchange: error loading markets for exchange instance (exchange=kraken, instanceName=kraken): error in response, bodyString: {"message":"kraken GET https://support.kraken.com/hc/en-us/articles/205893708-What-is-the-minimum-order-size- 403 Forbidden Security check (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)","error":{}}.

    Expected behavior

    I think the correct behavior in this situation is for the bot to start trading XLM/EUR.

    Frequency

    The frequency is: always.

    Steps To Reproduce

    /

    Your Environment

    cli version: master:v1.9.0-2-g6c9411cb gui version: v1.0.0-rc1 git branch: master git hash: 6c9411c build date: 20200509T224154Z env: dev GOOS: linux GOARCH: arm

    Context

    I am unable to start trading with XLM/EUR pair.

    I've found this issue on ccxt: https://github.com/ccxt/ccxt/issues/6700 related to the ccxt-kraken issue.

    Is Kraken not usable with Kelp?

  • integrate new logger framework

    integrate new logger framework

    This PR continues https://github.com/interstellar/kelp/issues/9

    I've integrated the new logger into the various structs and make... functions. It does not compile, pending some questions.

    I also revised some functions in lower level packages that should return errors instead of doing their own logging, which is what the majority of the functions in those packages do. Namely in model/assets.go, model/botkey.go and support/utils/configs.go. I did not yet go through and revise every call to these functions, I wanted to confirm that this approach makes sense first. Hence the not compiling.

    I wanted to do the same thing for support/utils/functions.go but its functions are so nested that changing from self-logging to outputting loggable errors in some of the functions would cascade into other functions having to check multiple possible duplicate errors and then output those yet again. All of which seems massively bloated. PriceAsFloat is a big offender here as it is called multiple times in functions like Less. What do you think?

    What should we do with log lines followed by panic, e.g. support/networking/server.go lines 98-99. Should they be switched to panic(fmt.Errorf(...) as in cmd/exchanges.go line 31?

    You'll see that my IDE did a couple weird things. It added a blank line after the import of logger in most files every time I saved the file. Is that right for some reason? It also aliased a couple imports, e.g. krakenapi "github.com/Beldur/kraken-go-api-client". The code uses those aliases, so that seems reasonable.

    This PR is showing the previously merged changes from https://github.com/interstellar/kelp/pull/88 as new; not sure what that's about.

    File status details:

    Files that need framework conversion:
    	support/networking
    		server.go - pending decision on what to do with panics
    	suport/utils
    		functions.go - pending decision on what to do with all the functions error cascading
    
    
    Files ready for find-replace:
    	api/
    		priceFeed.go
    	plugins/
    		exchangeFeed.go
    		ccxtExchange.go
    		deleteSideStrategy.go
    		fillLogger.go
    		fillTracker.go
    		intervalTimeController.go
    		krakenExchange.go
    		mirrorStrategy.go
    		sdex.go
    		sellSideStrategy.go
    		staticSpreadLevelProvider.go
    	support/monitoring/
    		metricsEndpoint.go
    		pagerDuty.go
    	support/sdk
    		ccxt.go
    	support/utils
    		configs.go
    	terminator/
    		terminator.go
    	trader/
    		trader.go
    
    Files fully converted to new logger framework, i.e. don't have log output lines to replace:
    	api/
    		assets.go
    	model/
    		assets.go
    		botKey.go
    	cmd/
    		trade.go
    	plugins/
    		cmcFeed.go
    		fiatFeed.go
    		fixedFeed.go
    		balancedLevelProvider.go
    
    Files that don't need converting (_test and non-.go files not listed):
    
    main.go
    	accounting/pnl/
    		pnl.go (not actually Kelp)
    	cmd/
    		exchanges.go (wouldn't log this)
    		root.go
    		strategies.go (wouldn't log this)
    		version.go
    	api/
    		alert.go
    		exchange.go
    		level.go
    		strategy.go
    		timeController.go
    	model/
    		dates.go
    		number.go
    		orderbook.go
    		tradingPair.go
    	plugins/
    		balancedStrategy.go
    		buysellStrategy.go
    		composeStrategy.go
    		deleteStrategy.go
    		factory.go
    		priceFeed.go
    		sellStrategy.go
    	support/monitoring
    		factory.go
    		metrics.go
    		metricsRecorder.go
    	support/networking
    		endpoint.go
    		network.go
    		parser.go
    	support/utils
    		config.go
    	terminator/
    		config.go
    	trader/
    		config.go
    
  • [Nikhil ad-hoc] [2] (4) Trying to access db_version when starting up kelp with db before the table even exists?

    [Nikhil ad-hoc] [2] (4) Trying to access db_version when starting up kelp with db before the table even exists?

    Reported by someone in the community. Need to look into this.

    // see a sample bug report here: https://github.com/stellar/kelp/issues/1

    Describe the bug

    // A succinct description of the buggy behavior. // This section includes what the bot is doing and why you think it is incorrect.

    The bot ...

    Expected behavior

    // A succinct description of what you expected to happen.

    I think the correct behavior in this situation is for the bot to ...

    Frequency

    // How often does this happen? // Unpredictable = it's hard to predict when it will happen // Sometimes = it happens every now and then but there's no pattern to it // Always = it always happens consistently at the same point

    The frequency is: ...

    Steps To Reproduce

    // A concise description of the steps to reproduce the buggy behavior along with screenshots wherever applicable:

    Here are the steps to reproduce the issue (see attachments in section below):

    1. Set up your configuration file with these parameters: ...
    2. Start the bot using this command: ... ...

    Possible Solution

    // Optional, suggest a fix.

    This bug can be fixed by ...

    Your Environment

    // Run kelp version to get the version and build information and paste it here // cli version: v1.0.0-rc1 // gui version: v0.0.1 // git hash: 1bcc4e9fa4012867a549472dbdf61cb008041305 // build date: 20180813T013016Z // GOOS: linux // GOARCH: amd64

    ...

    Context

    // A succinct description of how has this bug has affected you or prevented you from accomplishing what you wanted.

    I am unable to ... because of this bug.

    Attachments

    // Attach any relevant configuration files, logs, tx hashes, etc. here.

  • TargetPrice is 0 Error Balanced strategy

    TargetPrice is 0 Error Balanced strategy

    Describe the bug

    error in selling sub-strategy: unable to create preceding offers: could not compute targets: targetPrice is 0

    Expected behavior

    I think the correct behavior in this situation is for the bot to trade XLM for USD and vice versa.

    Frequency

    The frequency is: always.

    Steps To Reproduce

    It started trading and has traded to a balance of 0 USD. It generates this error now.

    Possible Solution

    /

    Your Environment

    cli version: (no:v1.9.0 gui version: v1.0.0-rc1 git branch: (no git hash: ab3333ed871e81124b59d053b60a5856aecc5f41 build date: 20200514T081355Z env: dev GOOS: linux GOARCH: amd64

    Context

    I am unable to trade with Kelp because of this bug.

    Attachments

    /

  • Dashboard UI tool to manage Kelp processes on your machine

    Dashboard UI tool to manage Kelp processes on your machine

    Desired Behavior

    I want to be able to visualize all the Kelp processes that I have running on my system with controls for each instance.

    Impact

    The desired behavior will allow me to scale up my usage of Kelp and better manage markets.

    Feature Suggestion

    We can achieve the desired behavior by having a Dashboard UI for Kelp. This can be a web page that interfaces with a server that controls various bot instances running on the machine.

    References

    This feature exists in quite a few trading bots (both crypto and non-crypto). Please see the specification section below for details.

    Specification​

    v1.0 (MVP)

    1. list of all the bot instances (markets) you are running on your machine
    2. create and delete bot instances
    3. start and stop bots
    4. delete offers for a market

    Mockup

    img_3991

    Items

    • [x] bundle in React.js applications for frontend
    • [x] deployment mode embeds JS assets into binary (when building with ./scripts/build.sh -d)
    • [x] local mode running from static files in filesystem (when building with ./scripts/build.sh and running with ./bin/kelp server)
    • [x] dev mode with hot-reloading of JS code from filesystem (when building with ./scripts/build.sh and running with ./bin/kelp server --dev)
    • [x] design mockups
    • [x] frontend react components to be used
    • [x] list, start, stop/delete bot instances
    • [x] edit bot instances
    • [x] delete bot instances
    • [x] create bot instances (buysell strategy only for now)
    • [x] edit form validation
    • [x] add trustlines on account when saving
    • [x] first pass at polishing
  • Prevent unnecessary balanced strategy re-randomization

    Prevent unnecessary balanced strategy re-randomization

    Here's the update to balancedLevelProvider to have it remember what its balances were last run and not mess with the levels if they didn't really change.

    The code creates a very small range of balances to consider "the same" because the maxAsset variables come back slightly different every run-through, even if no levels were touched. My guess is that it's a floating-point math problem.

  • Refactor volume filter function

    Refactor volume filter function

    The volumeFilterFn within plugins/volumeFilter.go can be significantly streamlined. The below flowchart outlines its logical flow to help guide a refactor.

    Volume filter function flowchart

  • Unable to find proper guide to configure bot for my exchange software

    Unable to find proper guide to configure bot for my exchange software

    I have implemented api.Exchange interface for an exchange software but after that i don't know how to configure and run the bot for market making on exchange software. I have gone through sample_trade.cfg and sample_buysell.cfg but i can't understand how to configure it for my exchange software. I need to know which cfg parameters i need to set to run bot?

  • Add a bias to the weighting of buysell orders

    Add a bias to the weighting of buysell orders

    // see sample feature request here: https://github.com/stellar/kelp/issues/2

    Desired Behavior

    // A succinct description of what you are trying to achieve that is not currently supported. // This can be a request for a new plugin too (strategy, price feed, exchange). // If your feature request is related to a problem with an existing feature then please submit a bug report instead. // If this feature does not exist anywhere else then please restrict details to the Specification section below.

    I want to ... Be able to change the balance of % in the buysell strategy. i.e. spread=1% Set buys at 0.4% below mid Set sells at 0.6% above mid

    Impact

    // A succinct description of why you want the desired behavior specified above.

    The desired behavior will allow me to gradually increase the price

    Feature Suggestion

    // A succinct description of how you want to achieve the desired behavior. // If you have looked at the code and know exactly what code changes are needed then please consider submitting a pull request instead. // If this feature does not exist anywhere else then please restrict any details to the Specification section below.

    We can achieve the desired behavior by ...

    References

    // If your feature exists somewhere else then please provide links for reference.

    This feature exists in ... and you can find a link to it here ... or This feature does not exist anywhere else, please see the specification section below for details.

    Additional context

    // Add any additional context here including any alternative solutions you considered (if any) and why you picked this particular feature to achieve your desired behavior.

    Some alternatives that would achieve the same result are:

    • ...
    • ...

    The feature suggested above was the better than these alternatives because ...

    Specification

    // If this feature does not exist anywhere else then please provide additional details here. // This can be as long and detailed as may be necessary.

    ...

  • Bump express from 4.17.1 to 4.18.2 in /gui/web

    Bump express from 4.17.1 to 4.18.2 in /gui/web

    Bumps express from 4.17.1 to 4.18.2.

    Release notes

    Sourced from express's releases.

    4.18.2

    4.18.1

    • Fix hanging on large stack of sync routes

    4.18.0

    ... (truncated)

    Changelog

    Sourced from express's changelog.

    4.18.2 / 2022-10-08

    4.18.1 / 2022-04-29

    • Fix hanging on large stack of sync routes

    4.18.0 / 2022-04-25

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • Bump qs from 6.5.2 to 6.5.3 in /gui/web

    Bump qs from 6.5.2 to 6.5.3 in /gui/web

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • Bump decode-uri-component from 0.2.0 to 0.2.2 in /gui/web

    Bump decode-uri-component from 0.2.0 to 0.2.2 in /gui/web

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • Infinite loop when encounters a trade that is different from base/quote asset

    Infinite loop when encounters a trade that is different from base/quote asset

    There is an infinite loop when the bot encounters a trade from a different pair on the account. This happens to me often since I switch between bots on the same stellar account (not running them simultaneously).

    I would expect it to just ignore the trade and move on.

    Frequency: this happens every time I switch from one pair to another.

    2022/09/30 16:39:04 encountered a trade (ID=184281168177836033-0) that is different from the base and quote asset (:/WFTM:GAEDZ7BHMDYEMU6IJT3CTTGDUSLZWS5CQWZHGP4XUOIDG5ISH3AFAEK2) on the bot or uses a different trading account, botTraderAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77 (tradeBaseAccount=GAITTRFFPHN76ETLGET52ZXZJRELJ56B32X46OOGLG3SIC5RBC5BYT4E, tradeCounterAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77)
    2022/09/30 16:39:04 continuing to fetch trades from the new updated cursor (184281142407536641-1) because we did not hit a stoppping condition, (numFetchedTrades = 0, total len(trades) = 0, sdexTradesFetchLimit = 200; hitCursorEnd=false, hitRateLimit=false)
    2022/09/30 16:39:04 returned from fetch trades API call for SDEX using cursor '184281142407536641-1' (len(records) = 1, error = <nil>)
    2022/09/30 16:39:04 encountered a trade (ID=184281168177836033-0) that is different from the base and quote asset (:/WFTM:GAEDZ7BHMDYEMU6IJT3CTTGDUSLZWS5CQWZHGP4XUOIDG5ISH3AFAEK2) on the bot or uses a different trading account, botTraderAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77 (tradeBaseAccount=GAITTRFFPHN76ETLGET52ZXZJRELJ56B32X46OOGLG3SIC5RBC5BYT4E, tradeCounterAccount=GDWJONB4JX6C3Y3MQSYGHMAI2L2BYFZ2D6UENO4YIHF26X5PGZKJER77)
    2022/09/30 16:39:04 continuing to fetch trades from the new updated cursor (184281142407536641-1) because we did not hit a stoppping condition, (numFetchedTrades = 0, total len(trades) = 0, sdexTradesFetchLimit = 200; hitCursorEnd=false, hitRateLimit=false)
    2022/09/30 16:39:04 returned from fetch trades API call for SDEX using cursor '184281142407536641-1' (len(records) = 1, error = <nil>)
    .... and so on, forever ...
    

    It makes the bot unusable until it finally encounters a trade that it expects.

    The configuration is using the balanced strategy.

A golang implementation of a console-based trading bot for cryptocurrency exchanges
A golang implementation of a console-based trading bot for cryptocurrency exchanges

Golang Crypto Trading Bot A golang implementation of a console-based trading bot for cryptocurrency exchanges. Usage Download a release or directly bu

Jun 4, 2022
BlueBot is an open-source trading bot that can be customized to handle specific investment strategies.

BlueBot Quick Note BlueBot and all mentioned services are free to use, including supported financial APIs. Overview BlueBot is a self-healing trading

Sep 7, 2022
CryptoPump is a cryptocurrency trading bot that focuses on high speed and flexibility
CryptoPump is a cryptocurrency trading bot that focuses on high speed and flexibility

CryptoPump is a cryptocurrency trading bot that focuses on high speed and flexibility. The algorithms utilize Go Language and WebSockets to react in real-time to market movements based on Bollinger statistical analysis and pre-defined profit margins.

Nov 24, 2022
The modern cryptocurrency trading bot written in Go.

bbgo A trading bot framework written in Go. The name bbgo comes from the BB8 bot in the Star Wars movie. aka Buy BitCoin Go! Current Status Features E

Jan 2, 2023
A fast cryptocurrency trading bot implemented in Go
A fast cryptocurrency trading bot implemented in Go

A fast cryptocurrency bot framework implemented in Go. Ninjabot permits users to create and test custom strategies for spot markets. ⚠️ Caution: Worki

Jan 1, 2023
Crypto signal trading bot

Crypto-signal-trading-bot Firstly a warning This project has the ability to spen

Dec 15, 2022
Compares the BTC and ETH buy and sell prices between two exchanges.

CryptoComparer Repo for the crypto comparer, where I compare prices between two exchanges(Blockchain and Binance), and tell you which is the best plac

Oct 28, 2021
Bot-template - A simple bot template for creating a bot which includes a config, postgresql database

bot-template This is a simple bot template for creating a bot which includes a c

Sep 9, 2022
HoloBot — An open-source Discord bot for Hololive fans, built with Go.

HoloBot HoloBot — An open-source Discord bot for Hololive fans, built with Go. Installation From Binary Download holobot binary here. Create a file ca

Dec 17, 2021
Open-IM-Server is open source instant messaging Server.Backend in Go.
Open-IM-Server is open source instant messaging Server.Backend in Go.

Open-IM-Server Open-IM-Server: Open source Instant Messaging Server Instant messaging server. Backend in pure Golang, wire transport protocol is JSON

Jan 2, 2023
Automated Trader (at). Framework for building trading bots.
Automated Trader (at). Framework for building trading bots.

Automated Trader (at) Purpose: Framework for building automated trading strategies in three steps: Build your own strategy. Verify it with the backtes

Dec 14, 2022
Tripwire is trading platform interface

Tripwire A Golang SDK for binance API. All the REST APIs listed in binance API document are implemented, as well as the websocket APIs. For best compa

Nov 28, 2021
A trading robot, that can submit basic orders in an automated fashion.
A trading robot, that can submit basic orders in an automated fashion.

Source: https://github.com/harunnryd/btrade Issues: https://github.com/harunnryd/btrade/issues Twitter: @harunnryd LinkedIn: @harunnryd btrade is a ro

Jan 26, 2022
A bot based on Telegram Bot API written in Golang allows users to download public Instagram photos, videos, and albums without receiving the user's credentials.

InstagramRobot InstagramRobot is a bot based on Telegram Bot API written in Golang that allows users to download public Instagram photos, videos, and

Dec 16, 2021
Sex-bot - The sex bot and its uncreative responses
Sex-bot - The sex bot and its uncreative responses

Sex Bot The sex bot, made with golang! The sex bot can't hear the word "sexo" he

Nov 11, 2022
Dlercloud-telegram-bot - A Telegram bot for managing your Dler Cloud account

Dler Cloud Telegram Bot A Telegram bot for managing your Dler Cloud account. Usa

Dec 30, 2021
Quote-bot - Un bot utilisant l'API Twitter pour tweeter une citation par jour sur la programmation et les mathématiques.

Description Ceci est un simple bot programmé en Golang qui tweet une citation sur la programmation tout les jours. Ce bot est host sur le compte Twitt

Jan 1, 2022
Discord-bot - A Discord bot with golang

JS discord bots Install Clone repo git clone https://github.com/fu-js/discord-bo

Aug 2, 2022
Bot - Telegram Music Bot in Go

Telegram Music Bot in Go An example bot using gotgcalls. Setup Install the serve

Jun 28, 2022