stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.09k stars 263 forks source link

No orderConstraints for trading pair XLM/EUR #421

Closed BouweCeunen closed 4 years ago

BouweCeunen commented 4 years ago

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?

nikhilsaraf commented 4 years ago

You should use the kraken API for now. We don't have the constraints set for all trading pairs but you can set this from the trading config file by modifying the fields such as CENTRALIZED_PRICE_PRECISION_OVERRIDE in the config.

Examples for this are specified in the sample_trader file: https://github.com/stellar/kelp/blob/v1.10.0/examples/configs/trader/sample_trader.cfg#L108

Let me know if this works for you, feel free to close the issue once handled.

Ebioro commented 3 years ago

Hi guys, could you explain me what I need to do here? I am getting the same error but cannot understand the solution above.

nikhilsaraf commented 3 years ago

@Ebioro see the link: https://github.com/stellar/kelp/blob/v1.10.0/examples/configs/trader/sample_trader.cfg#L108 it has places where you can set overrides for the price and volume precision among other things. This should allow you to run with any asset by taking the precision values from the exchange's website.

Ebioro commented 3 years ago

@Ebioro see the link: https://github.com/stellar/kelp/blob/v1.10.0/examples/configs/trader/sample_trader.cfg#L108 it has places where you can set overrides for the price and volume precision among other things. This should allow you to run with any asset by taking the precision values from the exchange's website.

Thanks! So, I only need to change the parameters CENTRALIZED_PRICE_PRECISION_OVERRIDE, CENTRALIZED_VOLUME_PRECISION_OVERRIDE,CENTRALIZED_MIN_BASE_VOLUME_OVERRIDE and CENTRALIZED_MIN_QUOTE_VOLUME_OVERRIDE to that of kraken's website and I will be able to run XLM/EUR?

Ebioro commented 3 years ago

Hum, somehow is not working or I am missing something. Please see below screenshot of configuration for XLM/EUR

Screen Shot 2020-11-07 at 3 55 56 PM

Below the precision the console is displaying which does not match with the configuration Screen Shot 2020-11-07 at 3 53 32 PM

nikhilsaraf commented 3 years ago

Can you upload your log file here and I can take a look?

Ebioro commented 3 years ago

Please see below. I running kelp on my Mac

