Skip to content

Commit

Permalink
COP, KES, USDT Oracle config (#10984)
Browse files Browse the repository at this point in the history
* Yaml file drafts

* Update COPUSD Config

* Update KESUSD and rename USDKES.yaml to KESUSD.yaml

* Rename USDCOP.yaml to COPUSD.yaml

* Adding KESUSD data source

* CELOKES and KESUSD config

* chore: test USDTUSD config

* fix: remove openexchangerates from kesusd

* chore: add pair constants

* chore: add alfajores & baklava kesusd and usdtusd addresses

* fix: use pnpm instead of yarn

* fix: update min oracles for CELOKES

* chore: add mainnet kes hsms

* USDTUSD config from Nadiem

* test: proof of concept 2e2 test using anvil devchain (#11020)

* chore(test-sol/FeeCurrencyDirectory)): use `@celo-...` remapping not `../..`

* test(test-sol/FeeCurrencyDirectory)): MVP e2e test

MVP demo of an e2e test using the devchain. This is not the pattern I'll suggest, but good to see the test passes end-to-end.

* chore(foundry.toml): adds `@test-sol` remapping

* chore(test-sol/e2e): adds MVP `utils.sol`

Idea is to have a Devchain class that can be inherited by Test contracts to have access to the deployed contracts on the devchain.

* test(FeeCurrencyDirectory): MVP test using `Devchain` class

* chore(migrations_sol): adds MVP script to run e2e tests

* style(test-sol/e2e): linting

* refactor(test-sol/FeeCurrencyDirectory): moves file to `.../e2e/`

* chore(migrations_sol): use `test-sol/e2e/*` path

* chore(test-sol/FeeCurrencyDirectory): match contract name in unit and e2e test

* style(test-sol/FeeCurrencyDirectory): linting

* chore(e2e/utils): removes unused imports and more

Cleans up
Adds `TODO` comments

* test(test-sol/e2e): renames contract with "E2E..."

I'm temporarily adding the "E2E..." prefix to the contract so I can exclude this test and the integration tests during the CI run.

In a separate PR, I'll refactor the tests into a directory structure like:

```
test-sol/unit/
test-sol/e2e/
test-sol/integration/
```

That way we could run tests with something like this:

```
# unit tests
forge test --match-path "*test-sol/unit/*"

# e2e tests
forge test --match-path "*test-sol/e2e/*"

# integration tests
forge test --match-path "*test-sol/integration/*"
```

* chore(workflows/protocol_tests): excludes e2e test from workflow

I'm temporarily adding the "E2E..." prefix to the contract so I can exclude this test and the integration tests during the CI run.

In a separate PR, I'll refactor the tests into a directory structure like:

```
test-sol/unit/
test-sol/e2e/
test-sol/integration/
```

That way we could run tests with something like this:

```
# unit tests
forge test --match-path "*test-sol/unit/*"

# e2e tests
forge test --match-path "*test-sol/e2e/*"

# integration tests
forge test --match-path "*test-sol/integration/*"
```

* style(test-sol/e2e): linting

* chore(e2e): temporarily renames contract with "E2E..."

In subsequent PRs, I'll rename this more accurately.

* chore: latest deployed images

