forked from xeroc/bitshares-pricefeed
-
Notifications
You must be signed in to change notification settings - Fork 19
/
bsip42.yaml
261 lines (241 loc) · 8.28 KB
/
bsip42.yaml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# If true, a new price feed needs manual confirmation
confirm: True
# The producer name(s)
producer: $PRODUCER
# Exchange settings (Here, you may need to add API keys)
exchanges:
####################################
# BTC Exchange Rates
####################################
btc_price:
klass: Composite
aggregation_type: 'first_valid'
order: ['coinmarketcap', 'worldcoinindex', 'coindesk']
exchanges:
worldcoinindex:
klass: WorldCoinIndex
api_key:
free_subscription: True
quotes:
- BTC
- USDT
- ETH
bases:
- USD
coinmarketcap:
klass: Coinmarketcap
quotes:
- USDT
- BTC
- ETH
bases:
- USD
####################################
# Crypto Exchange Rates
####################################
aex:
klass: Aex
quotes:
- BTS
bases:
- USDT
- CNC
aliases:
CNC: CNY
binance:
klass: Binance
quotes:
- BTS
bases:
- BTC
openledger:
klass: Graphene
quotes:
- BTS
bases:
- OPEN.BTC
aliases:
OPEN.BTC: BTC
gdex:
klass: Graphene
quotes:
- BTS
bases:
- GDEX.BTC
aliases:
GDEX.BTC: BTC
bitshares:
klass: Graphene
quotes:
- CNY
bases:
- BTS
aliases:
CNY: BITCNY
coinegg:
klass: CoinEgg
quotes:
- BTS
bases:
- BTC
cointiger:
klass: CoinTiger
quotes:
- BTS
- BITCNY
bases:
- BTC
- ETH
gateio:
klass: GateIo
enable: False
quotes:
- BTS
bases:
- BTC
- USDT
huobi:
klass: Huobi
quotes:
- BTS
bases:
- BTC
- USDT
- ETH
lbank:
klass: Lbank
quotes:
- BTS
bases:
- BTC
- ETH
poloniex:
klass: Poloniex
quotes:
- BTS
bases:
- BTC
zb:
klass: Zb
quotes:
- BTS
bases:
- BTC
- USDT
- QC
qc_fees:
klass: Manual
feed:
QC:
CNY:
price: 0.995
volume: 1.0
magicwallet:
klass: MagicWallet
api_key:
period: 1h
# default settings
default:
# max age of a feed
maxage: 43200
# minimum percentage that forces a publish
min_change: 1
# warn if price change goes above this percentage
warn_change: 10
# skip publishing a feed if price goes above this percentage
skip_change: 20
# skip publishing a feed if producer is not an active witness.
skip_inactive_witness: True
# how to derive a single price from several sources
# Choose from: "median", "mean", or "weighted" (by volume)
metric: weighted
# Select sources for this particular asset. Each source
# has its own fetch() method and collects several markets
# any market of an exchanges is considered but only the
# current asset's price is derived
#
# Choose from: - "*": all,
# - loaded exchanges (see below)
sources:
-*
# Core exchange factor for paying transaction fees in
# non-BTS assets. Premium of 5%
core_exchange_factor: 1.2
# maintenance collateral ratio (percentage)
maintenance_collateral_ratio: 175.0
# Maximum short squeeze ratio
maximum_short_squeeze_ratio: 110.0
# If set to True, prices are also derived via 3
# markets instead of just two:
# E.g.: GOLD:USD -> USD:BTC -> BTC:BTS = GOLD:BTS
derive_across_3markets: True
# Activate the global settlement protection and the percentage of protection.
# If price to publish goes below global settlement price,
# use global_settlement_price * (maximum short squeeze ratio + global_settlement_protection) / 100 as feed price.
# This could be used with BSIP42 as margin calls are not eaten fast enough and global
# settlement triggered on a short deep.
# Default is None.
global_settlement_protection: 2
# Enabled assets that are derived if no asset is provided via command
# line
assets:
#BTC:
#USD:
CNY:
# One of:
#
# - 'adjusted_feed_price':
# formula: settlement_price * (1 + premium * adjustment_scale)
# discussion: https://bitsharestalk.org/index.php?topic=26315.msg322091#msg322091
# mandatory additional settings:
# - `target_price_adjustment_scale`: arbitrary adjustment to apply,
# acceptable value are between 0.8 and 1.2.
# - `target_price_adjustment_scale_at_premium`: use a different adjustement when
# there is premium real_price > dex_price.
# - `target_price_adjustment_scale_at_discount`: use a different adjustement when
# there is discount real_price < dex_price.
#
# - 'adjusted_real_price_empowered':
# formula: real_price * pow(1 + premium + theorical_premium, acceleration_factor)
# discussion: https://bitsharestalk.org/index.php?topic=26315.msg321699#msg321699
# mandatory additional settings:
# - `target_price_theorical_premium`: acceptable premium,
# a neutral price will be send when premium is equal to this. Ex: 0.02 .
# - `target_price_acceleration_factor`: exponential factor to increase adjustment impact.
# Acceptable values are between 1.5 and 4.
#
# - 'adjusted_dex_price_using_buckets':
# formula: dex_price * (1 + (K * (premium * 100)))
# discussion: https://bitsharestalk.org/index.php?topic=26315.msg321713#msg321713
#
# - 'pid':
# forumla: dex_price * pid_adjustment
# discussion: https://bitsharestalk.org/index.php?topic=26278.msg322246#msg322246
# mandatory additional settings:
# - `target_price_pid_proportional_factor`: factor for the proportinal part of the PID adjustment;
# it scales the premium adjustment.
# - `target_price_pid_integral_factor`: factor for the integral part of the PID adjustment;
# it impacts how fast the adjustment will accumulate over time.
# - `target_price_pid_derivative_factor`: factor for the derivative part of the PID adjustment;
# it impacts how strong is the curve direction will change the adjustment.
# - `target_price_pid_safe_upward_feed_change`: feed price will never move more that this ratio when the curve is upward;
# used to avoid big feed prices moves.
# - `target_price_pid_safe_downward_feed_change`: feed price will never move more that this ratio when the curve is downward;
# used to avoid big feed prices moves.
# - `target_price_pid_historic_value_file`: file path where to store past values that will be used in the next run.
# optional additional settings:
# - `target_price_pid_integral_adjustment_max`: max value for integral part of the PID adjustment.
# - `target_price_pid_integral_adjustment_min`: min value for integral part of the PID adjustment.
target_price_algorithm: 'adjusted_feed_price'
target_price_adjustment_scale_at_discount: 0.5
target_price_adjustment_scale_at_premium: 1
# Intermediate assets are useful for 2 and 3 market price derivation
# E.g.: USD:BTC -> BTC:BTS = USD:BTS
# GOLD:USD -> USD:BTC -> BTC:BTS = GOLD:BTS
intermediate_assets:
#- CNY
- USD
- BTC
- USDT
- BITCNY
- ETH