From be5be3e23bc05e42621acb1a19358dcd5f1ec471 Mon Sep 17 00:00:00 2001 From: Jeremy Letang Date: Tue, 25 Jun 2024 09:20:02 +0100 Subject: [PATCH 1/2] feat: Add oracle + improvements - Add a new well known oracle entry for the scaled rebased price contract using Pyth. - Update the codegen script to support a new type field. Signed-off-by: Jeremy Letang --- ...0ab155794e7179c9ee2e38200202908c17b43.toml | 1 + ...6654FdB605637994047ecA217a02E224c4828.toml | 24 +++++++++++++++++++ ...abd606155442c21b7d561426d42bd0e40a776.toml | 1 + ...bc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml | 1 + ...AdAFab14d46e20144F48824d0C09B1a03F2BC.toml | 1 + ...af252d50cf2ab2fc73694845a16b7c8a0dc6f.toml | 1 + scripts/process-oracle-providers.js | 8 +++++++ 7 files changed, 37 insertions(+) create mode 100644 oracle-providers/eth_address-0x2BA6654FdB605637994047ecA217a02E224c4828.toml diff --git a/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml b/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml index beab914..847eff1 100644 --- a/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml +++ b/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml @@ -1,4 +1,5 @@ name = "Pyth Oracle" +type = "PYTH" url ="https://pyth.network" description_markdown = """ # The Pyth oracles contract diff --git a/oracle-providers/eth_address-0x2BA6654FdB605637994047ecA217a02E224c4828.toml b/oracle-providers/eth_address-0x2BA6654FdB605637994047ecA217a02E224c4828.toml new file mode 100644 index 0000000..b63cdb4 --- /dev/null +++ b/oracle-providers/eth_address-0x2BA6654FdB605637994047ecA217a02E224c4828.toml @@ -0,0 +1,24 @@ +name = "Pyth scaled rebased prices oracle" +type = "PYTH" +url =" https://github.com/vegaprotocol/pyth-rebase-contract" +description_markdown = """ +# Pyth scaled rebased prices oracle + +A simple contract providing scaled prices from the pyth on chain oracles quoted in USDT +""" + +[oracle] +source_chain = "gnosis" +source_chain_id = "100" +type = "eth_address" +eth_address= "0x2BA6654FdB605637994047ecA217a02E224c4828" +status = "GOOD" +status_reason = "" +first_verified = 2024-06-25T00:00:00Z +last_verified = 2024-06-25T00:00:00Z + +[[proofs]] +type = "web" +format = "url" +url = "https://gnosisscan.io/address/0x2BA6654FdB605637994047ecA217a02E224c4828#code" +available = true diff --git a/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml b/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml index 2894e31..6616296 100644 --- a/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml +++ b/oracle-providers/eth_address-0x719abd606155442c21b7d561426d42bd0e40a776.toml @@ -1,4 +1,5 @@ name = "Pyth rebased prices oracle" +type = "PYTH" url =" https://github.com/vegaprotocol/pyth-rebase-contract" description_markdown = """ # Pyth rebased prices oracle diff --git a/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml b/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml index 3f93e84..4cf81bd 100644 --- a/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml +++ b/oracle-providers/eth_address-0xbedbc6302eaffd4032dd1df94e326f7ecb9ff4f9.toml @@ -1,4 +1,5 @@ name = "Uniswap price sources" +type = "UNISWAP" url ="https://github.com/jeremyletang/uniswap_price_source" description_markdown = """ # Uniswap price source diff --git a/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml b/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml index aff29aa..f853f5d 100644 --- a/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml +++ b/oracle-providers/eth_address-0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC.toml @@ -1,4 +1,5 @@ name = "Coinbase Oracle" +type = "COINBASE" url ="https://coinbase.com" description_markdown = """ # Coinbase Oracle diff --git a/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml b/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml index f35a3e9..7847bf4 100644 --- a/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml +++ b/oracle-providers/public_key-69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f.toml @@ -1,4 +1,5 @@ name = "Vega Admin Oracle for Testnet" +type = "UNKNOWN" url ="https://fairground.wtf" description_markdown = """ The Vega Fairground admin oracle, uses a json file to settle based on Binance Spot price. diff --git a/scripts/process-oracle-providers.js b/scripts/process-oracle-providers.js index 28878c5..e410800 100644 --- a/scripts/process-oracle-providers.js +++ b/scripts/process-oracle-providers.js @@ -16,6 +16,13 @@ const STATUS = z.enum([ "COMPROMISED", ]); +const PROVIDER_TYPE = z.enum([ + "UNKNOWN", + "PYTH", + "COINBASE", + "UNISWAP", +]); + const BASE_PROOF_SCHEMA = z.object({ format: z.enum(["url", "signed_message"]), available: z.boolean(), @@ -69,6 +76,7 @@ const ORACLE_SCHEMA = z.discriminatedUnion("type", [ const PROVIDER_SCHEMA = z.object({ name: z.string().min(1), + type: PROVIDER_TYPE, url: z.string().url(), description_markdown: z.string(), oracle: ORACLE_SCHEMA, From bb45b70f111ea06cc7a40878bc8b9c0120757c73 Mon Sep 17 00:00:00 2001 From: jeremyletang Date: Tue, 25 Jun 2024 08:21:44 +0000 Subject: [PATCH 2/2] chore: process oracle providers Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- __generated__/oracle-proofs.json | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/__generated__/oracle-proofs.json b/__generated__/oracle-proofs.json index 2af299d..5741ad9 100644 --- a/__generated__/oracle-proofs.json +++ b/__generated__/oracle-proofs.json @@ -1,6 +1,7 @@ [ { "name": "Pyth Oracle", + "type": "PYTH", "url": "https://pyth.network", "description_markdown": "# The Pyth oracles contract\n\nPyth network provide many oracles prices.\n", "oracle": { @@ -21,8 +22,32 @@ ], "github_link": "https://github.com/vegaprotocol/well-known/blob/main/oracle-providers/eth_address-0x2880ab155794e7179c9ee2e38200202908c17b43.toml" }, + { + "name": "Pyth scaled rebased prices oracle", + "type": "PYTH", + "url": " https://github.com/vegaprotocol/pyth-rebase-contract", + "description_markdown": "# Pyth scaled rebased prices oracle\n\nA simple contract providing scaled prices from the pyth on chain oracles quoted in USDT\n", + "oracle": { + "status": "GOOD", + "status_reason": "", + "first_verified": "2024-06-25T00:00:00.000Z", + "last_verified": "2024-06-25T00:00:00.000Z", + "type": "eth_address", + "eth_address": "0x2BA6654FdB605637994047ecA217a02E224c4828" + }, + "proofs": [ + { + "format": "url", + "available": true, + "type": "web", + "url": "https://gnosisscan.io/address/0x2BA6654FdB605637994047ecA217a02E224c4828#code" + } + ], + "github_link": "https://github.com/vegaprotocol/well-known/blob/main/oracle-providers/eth_address-0x2BA6654FdB605637994047ecA217a02E224c4828.toml" + }, { "name": "Pyth rebased prices oracle", + "type": "PYTH", "url": " https://github.com/vegaprotocol/pyth-rebase-contract", "description_markdown": "# Pyth rebased prices oracle\n\nA simple contract providing prices from the pyth on chain oracles quoted in USDT\n", "oracle": { @@ -45,6 +70,7 @@ }, { "name": "Uniswap price sources", + "type": "UNISWAP", "url": "https://github.com/jeremyletang/uniswap_price_source", "description_markdown": "# Uniswap price source\n\nA smart contract providing prices from uniswap v3 pools\n", "oracle": { @@ -67,6 +93,7 @@ }, { "name": "Coinbase Oracle", + "type": "COINBASE", "url": "https://coinbase.com", "description_markdown": "# Coinbase Oracle\n\nCoinbase is a leading cryptocurrency exchange that provides an API serving signed oracle data in OpenOracle format. See the [API documentation](https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getcoinbasepriceoracle) for more details.\n\n_Note that although it remains supported, Coinbase Oracle appears relatively unmaintained. For example, it does not seem to gain support for new assets as they are listed on Coinbase and the docs no longer confirm the public key of the signer. The proof provided links to a prior version of the docs that confirms the key on archive.org and has been experimentally verified against the API results served at the time of this update._\n", "oracle": { @@ -89,6 +116,7 @@ }, { "name": "Vega Admin Oracle for Testnet", + "type": "UNKNOWN", "url": "https://fairground.wtf", "description_markdown": "The Vega Fairground admin oracle, uses a json file to settle based on Binance Spot price.\nE.g. in case the market is BTC/USDC the spot price for BTC/USDC on Binance will be used.\n\nTwitter: @VegaFairground\n", "oracle": {