* feat: add ReserveSpenderMultiSig to anvil migrations (#11028)

* feat(migrations_sol/migrationsConfig): adds `reserveSpenderMultiSig` configs

* feat(migrations_sol): adds `migrateReserveSpenderMultiSig`

Also adds contract calls in `migrateReserve` function.
Not tested, and not sure this works yet. I might be missing some changes.

* chore(test-sol/utils): adds `ReserveSpenderMultiSig.t.sol`

From the code comment:

  The purpose of this file is not to provide test coverage for `ReserveSpenderMultiSig.sol`.
  This is an empty test to force foundry to compile `ReserveSpenderMultiSig.sol`, and include its
  artifacts in the `/out` directory. `ReserveSpenderMultiSig.sol` is needed in the migrations
  script, but because it's on Solidity 0.5 it can't be imported there directly.
  If there is a better way to force foundry to compile `ReserveSpenderMultiSig.sol` without
  this file, this file can confidently be deleted.

* feat(migrations_sol/HelperInterFaces): adds `IReserveSpenderMultiSig`

The helper interface is used as a workaround to allow the migrations script (`Migrations.s.sol`) to be on Solidity 0.8, while the ReserveSpenderMultiSig contract is on Solidity 0.5. The migration script only needs to initialize the contract, which is why the helper interface only defines an `initialize` function.

* chore(migrations_sol): initialize `ReserveSpenderMultiSig`

* chore(migrations_sol): adds code comment for readability

* chore(migrations_sol): improves code comment, moves code block up

* chore(migrations_sol): fix typo

* style(migrations_sol): linting

* test: refactor foundry test directory into unit, e2e, and integration tests (#11023)

* chore(foundry.toml): adds `@mento-core/...` remapping

Also moves existing mappings into groups for better readability

* refactor(test-sol/common): moves files to `unit/common/`

Also updates imports respectively using remappings.

* refactor(test-sol/identity): moves files to `unit/identity/`

Also updates imports using remappings where necessary.

* refactor(test-sol/stability): moves files to `unit/stability/`

Also updates imports using remappings where necessary.

* refactor(test-sol/voting): moves files to `unit/voting/`

Also updates imports using remappings where necessary.

* refactor(test-sol/governance): moves files to `unit/governance/`

Also updates imports using remappings where necessary.

* chore(test-sol): update missing remappings

With these changes all contracts compile and resolve correctly.

* chore(workflows/protocol_tests): updates paths to `test-sol/unit`

* chore(workflows/protocol_tests): adds integration and e2e tests

* style(workflows/protocol_tests): refactors `forge test` for better readability

* chore(migrations_sol): moves scripts to `scripts/foundry/

Moves all bash scripts from `migrations_sol` to `scripts/foundry/`, and updates paths where necessary. We already have a directory for `scripts/truffle/` and `scripts/bash/`, so this makes it easier to find foundry-related bash scripts.

* test(governance/mock): move `MockGovernance` to `unit/` folder

* refactor(foundry.toml): rename `migrations-sol/` remapping

* refactor(workflows): refactor "run everything" step

Runs all tests in the `unit/` directory instead of all test files in the repo.
This makes sense from my perspective, because e2e tests (in the `e2e/` directory) and integration tests (in the `integration/` directory) require a connection to an anvil devchain serving at localhost.

The intent of this command is to ensure that no unit tests are forgotten, since unit tests are run explicitly by going through the directories above. But, the intention is not to run all tests in the repo generally.

* style(workflows/protocol-devchain-anvil): splits migration into 2 steps

This helps the script becoming more readable, and ensure error logs are clearly associated with a workflow step rather than a single bash script.

* chore(workflows): defines `ANVIL_PORT` env variable in workflow

Previously, the `$ANVIL_PORT` variable was exported and passed around as an env variable in a bash script.

But that required generating anvil migrations and running a devchain repeatedly.
Instead, the workflow does that once and different steps can access the devchain.

But, in that case the env variable is not passed around, so it has to be defined at the workflow level.

Source: https://docs.github.com/en/actions/learn-github-actions/variables

* chore(workflows/protocol_tests): removes code comment

* feat(scripts/foundry): adds `stop_anvil.sh`

* refactor(scripts/foundry): use `stop_anvil.sh` to stop anvil

* feat(protocol/package.json): adds `anvil-devchain:...` (`start` and `stop`)

* refactor(scripts/foundry): use `stop_anvil.sh` to stop anvil

* refactor(migrations_sol): update `@migrations-sol` remapping

Previous the remapping was called `@celo-migrations`.

* docs(migrations_sol/README): renames README file

Also changes title to match NPM package name. This is a matter of personal preference. IMO this is a small improvement in readability for 3rd party users.

* docs(scripts/foundry): adds more links to `package.json`

Adds `repository` and `directory` to `package.json`.
This ensures npmjs.org displays hyperlinks to the github repository.

* docs(migrations_sol/CONTRIBUTING): adds MVP dev docs

We can complete this doc with additional information regarding the anvil devchain and migrations going forward.

* docs(migrations_sol/README): adds "how we work" section

This is helpful for 3rd party developers that found this package on npmjs.org.
The links help developers take action and help improve the anvil devchain.

* Soloseng/CHORE-update-workflow (#11029)

* update workflow to run on push to release branches

* ++ mintgoldschedule to migration test constants

* set celo-foundry to 0.5

* force CI test after changing PR base

---------

Co-authored-by: Nadiem Sissouno <[email protected]>
Co-authored-by: Nadiem Sissouno <[email protected]>
Co-authored-by: Nelson Taveras <[email protected]>
Co-authored-by: Arthur Gousset <[email protected]>
Co-authored-by: soloseng <[email protected]>
  • Loading branch information
6 people committed Jun 18, 2024
1 parent 26ddf3c commit 0f7753e
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .env.alfajores
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CELOSTATS_BANNED_ADDRESSES=""
CELOSTATS_RESERVED_ADDRESSES=""

ORACLE_DOCKER_IMAGE_REPOSITORY="us-west1-docker.pkg.dev/celo-testnet-production/celo-oracle/celo-oracle"
ORACLE_DOCKER_IMAGE_TAG="1.0.12"
ORACLE_DOCKER_IMAGE_TAG="459947a"

AZURE_ORACLE_CENTRALUS_AZURE_SUBSCRIPTION_ID=7a6f5f20-bd43-4267-8c35-a734efca140c
AZURE_ORACLE_CENTRALUS_AZURE_TENANT_ID=7cb7628a-e37c-4afb-8332-2029e418980e
Expand All @@ -40,6 +40,9 @@ AZURE_ORACLE_CENTRALUS_EUROCEUR_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_CELOXOF_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_EURXOF_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_EUROCXOF_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_KESUSD_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_CELOKES_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_USDTUSD_ORACLE_ADDRESSES_FROM_MNEMONIC_COUNT=4
AZURE_ORACLE_CENTRALUS_FULL_NODES_COUNT=2
AZURE_ORACLE_CENTRALUS_FULL_NODES_DISK_SIZE=30
AZURE_ORACLE_CENTRALUS_FULL_NODES_ROLLING_UPDATE_PARTITION=0
Expand Down
8 changes: 7 additions & 1 deletion .env.baklava
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CELOCLI_STANDALONE_IMAGE_REPOSITORY="gcr.io/celo-testnet/celocli-standalone"
CELOCLI_STANDALONE_IMAGE_TAG="0.0.30-beta2"

ORACLE_DOCKER_IMAGE_REPOSITORY="us-west1-docker.pkg.dev/celo-testnet-production/celo-oracle/celo-oracle"
ORACLE_DOCKER_IMAGE_TAG="1.0.12"
ORACLE_DOCKER_IMAGE_TAG="459947a"

# ---- Full Node Chain Restore ----

Expand Down Expand Up @@ -68,6 +68,9 @@ AZURE_ORACLE_WESTUS2_EUROCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x6866e306b32acae7
AZURE_ORACLE_WESTUS2_CELOXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x96eda2cad69c8cd1daeb80da86d24825f45f46b7:baklava-celoxof-oracle2,0x4e9d441fd1c77222395a1853d851fea8a0e3aed8:baklava-celoxof-oracle3
AZURE_ORACLE_WESTUS2_EURXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x7fe5f297dd812ca21e7bf1cbf145a0b59227b35f:baklava-eurxof-oracle2,0x2addc69c2ce3a9d93a8291419319bf7f0a2c6c82:baklava-eurxof-oracle3
AZURE_ORACLE_WESTUS2_EUROCXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x729e058e97c099c79af674bbe2f687171432dd17:baklava-eurocxof-oracle2,0xd226aa9ee80ee282339c1ae69f3f811dbe5d895a:baklava-eurocxof-oracle4
AZURE_ORACLE_WESTUS2_CELOKES_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x84f0d0c9385de3509cdf6eb2fb168e35b0dbad92:baklava-celokes-oracle2,0x2db4d3bf7e744b422812b63b036c401828be7778:baklava-celokes-oracle3
AZURE_ORACLE_WESTUS2_KESUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x94cd5463902630dd22db8ac41242002e6a7a6844:baklava-kesusd-oracle2,0xd3e70b118b674c4db7fde6946b16070bf9ec5ce3:baklava-kesusd-oracle3
AZURE_ORACLE_WESTUS2_USDTUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x9829cf05869f1b9770f4ce9d5653909f1f9e4c5e:baklava-usdtusd-oracle2,0xdfbcbae6de4fb7b72dbad402b975e374441395ea:baklava-usdtusd-oracle3
AZURE_ORACLE_WESTUS2_FULL_NODES_COUNT=2
AZURE_ORACLE_WESTUS2_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_WESTUS2_FULL_NODES_DISK_SIZE=30
Expand All @@ -94,6 +97,9 @@ AZURE_ORACLE_CENTRALUS_EUROCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x9a0613e8a1ff6c
AZURE_ORACLE_CENTRALUS_CELOXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xd056a29e86161a34692c34f4c95933b59de077dc:baklava-celoxof-oracle0,0x5ad07f89176298ae3a0f3d20d0b4a756307d46e7:baklava-celoxof-oracle1
AZURE_ORACLE_CENTRALUS_EURXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xa4a46db00840e6525ffe79aee5990abaebb7479d:baklava-eurxof-oracle0,0x6e537c9462ed968ff08eab430c5f8c11eab7df1a:baklava-eurxof-oracle1
AZURE_ORACLE_CENTRALUS_EUROCXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x1a637c38671512866317475d19df5f55b0802276:baklava-eurocxof-oracle0,0x8589f0bb307581b96877f9e1a5ce3fcb05127fd0:baklava-eurocxof-oracle1
AZURE_ORACLE_CENTRALUS_CELOKES_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x0468aabc726f2f8d6bc612af99bf994026654a34:baklava-celokes-oracle0,0x8fc0c18b0fc7c11d4af89f0be046ed17dd1fe0f4:baklava-celokes-oracle1
AZURE_ORACLE_CENTRALUS_KESUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xf44345ff4ae8a3e18ae3e7d9c6b3de62736fb01c:baklava-kesusd-oracle0,0xb9410ac25ae1424190f6b4e45dcabd4d32168e5f:baklava-kesusd-oracle1
AZURE_ORACLE_CENTRALUS_USDTUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x2b4b450daecaf5a011497762380cdf1938791f85:baklava-usdtusd-oracle0,0x179282dcbf4c506332b0376cf5bcebd6ca9ec2f3:baklava-usdtusd-oracle1
AZURE_ORACLE_CENTRALUS_FULL_NODES_COUNT=2
AZURE_ORACLE_CENTRALUS_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_CENTRALUS_FULL_NODES_DISK_SIZE=30
Expand Down
6 changes: 5 additions & 1 deletion .env.rc1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CELOCLI_STANDALONE_IMAGE_TAG="0.0.42"
MOCK_ORACLE_CRON_SCHEDULE="*/5 * * * *"

ORACLE_DOCKER_IMAGE_REPOSITORY="us-west1-docker.pkg.dev/celo-testnet-production/celo-oracle/celo-oracle"
ORACLE_DOCKER_IMAGE_TAG="1.0.12"
ORACLE_DOCKER_IMAGE_TAG="4c63b13"

ORACLE_UNUSED_ORACLE_ADDRESSES=0xB93Fe7906ea4221b3fbe23412D18Ab1B07FE2F71,0x8d25D74E43789079Ef3C6B965c3D22b63A1233aC,0xCD88Cc79342a7cFE78E91FAa173eC87704bDcA9a,0x5091110175318A2A8aF88309D1648c1D84d31B29,0xBBd6e54Af7A5722f42461C6313F37Bd50729F195,0xE23a4c6615669526Ab58E9c37088bee4eD2b2dEE

Expand Down Expand Up @@ -80,6 +80,8 @@ AZURE_ORACLE_WESTUS_EUROCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x6e7c84f8377856901
AZURE_ORACLE_WESTUS_CELOXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xce696d465dde582095fce8b67e1a31ceb45ad922:mainnet-celoxof-wus0,0xbc211b8dfecdd5784f9c419ce64f7de1377bae88:mainnet-celoxof-wus1,0xc659ab5c049b726c2945a8a44b783ce6afbd2ceb:mainnet-celoxof-wus2,0x9094bf2b2eb028c6fcc56e7d46ea28bb6e03c9a5:mainnet-celoxof-wus3,0xb947c54be882314623ee3d74684d0d785dd50335:mainnet-celoxof-wus4
AZURE_ORACLE_WESTUS_EURXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x6a033b7217fbae843a3ffc9783ef9f87dd3a1c04:mainnet-eurxof-wus0,0x8a164c0523bbd7ec70172807723cca9a948858bb:mainnet-eurxof-wus1,0xd0066f198ed7f8dc3684ff3ac77511ef58a9aed3:mainnet-eurxof-wus2,0x441061f8b1f8ee2722d3608bfa0b5c4c14dee813:mainnet-eurxof-wus3,0x87089ec6adbf3c994ae7c47d3aa7d4fc104d0422:mainnet-eurxof-wus4
AZURE_ORACLE_WESTUS_EUROCXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xc5a86597d514b423579684cdf9f49b6df37e3689:mainnet-eurocxof-wus0,0x8e1423ca0bcb15093f52d1d07675e0aa04e3da75:mainnet-eurocxof-wus1,0xa47e6a8a7db5ee22b5293704a4f0f5f8fdaab06f:mainnet-eurocxof-wus2,0x77d148efdd40202d0eec787073a70c7f6bc9c485:mainnet-eurocxof-wus3,0xfef8748fd3f039fb8cfa77c7744b171f4396659c:mainnet-eurocxof-wus4
AZURE_ORACLE_WESTUS_CELOKES_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x7b50b90144ce27557ed352d499a13f458aef74d0:mainnet-celokes-wus0,0x0eb570af5ab2a9eea97bb413d7dcc12edbf87172:mainnet-celokes-wus1
AZURE_ORACLE_WESTUS_KESUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xf72c29b7047166c6576378d976c44c58fa767bb9:mainnet-kesusd-wus0,0x5bcc4f89b1176f5e68269d232d2c5b274ad1d81e:mainnet-kesusd-wus1
AZURE_ORACLE_WESTUS_FULL_NODES_COUNT=5
AZURE_ORACLE_WESTUS_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_WESTUS_FULL_NODES_DISK_SIZE=100
Expand All @@ -106,6 +108,8 @@ AZURE_ORACLE_WESTEUROPE_EUROCEUR_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xa633c79ac2c68
AZURE_ORACLE_WESTEUROPE_CELOXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0x4d89a0c95de82ae78c42fad4f8d3f87c4495fd37:mainnet-celoxof-weu0,0xa97dbefac6026f93cc5714c4c150b7466e9502ef:mainnet-celoxof-weu1,0x676931c73c8d6b09b0c192baf821e3fd2d693750:mainnet-celoxof-weu2,0xfb8f294c8cd98cf059672c1a6153f85555f10a90:mainnet-celoxof-weu3,0xb7614f7174a07028a5ff5e1adc68a031b646857f:mainnet-celoxof-weu4
AZURE_ORACLE_WESTEUROPE_EURXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xd2c4f59724df51026f857a7e188b322e35256e24:mainnet-eurxof-weu0,0xe47c9867dbb37110834aaaf65b8d760c49c22081:mainnet-eurxof-weu1,0x9cb4896447a8f2611f5fb6f5fc853ffa16a1d864:mainnet-eurxof-weu2,0x0f9786b083c8c22e2e839286230098048a20a0ec:mainnet-eurxof-weu3,0xe01890c7760445908128f0e64e1170866566e1f6:mainnet-eurxof-weu4
AZURE_ORACLE_WESTEUROPE_EUROCXOF_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xdda1d71f3d5a6090bc04b77a18925fab7054d9c3:mainnet-eurocxof-weu0,0xee1d05f81e90b8ece440de6141282404e83830ce:mainnet-eurocxof-weu1,0xff6e35c6119742fd1eb3db780d976c4e55585108:mainnet-eurocxof-weu2,0x59eac333453279e71a3a98b4b72bdfa99ca51ad3:mainnet-eurocxof-weu3,0x378b95092bed2acb0d3ae6ab9c045eef1c250872:mainnet-eurocxof-weu4
AZURE_ORACLE_WESTEUROPE_CELOKES_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xcfba5ea29501d26fc3e6e0851bb13375ea0401ef:mainnet-celokes-weu0,0xe0a634c4aac4494930ba50f59b751a5ddabe4679:mainnet-celokes-weu1,0xe000bce6c6f87ac39f3c4f4b5daa38dd32433217:mainnet-celokes-weu2
AZURE_ORACLE_WESTEUROPE_KESUSD_ORACLE_ADDRESS_AZURE_KEY_VAULTS=0xeab3df01269abd314465148e0c075d49fbd4b59b:mainnet-kesusd-weu0,0x28cd8a609560fb1ff1011387e4c40deabef029c0:mainnet-kesusd-weu1,0xf6d2d7ec798ae1b80046594345805298e0ac1624:mainnet-kesusd-weu2
AZURE_ORACLE_WESTEUROPE_FULL_NODES_COUNT=5
AZURE_ORACLE_WESTEUROPE_FULL_NODES_ROLLING_UPDATE_PARTITION=0
AZURE_ORACLE_WESTEUROPE_FULL_NODES_DISK_SIZE=100
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
"@types/bn.js": "4.11.6",
"bignumber.js": "9.0.0"
}
}
}
4 changes: 4 additions & 0 deletions packages/celotool/src/lib/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ export function addCurrencyPairMiddleware(argv: yargs.Argv) {
'EUROCEUR',
'EURXOF',
'EUROCXOF',
'KESUSD',
'COPUSD',
'CELOKES',
'USDTUSD',
],
description: 'Oracle deployment to target based on currency pair',
demandOption: true,
Expand Down
95 changes: 95 additions & 0 deletions packages/helm-charts/oracle/CELOKES.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
oracle:
currencyPair: CELOKES
overrideOracleCount: 12 # At 5s block time, every client reports once per minute
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.01
maxPercentageBidAskSpread: 0.03
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'BINANCE', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'KRAKEN', symbol: 'USDTUSD', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BINANCE', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'KRAKEN', symbol: 'USDTUSD', toInvert: false},
{exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'COINBASE', symbol: 'CELOUSD', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'COINBASE', symbol: 'CELOUSD', toInvert: false},
{exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'OKX', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'OKX', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
{exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'KUCOIN', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'KUCOIN', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: false},
{exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BITMART', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: false},
{exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
[
{exchange: 'BITMART', symbol: 'CELOUSDT', toInvert: false},
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: false},
{exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
],
]"
# Additional sources missing adapters [
# {exchange: 'GATEIO', symbol: 'CELOUSDT', toInvert: false},
# {exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
# {exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
# ],
# [
# {exchange: 'GATEIO', symbol: 'CELOUSDT', toInvert: false},
# {exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
# {exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
# ],
# {exchange: 'BYBIT', symbol: 'CELOUSDT', toInvert: false},
# {exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
# {exchange: 'ALPHAVANTAGE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
# ],
# [
# {exchange: 'BYBIT', symbol: 'CELOUSDT', toInvert: false},
# {exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false},
# {exchange: 'XIGNITE', symbol: 'USDKES', toInvert: false, ignoreVolume: true}
# ],

minPriceSourceCount: 7
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.005
27 changes: 27 additions & 0 deletions packages/helm-charts/oracle/COPUSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
oracle:
currencyPair: COPUSD
overrideOracleCount: 12 # At 5s block time, every client reports once per minute
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.01
maxPercentageBidAskSpread: 0.03
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'ALPHAVANTAGE', symbol: 'USDCOP', toInvert: true}
],
[
{exchange: 'XIGNITE', symbol: 'COPUSD', toInvert: false}
]
]"
minPriceSourceCount: 2
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.0005 # 0.05%
31 changes: 31 additions & 0 deletions packages/helm-charts/oracle/KESUSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
oracle:
currencyPair: KESUSD
overrideOracleCount: 12 # At 5s block time, every client reports once per minute
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.01
maxPercentageBidAskSpread: 0.03
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'ALPHAVANTAGE', symbol: 'KESUSD', toInvert: false}
],
[
{exchange: 'XIGNITE', symbol: 'KESUSD', toInvert: false}
]
]"
# Additional sources missing adapters [
# [
# {exchange: 'OPENEXCHANGERATES', symbol: 'KESUSD', toInvert: false}
# ],
minPriceSourceCount: 2
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.0005 # 0.05%
44 changes: 44 additions & 0 deletions packages/helm-charts/oracle/USDTUSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
oracle:
currencyPair: USDTUSD
aggregation:
mid:
maxExchangeVolumeShare: 1
maxPercentageDeviation: 0.005
maxPercentageBidAskSpread: 0.005
metrics:
enabled: true
prometheusPort: 9090
apiRequestTimeoutMs: 5000
circuitBreakerPriceChangeThreshold: 0.25
gasPriceMultiplier: 1.5
priceSources: "[
[
{exchange: 'OKX', symbol: 'USDCUSDT', toInvert: true},
{exchange: 'KRAKEN', symbol: 'USDCUSD', toInvert: false }
],
[
{exchange: 'KRAKEN', symbol: 'USDTUSD', toInvert: false}
],
[
{exchange: 'BITSTAMP', symbol: 'USDTUSD', toInvert: false}
],
[
{exchange: 'COINBASE', symbol: 'USDTUSD', toInvert: false}
],
]"
# Additional sources missing adapters
# [
# {exchange: 'BYBIT', symbol: 'USDCUSDT', toInvert: true},
# {exchange: 'BITSTAMP', symbol: 'USDCUSD', toInvert: false }
# ],
#
# https://api.bybit.com/v5/market/tickers?category=spot&symbol=USDCUSDT
# [
# {exchange: 'CRYPTO', symbol: 'USDTUSD', toInvert: false}
# ],
# https://api.crypto.com/exchange/v1/public/get-tickers?instrument_name=USDT_USD
minPriceSourceCount: 3 # 4 with additional sources
reportStrategy: BLOCK_BASED
reporter:
blockBased:
minReportPriceChangeThreshold: 0.0005 # 0.05%
2 changes: 1 addition & 1 deletion packages/helm-charts/oracle/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spec:
ADDRESSES={{- range $index, $identity := .Values.oracle.identities -}}{{ $identity.address }},{{- end }}
export ADDRESS=`echo -n $ADDRESSES | cut -d ',' -f $((RID + 1))`
exec yarn start
exec pnpm start
env:
- name: REPLICA_NAME
valueFrom:
Expand Down

0 comments on commit 0f7753e

Please sign in to comment.