From 1633982d36af5999fc304b15e155e3156dad83e2 Mon Sep 17 00:00:00 2001 From: Primexz Date: Fri, 17 May 2024 17:28:10 +0200 Subject: [PATCH] feat: make limit order stable --- README.md | 2 +- config/config.go | 18 +++++++++--------- kraken/purchase.go | 2 +- main.go | 4 ---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2220a98..3b11b15 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ This tool is configured via environment variables. Some environment variables ar | `KRAKEN_PRIVATE_KEY` | Your Kraken API private key | ✅ | | | `CURRENCY` | Your fiat currency to be used, e.g. USD or EUR | ❌ | `USD` | | `KRAKEN_ORDER_SIZE` | The order size to be used. This value should only be edited if you know exactly what you are doing. | ❌ | `0.0001` | -| `EXPERIMENTAL_MAKER_FEE` | If set to true, limit orders are placed. With a normal monthly volume, you only pay 0.25% fees per purchase instead of 0.4%. **Warning: This feature is experimental.** | ❌ | `false` | +| `LIMIT_ORDER_MODE` | If set to true, limit orders are placed. With a normal monthly volume, you only pay 0.25% fees per purchase instead of 0.4%. | ❌ | `false` | | `CHECK_DELAY` | How often the algorithm should be executed, in seconds. | ❌ | `60` | | `GOTIFY_URL` | URL to your Gotify server | ❌ | | | `GOTIFY_APP_TOKEN` | App token for the app on the Gotify server | ❌ | | diff --git a/config/config.go b/config/config.go index 9801c66..10ff9e7 100644 --- a/config/config.go +++ b/config/config.go @@ -8,14 +8,14 @@ import ( ) var ( - KrakenPublicKey string - KrakenPrivateKey string - Currency string - KrakenOrderSize float64 - CheckDelay float64 - CryptoPrefix string - FiatPrefix string - ExperimentalMakerFee bool + KrakenPublicKey string + KrakenPrivateKey string + Currency string + KrakenOrderSize float64 + CheckDelay float64 + CryptoPrefix string + FiatPrefix string + LimitOrderMode bool ) var logger = log.WithFields(log.Fields{ @@ -30,7 +30,7 @@ func LoadConfiguration() { Currency = loadFallbackEnvVariable("CURRENCY", "USD") KrakenOrderSize = loadFloatEnvVariableWithFallback("KRAKEN_ORDER_SIZE", 0.0001) // https://support.kraken.com/hc/en-us/articles/205893708-Minimum-order-size-volume-for-trading CheckDelay = loadFloatEnvVariableWithFallback("CHECK_DELAY", 60) - ExperimentalMakerFee = loadBoolEnvVariableWithFallback("EXPERIMENTAL_MAKER_FEE", false) + LimitOrderMode = loadBoolEnvVariableWithFallback("LIMIT_ORDER_MODE", false) if Currency == "USD" || Currency == "EUR" || Currency == "GBP" { CryptoPrefix = "X" diff --git a/kraken/purchase.go b/kraken/purchase.go index ccb4176..b47a24e 100644 --- a/kraken/purchase.go +++ b/kraken/purchase.go @@ -29,7 +29,7 @@ func (k *KrakenApi) BuyBtc(_retry_do_not_use int) { krakenErr error ) - if config.ExperimentalMakerFee { + if config.LimitOrderMode { priceRound, _ := strconv.ParseFloat(fmt.Sprintf("%.1f", fiatPrice), 64) args := map[string]interface{}{ // if set to true, no order will be submitted diff --git a/main.go b/main.go index 6a3edcb..3cb96e2 100644 --- a/main.go +++ b/main.go @@ -28,10 +28,6 @@ func main() { config.LoadConfiguration() - if config.ExperimentalMakerFee { - log.Warn("Experimental maker fee is enabled. This feature is not recommended for production use.") - } - bot.NewBot().StartBot() select {}