cassandre-tech / cassandre-trading-bot

Create your Java crypto trading bot in minutes. Our Spring boot starter takes care of exchange connections, accounts, orders, trades, and positions so you can focus on building your strategies.
https://trading-bot.cassandre.tech
GNU General Public License v3.0
581 stars 164 forks source link

Coinbase and Gemini - Not able to connect #785

Closed s-teamup closed 2 years ago

s-teamup commented 2 years ago

Release number

tech.cassandre.trading.bot cassandre-trading-bot-spring-boot-starter 5.0.5
    <!-- Our archetype is using Kucoin exchange sanbox - Add here the dependency of the exchange you want to use -->
    <dependency>
        <groupId>org.knowm.xchange</groupId>
        <artifactId>xchange-coinbase</artifactId>
        <version>5.0.11</version>
    </dependency>

Describe the bug 07:58:07 - No remote initialization implemented for Coinbase. The exchange meta data for this exchange is loaded from a json file containing hard-coded exchange meta-data. This may or may not be OK for you, and you should understand exactly how this works. Each exchange can either 1) rely on the hard-coded json file that comes packaged with XChange's jar, 2) provide your own override json file, 3) properly implement the remoteInit() method for the exchange (please submit a pull request so the whole community can benefit) or 4) a combination of hard-coded JSON and remote API calls. For more info see: https://github.com/timmolter/XChange/wiki/Design-Notes#exchange-metadata 07:58:07 - Exchange connection with coinbase driver. org.knowm.xchange.coinbase.dto.CoinbaseException: null (HTTP status code: 404) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:124) at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:291) at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:288) at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:520) at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:65) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:195) at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4593) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3548) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.read(JacksonResponseReader.java:53) at si.mazi.rescu.serialization.jackson.JacksonResponseReader.readException(JacksonResponseReader.java:58) at si.mazi.rescu.ResponseReader.read(ResponseReader.java:82) at si.mazi.rescu.RestInvocationHandler.mapInvocationResult(RestInvocationHandler.java:169) at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:157) at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:113) at com.sun.proxy.$Proxy169.getUsers(Unknown Source) at org.knowm.xchange.coinbase.service.CoinbaseAccountServiceRaw.getCoinbaseUsers(CoinbaseAccountServiceRaw.java:51) at org.knowm.xchange.coinbase.service.CoinbaseAccountService.getAccountInfo(CoinbaseAccountService.java:36) at tech.cassandre.trading.bot.configuration.ExchangeAutoConfiguration.configure(ExchangeAutoConfiguration.java:175) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:410) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansWithAnnotation(DefaultListableBeanFactory.java:720) at org.springframework.context.support.AbstractApplicationContext.getBeansWithAnnotation(AbstractApplicationContext.java:1322) at com.netflix.graphql.dgs.internal.DgsSchemaProvider.schema(DgsSchemaProvider.kt:75) at com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration.schema(DgsAutoConfiguration.kt:169) at com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration$$EnhancerBySpringCGLIB$$24227ac0.CGLIB$schema$11() at com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration$$EnhancerBySpringCGLIB$$24227ac0$$FastClassBySpringCGLIB$$3bdaad0a.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration$$EnhancerBySpringCGLIB$$24227ac0.schema() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) at me.sidda.tech.Application.main(Application.java:14) 07:58:08 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dgsQueryExecutor' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'dgsQueryExecutor' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schema' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'schema' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tech.cassandre.trading.bot.api.graphql.data.AccountDataFetcher': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tech.cassandre.trading.bot.configuration.ExchangeAutoConfiguration': Invocation of init method failed; nested exception is tech.cassandre.trading.bot.util.exception.ConfigurationException: Unknown configuration error: null (HTTP status code: 404)

To Reproduce cassandre.trading.bot.exchange.driver-class-name=coinbase

or cassandre.trading.bot.exchange.driver-class-name=coinbasepro

Issue exist for both options above.

Similar issue exist fo Gemini exchange also.

Expected behavior

Code is working fine with KUCOIN exchange. Facing issue only for Coinbase and Gemini

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

straumat commented 2 years ago

@s-teamup This is how I configure my bot running on Coinbase.

First, in pom.xml:

<dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-coinbasepro</artifactId>
</dependency>

