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

Prevent unnecessary balanced strategy re-randomization #60

Closed
wants to merge 12 commits into from
Closed
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Use this template to report anything that needs to be "fixed"

---

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

## Describe the bug
// A succinct description of the buggy behavior.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ about: Use this template to request a feature or a new plugin (strategy, priceFe

---

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

## Desired Behavior
// A succinct description of **what you are trying to achieve** that is not currently supported.
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go

go_import_path: github.com/lightyeario/kelp
go_import_path: github.com/interstellar/kelp

go:
- "1.10.x"
Expand Down
46 changes: 29 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,35 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

### Added
- support for alerting with PagerDuty as the first implementation, run `glide up` to update the dependency ([5e46ae0d94751d85dbb2e8f73094f5d96af0df5e](https://github.com/lightyeario/kelp/commit/5e46ae0d94751d85dbb2e8f73094f5d96af0df5e))
- support for logging to a file with the `--log` or `-l` command-line option followed by the prefix of the log filename
- support for basic monitoring with a health check service, run `glide up` to update the dependency ([c6374c35cff9dfa46da342aa5342f312dcd337c4](https://github.com/lightyeario/kelp/commit/c6374c35cff9dfa46da342aa5342f312dcd337c4))
- `iter` command line param to run for only a fixed number of iterations, run `glide up` to update the dependencies

### Changed
- reduced the number of available assets that are recognized by the GetOpenOrders() API for Kraken
- levels are now logged with prices in the quote asset and amounts in the base asset for the sell, buysell, and balanced strategies

### Deprecated

### Removed

### Fixed
- conversion of asset symbols in the GetOpenOrders() API for Kraken, reducing the number of tested asset symbols with this API

### Security

## [v1.2.0] - 2018-11-26

### Added
- support for alerting with PagerDuty as the first implementation, run `glide up` to update the dependency ([5e46ae0d94751d85dbb2e8f73094f5d96af0df5e](https://github.com/interstellar/kelp/commit/5e46ae0d94751d85dbb2e8f73094f5d96af0df5e))
- support for logging to a file with the `--log` or `-l` command-line option followed by the prefix of the log filename
- support for basic monitoring with a health check service, run `glide up` to update the dependency ([c6374c35cff9dfa46da342aa5342f312dcd337c4](https://github.com/interstellar/kelp/commit/c6374c35cff9dfa46da342aa5342f312dcd337c4))
- `iter` command line param to run for only a fixed number of iterations, run `glide up` to update the dependencies
- new DELETE_CYCLES_THRESHOLD config value in trader config file to allow some tolerance of errors before deleting all offers ([f2537cafee8d620e1c4aabdd3d072d90628801b8](https://github.com/interstellar/kelp/commit/f2537cafee8d620e1c4aabdd3d072d90628801b8))

### Changed
- reduced the number of available assets that are recognized by the GetOpenOrders() API for Kraken
- levels are now logged with prices in the quote asset and amounts in the base asset for the sell, buysell, and balanced strategies
- clock tick is now synchronized at the start of each cycle ([cd33d91b2d468bfbce6d38a6186d12c86777b7d5](https://github.com/interstellar/kelp/commit/cd33d91b2d468bfbce6d38a6186d12c86777b7d5))

### Fixed
- conversion of asset symbols in the GetOpenOrders() API for Kraken, reducing the number of tested asset symbols with this API
- fix op_underfunded errors when we hit capacity limits for non-XLM assets ([e6bebee9aeadf6e00a829a28c125f5dffad8c05c](https://github.com/interstellar/kelp/commit/e6bebee9aeadf6e00a829a28c125f5dffad8c05c))

## [v1.1.2] - 2018-10-30

### Added
Expand All @@ -40,12 +51,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [v1.1.1] - 2018-10-22

### Fixed
- fixed bot panicing when it cannot cast ticker bid/ask values to a float64 from CCXT's FetchTicker endpoint (0ccbc495e18b1e3b207dad5d3421c7556c63c004) ([issue #31](https://github.com/lightyeario/kelp/issues/31))
- fixed bot panicing when it cannot cast ticker bid/ask values to a float64 from CCXT's FetchTicker endpoint (0ccbc495e18b1e3b207dad5d3421c7556c63c004) ([issue #31](https://github.com/interstellar/kelp/issues/31))

## [v1.1.0] - 2018-10-19

### Added
- support for [CCXT](https://github.com/ccxt/ccxt) via [CCXT-REST API](https://github.com/franz-see/ccxt-rest), increasing exchange integrations for priceFeeds and mirroring [diff](https://github.com/lightyeario/kelp/compare/0db8f2d42580aa87867470e428d5f0f63eed5ec6^...33bc7b98418129011b151d0f56c9c0770a3d897e)
- support for [CCXT](https://github.com/ccxt/ccxt) via [CCXT-REST API](https://github.com/franz-see/ccxt-rest), increasing exchange integrations for priceFeeds and mirroring [diff](https://github.com/interstellar/kelp/compare/0db8f2d42580aa87867470e428d5f0f63eed5ec6^...33bc7b98418129011b151d0f56c9c0770a3d897e)

## [v1.0.0] - 2018-10-15

Expand All @@ -70,7 +81,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- If `SOURCE_SECRET_SEED` is missing or empty then the bot will not crash now.
- support for [CAP-0003](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0003.md) introduced in stellar-core protocol v10 ([issue #2](https://github.com/lightyeario/kelp/issues/2))
- support for [CAP-0003](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0003.md) introduced in stellar-core protocol v10 ([issue #2](https://github.com/interstellar/kelp/issues/2))


## v1.0.0-rc1 - 2018-08-13
Expand All @@ -82,10 +93,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Configuration file based approach to setting up a bot
- Documentation on existing capabilities

[Unreleased]: https://github.com/lightyeario/kelp/compare/v1.1.2...HEAD
[v1.1.2]: https://github.com/lightyeario/kelp/compare/v1.1.1...v1.1.2
[v1.1.1]: https://github.com/lightyeario/kelp/compare/v1.1.0...v1.1.1
[v1.1.0]: https://github.com/lightyeario/kelp/compare/v1.0.0...v1.1.0
[v1.0.0]: https://github.com/lightyeario/kelp/compare/v1.0.0-rc3...v1.0.0
[v1.0.0-rc3]: https://github.com/lightyeario/kelp/compare/v1.0.0-rc2...v1.0.0-rc3
[v1.0.0-rc2]: https://github.com/lightyeario/kelp/compare/v1.0.0-rc1...v1.0.0-rc2
[Unreleased]: https://github.com/interstellar/kelp/compare/v1.2.0...HEAD
[v1.2.0]: https://github.com/interstellar/kelp/compare/v1.1.2...v1.2.0
[v1.1.2]: https://github.com/interstellar/kelp/compare/v1.1.1...v1.1.2
[v1.1.1]: https://github.com/interstellar/kelp/compare/v1.1.0...v1.1.1
[v1.1.0]: https://github.com/interstellar/kelp/compare/v1.0.0...v1.1.0
[v1.0.0]: https://github.com/interstellar/kelp/compare/v1.0.0-rc3...v1.0.0
[v1.0.0-rc3]: https://github.com/interstellar/kelp/compare/v1.0.0-rc2...v1.0.0-rc3
[v1.0.0-rc2]: https://github.com/interstellar/kelp/compare/v1.0.0-rc1...v1.0.0-rc2
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We want to make it as easy as possible to contribute changes that help the proje
### Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free).
* [Create a GitHub issue](https://github.com/lightyeario/kelp/issues) for your contribution, assuming one does not already exist.
* [Create a GitHub issue](https://github.com/interstellar/kelp/issues) for your contribution, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce it (if it is a bug).
* Fork the repository on GitHub and start working on your change.
* When your change is ready then [submit a Pull Request].
Expand All @@ -25,7 +25,7 @@ For low-impact changes (ex: comments, documentation), it is not always necessary

### Finding things to work on

The first place to start is always looking over the [open GitHub issues](https://github.com/search?l=&q=is%3Aopen+is%3Aissue+repo%3Alightyeario%2Fkelp&type=Issues) for the project you are interested in contributing to. Issues marked with [help wanted](https://github.com/search?l=&q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+repo%3Alightyeario%2Fkelp&type=Issues) are usually pretty self-contained and a good place to get started.
The first place to start is always looking over the [open GitHub issues](https://github.com/search?l=&q=is%3Aopen+is%3Aissue+repo%3Ainterstellar%2Fkelp&type=Issues) for the project you are interested in contributing to. Issues marked with [help wanted](https://github.com/search?l=&q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+repo%3Ainterstellar%2Fkelp&type=Issues) are usually pretty self-contained and a good place to get started.

Lightyear also uses these same GitHub issues to keep track of what we are working on. If you see any issues that are assigned to a particular person or have the `in progress` label, that means someone is currently working on that issue. The `orbit` label means we will likely be working on this issue in the next week or two. The `ready` label means that the issue is one we have prioritized and will be working on in our next orbit (the Lightyear term for a sprint) or two.

Expand Down
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Kelp

[![GitHub last commit](https://img.shields.io/github/last-commit/lightyeario/kelp.svg?style=for-the-badge)][github-last-commit]
[![Github All Releases](https://img.shields.io/github/downloads/lightyeario/kelp/total.svg?style=for-the-badge)][github-releases]
[![GitHub last commit](https://img.shields.io/github/last-commit/interstellar/kelp.svg?style=for-the-badge)][github-last-commit]
[![Github All Releases](https://img.shields.io/github/downloads/interstellar/kelp/total.svg?style=for-the-badge)][github-releases]
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge&longCache=true)][license-apache]

[![Build Status](https://travis-ci.com/lightyeario/kelp.svg?branch=master)](https://travis-ci.com/lightyeario/kelp)
[![GitHub issues](https://img.shields.io/github/issues/lightyeario/kelp.svg?style=flat-square&longCache=true)][github-issues]
[![GitHub closed issues](https://img.shields.io/github/issues-closed/lightyeario/kelp.svg?style=flat-square&longCache=true)][github-issues-closed]
[![GitHub pull requests](https://img.shields.io/github/issues-pr/lightyeario/kelp.svg?style=flat-square&longCache=true)][github-pulls]
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/lightyeario/kelp.svg?style=flat-square&longCache=true)][github-pulls-closed]
[![Build Status](https://travis-ci.com/interstellar/kelp.svg?branch=master)](https://travis-ci.com/interstellar/kelp)
[![GitHub issues](https://img.shields.io/github/issues/interstellar/kelp.svg?style=flat-square&longCache=true)][github-issues]
[![GitHub closed issues](https://img.shields.io/github/issues-closed/interstellar/kelp.svg?style=flat-square&longCache=true)][github-issues-closed]
[![GitHub pull requests](https://img.shields.io/github/issues-pr/interstellar/kelp.svg?style=flat-square&longCache=true)][github-pulls]
[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/interstellar/kelp.svg?style=flat-square&longCache=true)][github-pulls-closed]

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

Expand Down Expand Up @@ -61,24 +61,24 @@ There is **one** binary associated with this project: `kelp`. Once the binary is

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

Here is a list of binaries for the most recent release **v1.1.2**:
Here is a list of binaries for the most recent release **v1.2.0**:

| Platform | Architecture | Binary File Name |
| -------------- | ------------ | ---------------- |
| MacOS (Darwin) | 64-bit | [kelp-v1.1.2-darwin-amd64.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-darwin-amd64.tar) |
| Windows | 64-bit | [kelp-v1.1.2-windows-amd64.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-windows-amd64.tar) |
| Linux | 64-bit | [kelp-v1.1.2-linux-amd64.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-linux-amd64.tar) |
| Linux | 64-bit arm | [kelp-v1.1.2-linux-arm64.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-linux-arm64.tar) |
| Linux | 32-bit arm5 | [kelp-v1.1.2-linux-arm5.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-linux-arm5.tar) |
| Linux | 32-bit arm6 | [kelp-v1.1.2-linux-arm6.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-linux-arm6.tar) |
| Linux | 32-bit arm7 | [kelp-v1.1.2-linux-arm7.tar](https://github.com/lightyeario/kelp/releases/download/v1.1.2/kelp-v1.1.2-linux-arm7.tar) |
| MacOS (Darwin) | 64-bit | [kelp-v1.2.0-darwin-amd64.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-darwin-amd64.tar) |
| Windows | 64-bit | [kelp-v1.2.0-windows-amd64.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-windows-amd64.tar) |
| Linux | 64-bit | [kelp-v1.2.0-linux-amd64.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-linux-amd64.tar) |
| Linux | 64-bit arm | [kelp-v1.2.0-linux-arm64.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-linux-arm64.tar) |
| Linux | 32-bit arm5 | [kelp-v1.2.0-linux-arm5.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-linux-arm5.tar) |
| Linux | 32-bit arm6 | [kelp-v1.2.0-linux-arm6.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-linux-arm6.tar) |
| Linux | 32-bit arm7 | [kelp-v1.2.0-linux-arm7.tar](https://github.com/interstellar/kelp/releases/download/v1.2.0/kelp-v1.2.0-linux-arm7.tar) |

After you _untar_ the downloaded file, change to the generated directory (`kelp-v1.1.2`) and invoke the `kelp` binary.
After you _untar_ the downloaded file, change to the generated directory (`kelp-v1.2.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.1.2
cd kelp-v1.2.0
./kelp

To run the bot in simulation mode, try this command:
Expand All @@ -94,8 +94,8 @@ To compile Kelp from source:
1. [Download][golang-download] and [setup][golang-setup] Golang.
2. [Install Glide][glide-install] for dependency management
* `curl https://glide.sh/get | sh`
3. Clone the repo into `$GOPATH/src/github.com/lightyeario/kelp`:
* `git clone git@github.com:lightyeario/kelp.git`
3. Clone the repo into `$GOPATH/src/github.com/interstellar/kelp`:
* `git clone git@github.com:interstellar/kelp.git`
4. Change to the kelp directory and install the dependencies:
* `glide install`
5. Build the binaries using the provided build script (the _go install_ command will produce a faulty binary):
Expand Down Expand Up @@ -225,7 +225,7 @@ These interfaces make it easy to create plugins:
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/lightyeario/kelp
github.com/interstellar/kelp
├── api/ # API interfaces live here (strategy, exchange, price feeds, etc.)
├── cmd/ # Cobra commands (trade, exchanges, strategies, etc.)
├── examples/ # Sample config files and walkthroughs
Expand Down Expand Up @@ -288,13 +288,13 @@ See the [Code of Conduct](CODE_OF_CONDUCT.md).
- [Raise an issue][github-new-issue] that is not a bug report or a feature request
- [Contribute a PR][github-pulls]

[github-last-commit]: https://github.com/lightyeario/kelp/commit/HEAD
[github-releases]: https://github.com/lightyeario/kelp/releases
[github-last-commit]: https://github.com/interstellar/kelp/commit/HEAD
[github-releases]: https://github.com/interstellar/kelp/releases
[license-apache]: https://opensource.org/licenses/Apache-2.0
[github-issues]: https://github.com/lightyeario/kelp/issues
[github-issues-closed]: https://github.com/lightyeario/kelp/issues?q=is%3Aissue+is%3Aclosed
[github-pulls]: https://github.com/lightyeario/kelp/pulls
[github-pulls-closed]: https://github.com/lightyeario/kelp/pulls?q=is%3Apr+is%3Aclosed
[github-issues]: https://github.com/interstellar/kelp/issues
[github-issues-closed]: https://github.com/interstellar/kelp/issues?q=is%3Aissue+is%3Aclosed
[github-pulls]: https://github.com/interstellar/kelp/pulls
[github-pulls-closed]: https://github.com/interstellar/kelp/pulls?q=is%3Apr+is%3Aclosed
[stellarx]: https://www.stellarx.com
[stablecoin]: https://en.wikipedia.org/wiki/Stablecoin
[stellar q&a]: https://stellarx.zendesk.com/hc/en-us/sections/360001295034-Traders
Expand All @@ -319,6 +319,6 @@ See the [Code of Conduct](CODE_OF_CONDUCT.md).
[cla]: https://goo.gl/forms/lkjJbvkPOO4zZFDp2
[announcements-group]: https://groups.google.com/forum/#!forum/kelp-announce
[discussions-group]: https://groups.google.com/forum/#!forum/kelp-talk
[github-bug-report]: https://github.com/lightyeario/kelp/issues/new?template=bug_report.md
[github-feature-request]: https://github.com/lightyeario/kelp/issues/new?template=feature_request.md
[github-new-issue]: https://github.com/lightyeario/kelp/issues/new
[github-bug-report]: https://github.com/interstellar/kelp/issues/new?template=bug_report.md
[github-feature-request]: https://github.com/interstellar/kelp/issues/new?template=feature_request.md
[github-new-issue]: https://github.com/interstellar/kelp/issues/new
4 changes: 2 additions & 2 deletions accounting/pnl/pnl.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"strconv"
"strings"

"github.com/lightyeario/kelp/api"
"github.com/lightyeario/kelp/plugins"
"github.com/interstellar/kelp/api"
"github.com/interstellar/kelp/plugins"
"github.com/stellar/go/clients/horizon"
)

Expand Down
2 changes: 1 addition & 1 deletion api/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api
import (
"fmt"

"github.com/lightyeario/kelp/model"
"github.com/interstellar/kelp/model"
)

// ExchangeAPIKey specifies API credentials for an exchange
Expand Down
2 changes: 1 addition & 1 deletion api/level.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package api

import "github.com/lightyeario/kelp/model"
import "github.com/interstellar/kelp/model"

// Level represents a layer in the orderbook
type Level struct {
Expand Down
2 changes: 1 addition & 1 deletion api/strategy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api

import (
"github.com/lightyeario/kelp/model"
"github.com/interstellar/kelp/model"
"github.com/stellar/go/build"
"github.com/stellar/go/clients/horizon"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/exchanges.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"github.com/lightyeario/kelp/plugins"
"github.com/interstellar/kelp/plugins"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const rootShort = "Kelp is a free and open-source trading bot for the Stellar un
const rootLong = `Kelp is a free and open-source trading bot for the Stellar universal marketplace (https://stellar.org).

Learn more about Stellar : https://www.stellar.org
Learn more about Kelp : https://github.com/lightyeario/kelp`
Learn more about Kelp : https://github.com/interstellar/kelp`
const kelpExamples = tradeExamples + "\n kelp trade --help"

// RootCmd is the main command for this repo
Expand Down
2 changes: 1 addition & 1 deletion cmd/strategies.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/lightyeario/kelp/plugins"
"github.com/interstellar/kelp/plugins"

"github.com/spf13/cobra"
)
Expand Down
7 changes: 4 additions & 3 deletions cmd/terminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"log"
"net/http"

"github.com/lightyeario/kelp/plugins"
"github.com/lightyeario/kelp/support/utils"
"github.com/lightyeario/kelp/terminator"
"github.com/interstellar/kelp/plugins"
"github.com/interstellar/kelp/support/utils"
"github.com/interstellar/kelp/terminator"
"github.com/nikhilsaraf/go-tools/multithreading"
"github.com/spf13/cobra"
"github.com/stellar/go/clients/horizon"
Expand Down Expand Up @@ -49,6 +49,7 @@ func init() {
utils.ParseNetwork(configFile.HorizonURL),
multithreading.MakeThreadTracker(),
-1, // not needed here
-1, // not needed here
false,
)
terminator := terminator.MakeTerminator(client, sdex, *configFile.TradingAccount, configFile.TickIntervalSeconds, configFile.AllowInactiveMinutes)
Expand Down
Loading