Permalink
Branch: master
Find file Copy path
e2ddb40 Feb 13, 2019
1 contributor

Users who have contributed to this file

216 lines (197 sloc) 5.91 KB
// Local config for the dx-tools when using bots
// - Here you can add your desired bot configuration.
// - If you only modify this file you can keep updating the repository with
// the latest changes
// Setup:
// 1. Duplicate this file and call it 'bots-conf.js'
// note:
// 'bots-conf.js' is git ignored, so you can add all your configuration here
// you should NEVER share this file with anyone
// Get the markets (configured used environment variables)
// i.e. MARKETS=RDN-WETH,OMG-WETH
// See the network-<networkName>.conf files
const MARKETS = []
const TOKENS = []
const DEFAULT_GAS_PRICE_USED = 'fast' // safeLow, average, fast
const MAIN_BOT_ACCOUNT = 0
// Buy bot rules
const BUY_LIQUIDITY_RULES_DEFAULT = [
// Buy 1/2 if price falls below 99%
{
marketPriceRatio: {
numerator: 99,
denominator: 100
},
buyRatio: {
numerator: 1,
denominator: 2
}
},
// Buy the 100% if price falls below 96%
{
marketPriceRatio: {
numerator: 96,
denominator: 100
},
buyRatio: {
numerator: 1,
denominator: 1
}
}
]
const PRICE_REPO = {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/PriceRepoImpl.js
factory: 'src/repositories/PriceRepo/PriceRepoImpl',
priceFeedStrategiesDefault: {
strategy: 'sequence',
feeds: ['binance', 'huobi', 'kraken', 'bitfinex', 'idex', 'hitbtc', 'liquid']
},
priceFeedStrategies: {
'WETH-OMG': {
strategy: 'sequence',
feeds: ['binance', 'huobi', 'bitfinex']
},
'WETH-RDN': {
strategy: 'sequence',
feeds: ['huobi', 'binance', 'bitfinex']
},
'DAI-MKR': {
strategy: 'sequence',
feeds: ['hitbtc', 'bitfinex']
},
'WETH-DAI': {
strategy: 'sequence',
feeds: ['hitbtc', 'bitfinex']
},
'WETH-MKR': {
strategy: 'sequence',
feeds: ['hitbtc', 'bitfinex']
},
'WETH-GEN': {
strategy: 'sequence',
feeds: ['idex', 'liquid']
}
},
priceFeeds: {
binance: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoBinance.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoBinance'
},
huobi: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoHuobi.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoHuobi'
},
kraken: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoKraken.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoKraken',
url: 'https://api.kraken.com',
version: '0'
},
bitfinex: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoBitfinex.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoBitfinex'
},
idex: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoIdex.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoIdex'
},
hitbtc: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoHitbtc.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoHitbtc'
},
liquid: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/feeds/PriceRepoLiquid.js
factory: 'src/repositories/PriceRepo/feeds/PriceRepoLiquid'
}
},
strategies: {
sequence: {
// https://github.com/gnosis/dx-services/blob/master/src/repositories/PriceRepo/strategies/sequence.js
factory: 'src/repositories/PriceRepo/strategies/sequence'
}
}
}
// Buy bots
const BUY_BOT_MAIN = {
name: 'Main buyer bot',
// https://github.com/gnosis/dx-services/blob/master/src/bots/BuyLiquidityBot.js
factory: 'src/bots/BuyLiquidityBot',
markets: MARKETS,
accountIndex: MAIN_BOT_ACCOUNT,
rules: BUY_LIQUIDITY_RULES_DEFAULT,
notifications: [],
checkTimeInMilliseconds: 60 * 1000 // 60s
}
// Sell Bots
const SELL_BOT_MAIN = {
name: 'Main seller bot',
// https://github.com/gnosis/dx-services/blob/master/src/bots/SellLiquidityBot.js
factory: 'src/bots/SellLiquidityBot',
markets: MARKETS,
accountIndex: MAIN_BOT_ACCOUNT,
notifications: [],
checkTimeInMilliseconds: 60 * 1000 // 60s
}
const BALANCE_CHECK_BOT = {
name: 'Balance check bot',
// https://github.com/gnosis/dx-services/blob/master/src/bots/BalanceCheckBot.js
factory: 'src/bots/BalanceCheckBot',
tokens: TOKENS,
accountIndex: MAIN_BOT_ACCOUNT,
notifications: [],
minimumAmountForEther: 0.4,
minimumAmountInUsdForToken: 5000
}
const HIGH_SELL_VOLUME_BOT = {
name: 'High sell volume bot',
// https://github.com/gnosis/dx-services/blob/master/src/bots/HighSellVolumeBot.js
factory: 'src/bots/HighSellVolumeBot',
markets: MARKETS,
accountIndex: MAIN_BOT_ACCOUNT,
notifications: []
}
// This bot is required by other bots like the sell bot
const WATCH_EVENTS_BOT = {
name: 'Watch events bot',
markets: MARKETS,
// https://github.com/gnosis/dx-services/blob/master/src/bots/WatchEventsBot.js
factory: 'src/bots/WatchEventsBot'
}
const DEPOSIT_BOT = {
name: 'Deposit bot',
// https://github.com/gnosis/dx-services/blob/master/src/bots/DepositBot.js
factory: 'src/bots/DepositBot',
tokens: TOKENS,
accountIndex: MAIN_BOT_ACCOUNT,
notifications: [],
// You can use this to have some time to manually withdraw funds
inactivityPeriods: [{
from: '11:30',
to: '12:00'
}, {
from: '15:30',
to: '16:00'
}],
checkTimeInMilliseconds: 5 * 60 * 1000 // 5min
}
// Bots API Port
BOTS_API_PORT = 8081
module.exports = {
DEFAULT_GAS_PRICE_USED,
// Market and tokens
MARKETS,
// ...TOKEN_ADDRESSES,
// Bots config
BOTS: [
BUY_BOT_MAIN,
SELL_BOT_MAIN,
BALANCE_CHECK_BOT,
HIGH_SELL_VOLUME_BOT,
WATCH_EVENTS_BOT,
DEPOSIT_BOT
],
BUY_LIQUIDITY_RULES_DEFAULT,
BOTS_API_PORT,
// Price feed config
PRICE_REPO
}