bisq-network / bisq-pricenode

GNU General Public License v3.0
5 stars 12 forks source link

Include price feed from Kucoin exchange for XMRBTC price index calculation #49

Open dutu opened 6 months ago

dutu commented 6 months ago

Binance is being removed from XMRBTC price index calculation: https://github.com/bisq-network/bisq-pricenode/pull/48#issue-2123664162 Poloniex, for the past months, is also having larger price deviation (due to XMR withdrawl suspended) and being automatically removed: https://github.com/bisq-network/bisq-pricenode/issues/47#issuecomment-1932557344

Remaining exchanges for price index are Kraken and Bitfinex (https://github.com/bisq-network/bisq/discussions/7030#discussioncomment-8398116), however the daily trading volumes are small on these exchanges.

The proposal is to include KuCoin exchange for XMR price calculation where trading volumes are x5 higher than Kraken and Bitfinex combined, which would better align Bisq price with the actual market price..

Snapshot:

Daily XMR_BTC Volume
Kucoin:  35350.8748
Kraken:   4824.28773973
Bitfinex: 1988.91056587
Binance: 22324.65500000
Poloniex: 1227.7

Script:

#!/bin/bash

echo Daily XMR_BTC Volume

kucoin_volume=$(curl -s 'https://api.kucoin.com/api/v1/market/stats?symbol=XMR-BTC' | jq '.data.vol' | tr -d '"')
echo "Kucoin:  $kucoin_volume"

kraken_volume=$(curl -s 'https://api.kraken.com/0/public/Ticker?pair=XMRXBT' | jq '.result.XXMRXXBT.v[1]' | tr -d '"')
echo "Kraken:   $kraken_volume"

bitfinex_volume=$(curl -s 'https://api-pub.bitfinex.com/v2/ticker/tXMRBTC' | jq '.[7]' | tr -d '"')
echo "Bitfinex: $bitfinex_volume"

binance_volume=$(curl -s 'https://api.binance.com/api/v3/ticker/24hr?symbol=XMRBTC' | jq '.volume' | tr -d '"')
echo "Binance: $binance_volume"

poloniex_volume=$(curl -s 'https://api.poloniex.com/markets/XMR_BTC/ticker24h' | jq '.quantity' | tr -d '"')
echo "Poloniex: $poloniex_volume"
pazza83 commented 6 months ago

@jmacxx if this where to be implemented what exchanges would be used for the XMR/BTC price and what would be percentage weighting be post delisting from Binance / other exchanges?

pazza83 commented 6 months ago

FWIW TradeOgre has a trade volume (last 24 hours) of twice Kraken for the XMR/BTC market. TradeOgre also seems to have a price feed API https://tradeogre.com/help/api

ghost commented 6 months ago

It this were implemented XMR feeds would be:

Having only Bitfinex/Kraken the percentage weighting of each would be 50%.
Having only Bitfinex/Kraken/Kucoin, the percentage weighting of each would be 33%.
The price indices are equally weighted, after removal of divergent rates.


Note * : Poloniex price gets auto-removed as it is an outlier from the others. It seems to be a constant deviation to the low side. e.g. POLO XMR outlier price removed:0.00239, lower/upper bounds:0.0024498/0.00245, consensus price:0.0024498999999999996 Poloniex has other issues such as not allowing withdrawals, its XMR feed should probably be discontinued.


TradeOgre was proposed some months ago, see https://github.com/bisq-network/bisq-pricenode/pull/22.


pazza83 commented 6 months ago

Thanks, I would be in favor of Bitfinex/Kraken/Kucoin with a 33% weighing each