Exchange configuration

Class managing the exchange configuration and connection.

Exchange auto configuration.

ExchangeAutoConfiguration class configures the exchange connexion with the parameters specified in application.properties :

#
# Exchange configuration.
cassandre.trading.bot.exchange.name=kucoin
cassandre.trading.bot.exchange.username=cassandre.crypto.bot@gmail.com
cassandre.trading.bot.exchange.passphrase=cassandre
cassandre.trading.bot.exchange.key=5df8eea30092f40009cb3c6a
cassandre.trading.bot.exchange.secret=5f6e91e0-796b-4947-b75e-eaa5c06b6bed
#
# Modes.
cassandre.trading.bot.exchange.modes.sandbox=true
cassandre.trading.bot.exchange.modes.dry=false
#
# Exchange API calls rates (ms or standard ISO 8601 duration like 'PT5S').
cassandre.trading.bot.exchange.rates.account=100
cassandre.trading.bot.exchange.rates.ticker=101
cassandre.trading.bot.exchange.rates.trade=102
#
# Database configuration.
spring.jpa.hibernate.ddl-auto=update
cassandre.trading.bot.database.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
cassandre.trading.bot.database.datasource.url=jdbc:hsqldb:mem:cassandre
cassandre.trading.bot.database.datasource.username=sa
cassandre.trading.bot.database.datasource.password=

This class does the following things :

  • Validate parameters.

  • Connect to the specified exchange.

  • Creates the services.

  • Creates the flux.

The parameters are read and validated by ExchangeParameters and their description is below:

Parameter

Description

cassandre.trading.bot.exchange.name

Name of the exchange you want to access. You can find a full list here.

cassandre.trading.bot.exchange.username

Exchange username.

cassandre.trading.bot.exchange.passphrase

Exchange passphrase.

cassandre.trading.bot.exchange.key

Exchange key.

cassandre.trading.bot.exchange.secret

Exchange secret.

cassandre.trading.bot.exchange.modes.sandbox

If set to true, Cassandre will use the exchange sandbox.

cassandre.trading.bot.exchange.modes.dry

If set to true, Cassandre will simulate orders/accounts without sending anything to the exchange.

cassandre.trading.bot.exchange.rates.account

Maximum rates at which the exchange account service is called.

cassandre.trading.bot.exchange.rates.ticker

Maximum rates at which the exchange ticker service is called.

cassandre.trading.bot.exchange.rates.trade

Maximum rates at which the exchange trade service is called.

cassandre.trading.bot.database.datasource.driver-class-name

JDBC drivers class to use for database backup

cassandre.trading.bot.database.datasource.url

JDBC URL to use for database backup

cassandre.trading.bot.database.datasource.username

Database username

cassandre.trading.bot.database.datasource.password

Database password