forked from stellar-deprecated/kelp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_buysell.cfg
102 lines (87 loc) · 6.55 KB
/
sample_buysell.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Sample config file for the "buysell" strategy
# Price Feeds
# Note: we take the value from the A feed and divide it by the value retrieved from the B feed below.
# the type of feeds can be one of crypto, fiat, fixed, exchange, sdex, function.
# specification of feed type "exchange"
DATA_TYPE_A="exchange"
# the specification of the A feed
# the format is <exchange name>/<base-asset-code-defined-by-exchange>/<quote-asset-code-defined-by-exchange>/<modifier>
# exchange name:
# use "kraken" or any of the ccxt-exchanges (run `kelp exchanges` for full list)
# examples: "kraken", "ccxt-kraken", "ccxt-binance", "ccxt-poloniex", "ccxt-bittrex"
# base asset code defined by exchange:
# this is the asset code defined by the exchange for the asset whose price you want to fetch (base asset).
# this code can be retrieved from the exchange's website or from the ccxt manual for ccxt-based exchanges.
# quote asset code defined by exchange:
# this is the asset code defined by the exchange for asset in which you want to quote the price (quote asset).
# this code can be retrieved from the exchange's website or from the ccxt manual for ccxt-based exchanges.
# modifier:
# this is a modifier that can be included only for feed type "exchange".
# a modifier allows you to fetch the "mid" price, "ask" price, "bid" price, or "last" price for now.
# if left unspecified then this is defaulted to "mid" for backwards compatibility (until v2.0 is released) (LOH-2)
# uncomment below to use binance, poloniex, or bittrex as your price feed. You will need to set up CCXT to use this, see the "Using CCXT" section in the README for details.
# be careful about using USD vs. USDT since some exchanges support only one, or both, or in some cases neither.
#DATA_FEED_A_URL="ccxt-kraken/XLM/USD/last"
#DATA_FEED_A_URL="ccxt-binance/XLM/USDT/ask"
#DATA_FEED_A_URL="ccxt-poloniex/XLM/USDT/bid"
# bittrex does not have an XLM/USD market so this config lists XLM/BTC instead; you should NOT use this when trying to price an asset based on the XLM/USD price (unless you know what you are doing).
#DATA_FEED_A_URL="ccxt-bittrex/XLM/BTC"
DATA_FEED_A_URL="kraken/XXLM/ZUSD/mid"
# sample priceFeed with the "crypto" type
#DATA_TYPE_A="crypto"
# this is the URL to a coinmarketcap feed which the bot understands.
#DATA_FEED_A_URL="https://api.coinmarketcap.com/v1/ticker/stellar/"
# this is a fixed value of 1 here because the exchange and sdex priceFeeds provides a ratio of two assets.
DATA_TYPE_B="fixed"
DATA_FEED_B_URL="1.0"
# sample priceFeed with the "fiat" type.
#DATA_TYPE_B="fiat"
# you can use a service like apilayer.net to get prices for fiat if you want real-time updates. You will need to fill in the access_key in this url
#DATA_FEED_B_URL="http://apilayer.net/api/live?access_key=¤cies=NGN"
# sample priceFeed with the "sdex" type
# this feed pulls from the SDEX, you can use the asset you're trading or something else, like the same coin from another issuer
# DATA_TYPE_A = "sdex"
# this is a string representing a SDEX pair; the format is CODE:ISSUER/CODE:ISSUER
# for XLM leave the issuer string blank
# DATA_FEED_A_URL="COUPON:GBMMZMK2DC4FFP4CAI6KCVNCQ7WLO5A7DQU7EC7WGHRDQBZB763X4OQI/XLM:"
# sample priceFeed of type "function"
# this feed type uses one of the pre-defined functions to recursively operate on other price feeds
# all URLs for this type of feed are formatted like so: function_name(feed_type/feed_url[,feed_type/feed_url])
#DATA_TYPE_A = "function"
# the supported functions for now are only the "max" and "invert" functions, example usage:
# "max": max(exchange/ccxt-kraken/XLM/USD/mid,exchange/ccxt-binance/XLM/USDT/mid) -- will give you the larger price
# between kraken's mid price and binance's mid price
# "invert": invert(exchange/ccxt-kraken/XLM/USD/mid) -- will give you the effective USD/XLM price
#DATA_FEED_A_URL = "max(exchange/ccxt-kraken/XLM/USD/mid,exchange/ccxt-binance/XLM/USDT/mid)"
# what value of a price change triggers re-creating an offer. Price change refers to the existing price of the offer vs. what price we want to set. value is a percentage specified as a decimal number (0 < value < 1.00)
PRICE_TOLERANCE=0.001
# what value of an amount change triggers re-creating an offer. Amount change refers to the existing amount of the offer vs. what amount we want to set. value is a percentage specified as a decimal number (0 < value < 1.00)
AMOUNT_TOLERANCE=0.001
# how much percent to offset your rates by, specified as a decimal (ex: 0.05 = 5%). Can be used in conjunction with RATE_OFFSET below.
# A positive value indicates that your base asset (ASSET_A) has a higher rate than the rate received from your price feed
# A negative value indicates that your base asset (ASSET_A) has a lower rate than the rate received from your price feed
RATE_OFFSET_PERCENT=0.0
# how much to offset your rates by, specified in number of units of the quote asset (ASSET_B) as a decimal.
# Can be used in conjunction with RATE_OFFSET_PERCENT above.
# A positive value indicates that your base asset (ASSET_A) has a higher rate than the rate received from your price feed
# A negative value indicates that your base asset (ASSET_A) has a lower rate than the rate received from your price feed
RATE_OFFSET=0.0
# specifies the order in which to offset the rates. If true then we apply the RATE_OFFSET_PERCENT first otherwise we apply the RATE_OFFSET first
# example rate calculation when set to true: ((rate_from_price_feed_a/rate_from_price_feed_b) * (1 + rate_offset_percent)) + rate_offset
# example rate calculation when set to false: ((rate_from_price_feed_a/rate_from_price_feed_b) + rate_offset) * (1 + rate_offset_percent)
RATE_OFFSET_PERCENT_FIRST=true
# scale factor for the amount we want to set (0 < value), can be greater than 1.
AMOUNT_OF_A_BASE=10.0
####################################################################################################
############################## ALL LISTS AND OBJECTS BELOW THIS LINE ###############################
####################################################################################################
# levels are mirrored on the buy and sell side. spread is a percentage specified as a decimal number (0 < spread < 1.00)
# first level
[[LEVELS]]
SPREAD=0.0010 # distance from mid price = 0.10%, i.e. bid/ask spread = 0.20%
AMOUNT=100.0 # multiple of base amount = 10.0 * 100 units of base asset
# second level
[[LEVELS]]
SPREAD=0.0015 # distance from mid price = 0.15%, i.e. bid/ask spread = 0.30%
AMOUNT=100.0 # multiple of base amount = 10.0 * 100 units of base asset
# you can have as many levels as you want, just create more entries here