This component is reponsible for computing the exchange rate of LUNA to submit and makes it available through an HTTP endpoints.
- Install dependencies
npm install
- Configure settings (see below)
# Copy sample config file
cp ./config/default.sample.js ./config/default.js
# make edits
vim ./config/default.js
- Run server
# Price is available at `tcp://127.0.0.1:8532/latest`
npm run start
You can find the sample configuration at: config/default.sample.js
. Oracle Price Server expects your configuration file at config/default.js
.
const fiatSymbols = [
'KRW/SDR',
'KRW/USD',
'KRW/MNT',
'KRW/EUR',
'KRW/CNY',
'KRW/JPY',
'KRW/GBP',
'KRW/INR',
'KRW/CAD',
'KRW/CHF',
'KRW/HKD',
'KRW/AUD',
]
module.exports = {
port: 8532,
sentry: '', // sentry dsn (https://sentry.io/ - error reporting service)
slack: {
// for incident alarm (e.g. exchange shutdown)
channel: '#bot-test',
url: '',
},
lunaProvider: {
adjustTvwapSymbols: ['LUNA/KRW', 'LUNA/USDT'],
bithumb: { symbols: ['LUNA/KRW'] },
coinone: { symbols: ['LUNA/KRW'] },
huobi: { symbols: ['LUNA/USDT'], krwPriceFrom: 'USDT' },
binance: { symbols: ['LUNA/USDT'], krwPriceFrom: 'USDT' },
},
cryptoProvider: {
adjustTvwapSymbols: ['BTC/KRW', 'USDT/USD'],
upbit: { symbols: ['BTC/KRW'] },
bithumb: { symbols: ['BTC/KRW'] },
binance: { symbols: ['BTC/USDT'] },
huobi: { symbols: ['LUNA/USDT'] },
bitfinex: { symbols: ['USDT/USD'] },
kraken: { symbols: ['USDT/USD'] },
},
fiatProvider: { // at least one fiatprovider should be set
currencylayer: {
symbols: fiatSymbols,
interval: 60 * 1000,
timeout: 5000,
// https://currencylayer.com/product
// recommend: business subscription(60second Updates): $79.99/month
apiKey: '', // necessary
},
// fixer: {
// symbols: fiatSymbols,
// interval: 60 * 1000,
// timeout: 5000,
// // https://fixer.io/product
// // recommend: professional plus(60second Updates): $80/month
// apiKey: '', // necessary
// },
// alphavantage: {
// symbols: fiatSymbols,
// interval: 60 * 1000,
// timeout: 5000,
// // https://www.alphavantage.co/premium/
// // recommend: 120 API request per minute: $49.99/month
// apiKey: '', // necessary
// },
},
}
Key | Type | Description |
---|---|---|
port |
number | Port number to expose the price server. |
sentry |
string | URL for sentry.io error reporting |
slack |
object | Slack webhook notification configuration |
lunaProvider |
object | Configuration for LUNA data provider. Current supported providers are bithumb , coinone , huobi , and binance . |
cryptoProvider |
object | Configuration for cryptocurrency data provider. Current supported providers are upbit , bithumb , binance , huobi , bitfinex , and kraken . |
fiatProvider |
object | Configuration for fiat currency data providers. Current supported providers are currencylayer , fixer , and alphavantage . |