then, in application.properties: cassandre.trading.bot.exchange.driver-class-name=org.knowm.xchange.coinbasepro.CoinbaseProExchange

It works perfectly for me.

s-teamup commented 2 years ago

Thank you again, it’s working based on settings you shared. I tried for Coinbase.

peterboivin commented 5 months ago

Is this how the key and secret should look? I am getting the same error as this bug. The key and secret are old, so no privacy is exposed.

cassandre.trading.bot.exchange.driver-class-name=org.knowm.xchange.coinbasepro.CoinbaseProExchange cassandre.trading.bot.exchange.username=peterboivin@gmail.com cassandre.trading.bot.exchange.passphrase=<> cassandre.trading.bot.exchange.key=abcaa3d4-bcca-4ab9-bc1a-2d2dad8ed174 cassandre.trading.bot.exchange.secret=MHcCAQEEIJMzoQcy+HjSQvKShakGOaP6WJyz+Lmq4D1RH9zRDLfaoAoGCCqGSM49\nAwEHoUQDQgAEdoCNMc9HIAGKIZVj0cAvE/++/rmx6Ya/dJSk5jfrk4+Tz9rN4Xra\nbzXCIyZbbxzf3K0u2JwvKWs20Ia4kK/2GA==

straumat commented 5 months ago

Well... it looks like! even if, from what I remenber secret in coinbase was shorter. And your passphrase seems strange (<>)

peterboivin commented 5 months ago

Something is wrong because I do not see passphrase anywhere. I need to input API key nickname, IP whitelist, Portfolio, and then three checkboxes View (read-only), Trade (execute trades on your behalf), and Transfer (initiate transfer of funds).

straumat commented 5 months ago

So put nothing in passphrase, in your example you set "<>"

peterboivin commented 5 months ago

Tried it. Didn't work.

On Fri, Apr 19, 2024 at 11:55 AM Stéphane Traumat @.***> wrote:

So put nothing in passphrase, in your example you set "<>"

— Reply to this email directly, view it on GitHub https://github.com/cassandre-tech/cassandre-trading-bot/issues/785#issuecomment-2066856854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB6SQOXE2Z5HTCFEKWLY6E5A3AVCNFSM5GRTETS2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBWGY4DKNRYGU2A . You are receiving this because you commented.Message ID: @.***>

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

peterboivin commented 5 months ago

from Coinbase: You have to wait for 48hrs for the verification process.

It would be nice if they put that somewhere.

On Fri, Apr 19, 2024 at 12:07 PM Peter Boivin @.***> wrote:

Tried it. Didn't work.

On Fri, Apr 19, 2024 at 11:55 AM Stéphane Traumat < @.***> wrote:

So put nothing in passphrase, in your example you set "<>"

— Reply to this email directly, view it on GitHub https://github.com/cassandre-tech/cassandre-trading-bot/issues/785#issuecomment-2066856854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB6SQOXE2Z5HTCFEKWLY6E5A3AVCNFSM5GRTETS2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBWGY4DKNRYGU2A . You are receiving this because you commented.Message ID: @.***>

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

peterboivin commented 5 months ago

Also, I just ran renovate[bot] on the project. This is something new I just discovered. This resolved my problems.

On Fri, Apr 19, 2024 at 12:56 PM Peter Boivin @.***> wrote:

from Coinbase: You have to wait for 48hrs for the verification process.

It would be nice if they put that somewhere.

On Fri, Apr 19, 2024 at 12:07 PM Peter Boivin @.***> wrote:

Tried it. Didn't work.

On Fri, Apr 19, 2024 at 11:55 AM Stéphane Traumat < @.***> wrote:

So put nothing in passphrase, in your example you set "<>"

— Reply to this email directly, view it on GitHub https://github.com/cassandre-tech/cassandre-trading-bot/issues/785#issuecomment-2066856854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6UB6SQOXE2Z5HTCFEKWLY6E5A3AVCNFSM5GRTETS2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBWGY4DKNRYGU2A . You are receiving this because you commented.Message ID: @.***>

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin

-- Peter Boivin PH#: 508 755 1721 http://voice.google.com/calls?a=nc,%2B15087551721 https://bit.ly/xscranberry-grape http://www.linkedin.com/in/peterboivin