2020/11/07 19:36:20 Starting Kelp Trader: master:v1.10.0 [b4ea3fed07ae26831c9b85bbc80c6e5dfe268c47] 2020/11/07 19:36:20 will run unbounded iterations 2020/11/07 19:36:20 configs: 2020/11/07 19:36:20 SOURCE_SECRET_SEED: [secret key to account GB2A6GGIG6UZ3TXGUWQLMUDWVLUW33SXQON4HBO4JT5LGGUBYY4ABC6J] 2020/11/07 19:36:20 TRADING_SECRET_SEED: [secret key to account GAHZTUSUY77M5LE4HICK56TUS3DEEKCBOBYGCBNXJO5TOCVCHUCERYGA] 2020/11/07 19:36:20 ASSET_CODE_A: XLM 2020/11/07 19:36:20 ISSUER_A: 2020/11/07 19:36:20 ASSET_CODE_B: EUR 2020/11/07 19:36:20 ISSUER_B: GBCLLJTK7NKOZ5HMUHMDWCZJZ75XFS54PFNGAGNACHISZVKO3ZMEFSSV 2020/11/07 19:36:20 TICK_INTERVAL_SECONDS: 300 2020/11/07 19:36:20 MAX_TICK_DELAY_MILLIS: 0 2020/11/07 19:36:20 DELETE_CYCLES_THRESHOLD: 10 2020/11/07 19:36:20 SUBMIT_MODE: both 2020/11/07 19:36:20 FILL_TRACKER_SLEEP_MILLIS: 150000 2020/11/07 19:36:20 FILL_TRACKER_DELETE_CYCLES_THRESHOLD: 0 2020/11/07 19:36:20 SYNCHRONIZE_STATE_LOAD_ENABLE: false 2020/11/07 19:36:20 SYNCHRONIZE_STATE_LOAD_MAX_RETRIES: 0 2020/11/07 19:36:20 FILL_TRACKER_LAST_TRADE_CURSOR_OVERRIDE: 2020/11/07 19:36:20 HORIZON_URL: https://horizon-testnet.stellar.org 2020/11/07 19:36:20 CCXT_REST_URL: 2020/11/07 19:36:20 DOLLAR_VALUE_FEED_BASE_ASSET: 2020/11/07 19:36:20 DOLLAR_VALUE_FEED_QUOTE_ASSET: 2020/11/07 19:36:20 FEE: 2020/11/07 19:36:20 CAPACITY_TRIGGER: 0.8 2020/11/07 19:36:20 PERCENTILE: 90 2020/11/07 19:36:20 MAX_OP_FEE_STROOPS: 5000 2020/11/07 19:36:20 CENTRALIZED_PRICE_PRECISION_OVERRIDE: 6 2020/11/07 19:36:20 CENTRALIZED_VOLUME_PRECISION_OVERRIDE: 6 2020/11/07 19:36:20 CENTRALIZED_MIN_BASE_VOLUME_OVERRIDE: 30 2020/11/07 19:36:20 CENTRALIZED_MIN_QUOTE_VOLUME_OVERRIDE: 2020/11/07 19:36:20 POSTGRES_DB: 2020/11/07 19:36:20 DB_OVERRIDE__ACCOUNT_ID: GAHZTUSUY77M5LE4HICK56TUS3DEEKCBOBYGCBNXJO5TOCVCHUCERYGA 2020/11/07 19:36:20 FILTERS: [] 2020/11/07 19:36:20 ALERT_TYPE: 2020/11/07 19:36:20 ALERT_API_KEY: 2020/11/07 19:36:20 MONITORING_PORT: 0 2020/11/07 19:36:20 MONITORING_TLS_CERT: 2020/11/07 19:36:20 MONITORING_TLS_KEY: 2020/11/07 19:36:20 GOOGLE_CLIENT_ID: 2020/11/07 19:36:20 GOOGLE_CLIENT_SECRET: 2020/11/07 19:36:20 ACCEPTABLE_GOOGLE_EMAILS: 2020/11/07 19:36:20 TRADING_EXCHANGE: 2020/11/07 19:36:20 EXCHANGE_API_KEYS: 2020/11/07 19:36:20 EXCHANGE_PARAMS: 2020/11/07 19:36:20 EXCHANGE_HEADERS: 2020/11/07 19:36:20 Trading XLM: for EUR:GBCLLJTK7NKOZ5HMUHMDWCZJZ75XFS54PFNGAGNACHISZVKO3ZMEFSSV 2020/11/07 19:36:21 metric - successfully sent event metric of type 'bot_startup' 2020/11/07 19:36:21 using CCXT-rest URL: http://localhost:3000 2020/11/07 19:36:21 Using network passphrase: Test SDF Network ; September 2015 2020/11/07 19:36:21 Making strategy: buysell 2020/11/07 19:36:21 configs: 2020/11/07 19:36:21 PRICE_TOLERANCE: 0.001 2020/11/07 19:36:21 AMOUNT_TOLERANCE: 0.001 2020/11/07 19:36:21 RATE_OFFSET_PERCENT: 0 2020/11/07 19:36:21 RATE_OFFSET: 0 2020/11/07 19:36:21 RATE_OFFSET_PERCENT_FIRST: true 2020/11/07 19:36:21 AMOUNT_OF_A_BASE: 10 2020/11/07 19:36:21 DATA_TYPE_A: exchange 2020/11/07 19:36:21 DATA_FEED_A_URL: kraken/XXLM/ZEUR/mid 2020/11/07 19:36:21 DATA_TYPE_B: fixed 2020/11/07 19:36:21 DATA_FEED_B_URL: 1.0 2020/11/07 19:36:21 LEVELS: [{SPREAD:0.0001 AMOUNT:100} {SPREAD:0.00015 AMOUNT:100}] 2020/11/07 19:36:22 set latest trade cursor from where to start tracking fills (no override specified): 639825573060610-0 2020/11/07 19:36:22 validating trustlines... 2020/11/07 19:36:22 trustlines valid 2020/11/07 19:36:22 Starting fill tracker with 1 handlers 2020/11/07 19:36:22 Starting the trader bot... 2020/11/07 19:36:22 ---------------------------------------------------------------------------------------------------- 2020/11/07 19:36:22 there were no trades, leaving lastCursor value as 639825573060610-0 2020/11/07 19:36:22 synchronized state loading is disabled 2020/11/07 19:36:22 (base) assetA=native, maxA=10011.81339400, trustA=math.MaxFloat64 2020/11/07 19:36:22 (quote) assetB=EUR:GBCLLJTK7NKOZ5HMUHMDWCZJZ75XFS54PFNGAGNACHISZVKO3ZMEFSSV, maxB=19999.00000000, trustB=922337203685.47753906 2020/11/07 19:36:22 orderConstraints for trading pair XLM/EUR: OrderConstraints[PricePrecision: 7, VolumePrecision: 7, MinBaseVolume: 0.0000001, MinQuoteVolume: ] 2020/11/07 19:36:23 liabilities after resetting 2020/11/07 19:36:23 asset=base , balance=10011.81339400, trust=math.MaxFloat64, minAccountBal=21.50000000, buyingLiabilities=0.00000000, sellingLiabilities=0.00000000 2020/11/07 19:36:23 asset=quote , balance=19999.00000000, trust=922337203685.47753906, minAccountBal=19.99900000, buyingLiabilities=0.00000000, sellingLiabilities=0.00000000 2020/11/07 19:36:23 returning kraken API key at index 0 panic: krakenExchange could not find orderConstraints for trading pair XLM/EUR. Try using the "ccxt-kraken" integration instead.

