market-maker
market-maker copied to clipboard
TapTools Price feed integration
- Attempt should be made for configuration changes to be backward compatible.
- Need to add price feed from TapTools using this api.
- Configuration should support either only Maestro or only TapTools price provider.
- Configuration should support multiple price providers (more than 1), in which case, there should be a parameter to check if different price feeds agree within a certain percentage. If not, bot should cancel all the orders and quit itself.
Current implementation is backwards compatible. The structure of 'mbc_price_config' determines if MMBot is initiated with the old (deprecated) configuration or the new one. The yaml structure of the new "Price provider configuration" is as follows:
# Price provider configuration.
mbc_price_config:
# Configuration parameters independent of prices providers.
pc_price_commonCfg:
# Common resolution parameter for API call, for both prices providers. Note that the price considered is the closing price of latest resolution window. Available choices: CRes5m, CRes15m, CRes30m, CRes1h, CRes4h, CRes1d, CRes1w, CRes1mo.
pcc_common_resolution: CRes5m # example: five minutes
pcc_network_id: mainnet
# Relative weights assigned to each price provider in the computation of the average price.
pcc_prices_providers_weights: [1, 1] # example: equal weights
# Difference threshold triggering automatic cancelation of open orders. without warning.
pcc_price_diff_threshold1: 0.3 # example: relative standard deviation above 30%
# Difference threshold triggering automatic cancelation of open orders, sending a warning. Should not be smaller than Threshold1.
pcc_priceDiff_threshold2: 0.6 # example: relative standard deviation above 60%
# Delay after closing all orders if Threshold1 is triggered.
pcc_price_diff_delay1: 60000000 # example: one minute (in microseconds)
# Delay after closing all orders if Threshold2 is triggered.
pcc_price_diff_delay2: 120000000 # example: two minutes
# Configuration parameters for each prices provider
pc_prices_provider_cfgs:
- maestro_config:
# Maestro API key. Fetching prices from https://docs.gomaestro.org/DefiMarketAPI/mkt-dex-ohlc endpoint requires a paid subscription.
mc_api_key: <<MAESTRO_TOKEN>>
mc_resolution_override: 15m # example: uses 15m, instead of 5m, as Maestro's resolution
mc_dex: genius-yield # TODO: would it work if 'minswap' is used?
mc_pair_override: null
- taptools_config:
# Taptools API key.
ttc_api_key: <<TAPTOOLS_TOKEN>>
ttc_resolution_override: 3m # example: uses 3m, instead of 5m, as Taptool's resolution
Note that implementation supports either only Maestro or only TapTools being set as price provider.