Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Oracle configs for XOF related pairs #10550

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/celotool/src/lib/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ export function getFullNodeHttpRpcInternalUrl(celoEnv: string) {
export function getFullNodeWebSocketRpcInternalUrl(celoEnv: string) {
return `ws://${celoEnv}-fullnodes-rpc.${celoEnv}.svc.cluster.local:8546`
}

export function getLightNodeHttpRpcInternalUrl(celoEnv: string) {
return `http://${celoEnv}-lightnodes-rpc.${celoEnv}.svc.cluster.local:8545`
}

export function getLightNodeWebSocketRpcInternalUrl(celoEnv: string) {
return `ws://${celoEnv}-lightnodes-rpc.${celoEnv}.svc.cluster.local:8546`
}
10 changes: 5 additions & 5 deletions packages/celotool/src/lib/k8s-oracle/base.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
getFornoUrl,
getFornoWebSocketUrl,
getFullNodeHttpRpcInternalUrl,
getFullNodeWebSocketRpcInternalUrl,
getLightNodeHttpRpcInternalUrl,
getLightNodeWebSocketRpcInternalUrl,
} from 'src/lib/endpoints'
import { envVar, fetchEnv, fetchEnvOrFallback } from 'src/lib/env-utils'
import {
Expand Down Expand Up @@ -68,12 +68,12 @@ export abstract class BaseOracleDeployer {
async helmParameters() {
const httpRpcProviderUrl = this.deploymentConfig.useForno
? getFornoUrl(this.celoEnv)
: getFullNodeHttpRpcInternalUrl(this.celoEnv)
: getLightNodeHttpRpcInternalUrl(this.celoEnv)
const wsRpcProviderUrl = this.deploymentConfig.useForno
? getFornoWebSocketUrl(this.celoEnv)
: getFullNodeWebSocketRpcInternalUrl(this.celoEnv)
: getLightNodeWebSocketRpcInternalUrl(this.celoEnv)
return [
`--set oracle.api_keys=${fetchEnv(envVar.ORACLE_FX_ADAPTERS_API_KEYS)}`,
`--set-literal oracle.api_keys=${fetchEnv(envVar.ORACLE_FX_ADAPTERS_API_KEYS)}`,
`--set environment.name=${this.celoEnv}`,
`--set image.repository=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_REPOSITORY)}`,
`--set image.tag=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_TAG)}`,
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/lib/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export function addCurrencyPairMiddleware(argv: yargs.Argv) {
'USDCBRL',
'CELOXOF',
'EUROCXOF',
'EURXOF',
'EUROCEUR',
],
description: 'Oracle deployment to target based on currency pair',
Expand Down
82 changes: 82 additions & 0 deletions packages/helm-charts/oracle/CELOXOF.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
oracle:
currencyPair: CELOXOF
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.025
maxPercentageBidAskSpread: 0.015
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'BINANCE', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BINANCE', symbol: 'EURUSDT', toInvert: true},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BINANCE', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BINANCE', symbol: 'EURUSDT', toInvert: true},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'COINBASE', symbol: 'CELOUSD', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: true},
{exchange: 'COINBASE', symbol: 'USDTEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'COINBASE', symbol: 'CELOUSD', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: true},
{exchange: 'COINBASE', symbol: 'USDTEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'OKX', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITSTAMP', symbol: 'USDTEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'OKX', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITSTAMP', symbol: 'USDTEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'KUCOIN', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'KRAKEN', symbol: 'USDTEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'KUCOIN', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'KRAKEN', symbol: 'USDTEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'BITGET', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITGET', symbol: 'USDTEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BITGET', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITGET', symbol: 'USDTEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
]
]"
# Additional sources missing adapters [
# {exchange: 'UPBIT', symbol: 'CELOKRW', toInvert: false},
# {exchange: 'UPBIT', symbol: 'BTCKRW', toInvert: true},
# {exchange: 'KRAKEN', symbol: 'BTCEUR', toInvert: false},
# {exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
# ]
minPriceSourceCount: 6
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.005
50 changes: 50 additions & 0 deletions packages/helm-charts/oracle/EUROCXOF.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
oracle:
currencyPair: EUROCXOF
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.01
maxPercentageBidAskSpread: 0.005
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'COINBASE', symbol: 'EUROCEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'COINBASE', symbol: 'EUROCEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'COINBASE', symbol: 'EUROCUSD', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: true},
{exchange: 'COINBASE', symbol: 'USDTEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'COINBASE', symbol: 'EUROCUSD', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: true},
{exchange: 'COINBASE', symbol: 'USDTEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],

[
{exchange: 'BITSTAMP', symbol: 'EUROCEUR', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BITSTAMP', symbol: 'EUROCEUR', toInvert: false},
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false, ignoreVolume: true}
]
]"
minPriceSourceCount: 4
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.0005 # 0.05%
26 changes: 26 additions & 0 deletions packages/helm-charts/oracle/EURXOF.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
oracle:
currencyPair: EURXOF
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.01
maxPercentageBidAskSpread: 0.005
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'ALPHAVANTAGE', symbol: 'EURXOF', toInvert: false}
],
[
{exchange: 'CURRENCYAPI', symbol: 'EURXOF', toInvert: false}
]
]"
minPriceSourceCount: 2
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.0005 # 0.05%
Loading