goroutine 1 [running]: github.com/stellar/kelp/plugins.(krakenExchange).GetOrderConstraints(0xc0000c70e0, 0xc0005f6be0, 0x1) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/krakenExchange.go:212 +0x2a5 github.com/stellar/kelp/plugins.(krakenExchange).GetTickerPrice(0xc0000c70e0, 0xc00067ec20, 0x1, 0x1, 0xc0005994a0, 0x10ce538, 0x0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/krakenExchange.go:327 +0x1c4 github.com/stellar/kelp/plugins.(exchangeFeed).GetPrice(0xc00008c680, 0x3ff0000000000000, 0x0, 0x0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/exchangeFeed.go:38 +0x6a github.com/stellar/kelp/api.(FeedPair).GetFeedPairPrice(0xc00067ec40, 0x1632d45, 0x196c9b8, 0x66) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/api/priceFeed.go:25 +0x81 github.com/stellar/kelp/plugins.(staticSpreadLevelProvider).GetLevels(0xc00069c320, 0x40d387c000000000, 0x40c38de81d4b6a62, 0xe0, 0x30, 0x0, 0x17e6860, 0xc00006a7a0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/staticSpreadLevelProvider.go:61 +0x44 github.com/stellar/kelp/plugins.(sellSideStrategy).PreUpdate(0xc000514a20, 0x40d387c000000000, 0x40c38de81d4b6a62, 0x426ad7f29abcaf48, 0x7fefffffffffffff, 0x192fa98, 0x6) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/sellSideStrategy.go:141 +0x74 github.com/stellar/kelp/plugins.(composeStrategy).PreUpdate(0xc0006d2240, 0x40c38de81d4b6a62, 0x40d387c000000000, 0x7fefffffffffffff, 0x426ad7f29abcaf48, 0x0, 0x0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/plugins/composeStrategy.go:52 +0x74 github.com/stellar/kelp/trader.(Trader).update(0xc0006c41c0, 0x788568ac) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/trader/trader.go:383 +0x58c github.com/stellar/kelp/trader.(Trader).Start(0xc0006c41c0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/trader/trader.go:126 +0x219 github.com/stellar/kelp/cmd.runTradeCmd(0xc000182200, 0xc000182210, 0xc000182230, 0xc0000c8170, 0xc0000c81a0, 0xc0000c81ad, 0xc000182250, 0xc0000c8270, 0xc0000c8278, 0xc0000c8279) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/cmd/trade.go:751 +0x1e86 github.com/stellar/kelp/cmd.init.5.func1(0x567d020, 0xc0000c64e0, 0x0, 0x6) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/cmd/trade.go:174 +0x67 github.com/stellar/kelp/vendor/github.com/spf13/cobra.(Command).execute(0x567d020, 0xc0000c6480, 0x6, 0x6, 0x567d020, 0xc0000c6480) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/vendor/github.com/spf13/cobra/command.go:702 +0x285 github.com/stellar/kelp/vendor/github.com/spf13/cobra.(Command).ExecuteC(0x567c9c0, 0x0, 0x0, 0x0) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/vendor/github.com/spf13/cobra/command.go:783 +0x2c9 github.com/stellar/kelp/vendor/github.com/spf13/cobra.(Command).Execute(...) /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/vendor/github.com/spf13/cobra/command.go:736 main.main() /Users/nikhilsaraf/dev/go/src/github.com/stellar/kelp/main.go:10 +0x2d

Ebioro commented 3 years ago

Hi, I have switched to use XLM/EUR via Bitstamp and it works!

nikhilsaraf commented 3 years ago

yes, I think we hardcode the available markets on the native "kraken" exchange which caused this limitation. using any of the ccxt integrations will get around this issue, thanks for bringing this up! 👍

addressing in this github issue: https://github.com/stellar/kelp/issues/578

antb123 commented 3 years ago

I get the same error with kraken on EUR BTC and ended up using Binance.