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

Improvments3 #186

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
poetry env use 3.9 && poetry install
pip freeze
- name: Start Ganache
run: nohup ganache-cli --fork ${{ secrets.MAINNET_URL }}@18581106 -l 3000000000 -d -p 8545 -u 0x39e419ba25196794b595b2a595ea8e527ddc9856 &
run: nohup ganache-cli --fork ${{ secrets.MAINNET_URL }}@21380340 -l 3000000000 -d -p 8545 -u 0x39e419ba25196794b595b2a595ea8e527ddc9856 &
- name: "Run poetry pytest for ${{ matrix.python-version }}"
run:
poetry run pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
poetry env use 3.9 && poetry install
- name: "Run poetry style on ${{ matrix.python-version }}"
run:
poetry run pre-commit run --all-files
poetry run pre-commit run --all-files
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,26 @@ source vars.sh

### Set the chains you want to monitor

- Edit `monitored-chains.json` with the desired set of networks that you wish to monitor with the disputanble values monitor.

example, if you would like to monitor values only on mainnet Ethereum, sepolia, Amoy and localhost:
```
{
"monitored_chains": [1, 11155111, 80002, 1337]
}
```
*Note: Ethereum, sepolia, Amoy and localhost are required for testing.*

### Set RPC Endpoints
- Initialize telliot configuration:
```bash
poetry run telliot config init
```
You should now have a `telliot` folder in your home directory.

- Open `~/telliot/endpoints.yaml` with your favorite text editor. The Disputable-Values-Monitor will check reports on each chain that is configured in this list. Remove the networks that you don't want to monitor, and provide and endpoint url for those that you do. For example, if you want to monitor reports on Ethereum Mainnet and Sepolia testnet, your endpoints.yaml file should look like this:
- Open `~/telliot/endpoints.yaml` with your favorite text editor. Provide a reliable endpoint url for each chain that you would like to monitor. If any chain endpoints are needed by telliot-feeds for the data that you wish to monitor, add those to this file as well.

Example continued: You want to monitor reports on Sepolia (11155111) and Amoy (80002), but you want to make sure that any incorrect wsteth-usd-spot reports get flagged. Because the `wsteth-usd-spot` telliot feed requireds a mainnet (1) endpoint, you need to have a working endpoint for sepolia, Amoy, and mainnet:
```
type: EndpointList
endpoints:
Expand All @@ -74,6 +87,13 @@ endpoints:
provider: Infura
url: https://YOUR_SEPOLIA_ENDPOINT
explorer: https://sepolia.etherscan.io/
- type: RPCEndpoint
chain_id: 80002
network: polygon-amoy
provider: Matic
url: https://YOUR_AMOY_ENDPOINT
explorer: https://amoy.polygonscan.com/
monitored: True
```

### Run the DVM for Alerts Only
Expand All @@ -92,6 +112,10 @@ Enter `y` to confirm alerts only.

`-av`: to get an alert for all `NewReport` events (regardless of whether they are disputable or not).

`--initial_block_offset` : The number of blocks to look back when first starting the DVM. (CAUTION: stale data can cause false positives if this value is set too large, or if prices moved drastically in the recent past)

`-sc` : Use "skip confirmations" when running the DVM as a system service to skip config checks.

### Run the DVM for Automatic Disputes

**Disclaimer:**
Expand Down
102 changes: 102 additions & 0 deletions disputer-config copy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# AutoDisputer configuration file
feeds: # please reference https://github.com/tellor-io/dataSpecs/tree/main/types for examples of QueryTypes w/ Query Parameters
#ETH/USD
- query_id: "0x83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce4992"
threshold:
type: Percentage
amount: 0.75 # 75%
alert_amt: 0.10
#BTC/USD
- query_id: "0xa6f013ee236804827b77696d350e9f0ac3e879328f2a3021d473a0b778ad78ac"
threshold:
type: Percentage
amount: 0.75 # 75%
#OP/USD
- query_id: "0xafc6a3f6c18df31f1078cf038745b48e55623330715d90efe3dc7935efd44938"
threshold:
type: Percentage
amount: 0.75 # 75%
#STETH/USD
- query_id: "0x907154958baee4fb0ce2bbe50728141ac76eb2dc1731b3d40f0890746dd07e62"
threshold:
type: Percentage
amount: 0.75 # 75%
#TRB/USD
- query_id: "0x5c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0"
threshold:
type: Percentage
amount: 0.75 # 75%
#BRL/USD
- query_id: "0x7f3fc5bbf0bcc372beece1d2711095b6c884c69e21dad1180f2160adfcd8b044"
threshold:
type: Percentage
amount: 0.75 # 75%
#CNY/USD
- query_id: "0x2c81613b335c890096fd1c9a89766a2d71da2c9636505a9cb3b3dc7877cdad4b"
threshold:
type: Percentage
amount: 0.75 # 75%
#WSTETH/USD
- query_id: "0x1962cde2f19178fe2bb2229e78a6d386e6406979edc7b9a1966d89d83b3ebf2e"
threshold:
type: Percentage
amount: 0.75 # 75%
#RETH/USD
- query_id: "0x0bc2d41117ae8779da7623ee76a109c88b84b9bf4d9b404524df04f7d0ca4ca7"
threshold:
type: Percentage
amount: 0.75 # 75%
#CBETH/USD
- query_id: "0xbb5e0a51ab0e06354439f377e326ca71ec8149249d163f75f543fcdc25818e76"
threshold:
type: Percentage
amount: 0.75 # 75%
#OETH/USD
- query_id: "0xf30c232070ffa631fc6fc7b350ba261dab4d43cc98d43f4a29bff453b06e0911"
threshold:
type: Percentage
amount: 0.75 # 75%
#USDC/USD
- query_id: "0x8ee44cd434ed5b0e007eee581fbe0855336f3f84484e8d9989a620a4a49aa0f7"
threshold:
type: Percentage
amount: 0.75 # 75%
#USDT/USD
- query_id: "0x68a37787e65e85768d4aa6e385fb15760d46df0f67a18ec032d8fd5848aca264"
threshold:
type: Percentage
amount: 0.75 # 75%
#WBTC/USD
- query_id: "0x6fad0305c4cbd56b25a8ff90ec4e40031d1a74a5512f38c361514198d6184b6d"
threshold:
type: Percentage
amount: 0.75 # 75%
#WMNT/USD
- query_id: "0x931529a866017d1d1356bf4098b91e48060da9cede36f019446209a246abbef8"
threshold:
type: Percentage
amount: 0.75 # 75%
#METH/USD
- query_id: "0x3a9e54c25e1da43fe0321b83f173cf8db9026d012a9012422c2029b42bce0c09"
threshold:
type: Percentage
amount: 0.75 # 75%
#wUSDM/USD
- query_id: "0x6908dd654640ba7c223a7bfb615a6b6238b839f31e3cdcc8804483a620439912"
threshold:
type: Percentage
amount: 0.75 # 75%
#sDAI/USD
- query_id: "0x05cddb6b67074aa61fcbe1d2fd5924e028bb699b506267df28c88f7deac4edc6"
threshold:
type: Percentage
amount: 0.75 # 75%
#sFRAX/USD
- query_id: "0x53895ab7997ea4c92803bf333392bdbf8a79b10df9f1ef098ff3cea77a87f6b5"
threshold:
type: Percentage
amount: 0.75 # 75%
#EVMCALL
- query_type: EVMCall
threshold:
type: Equality
103 changes: 10 additions & 93 deletions disputer-config.yaml
Original file line number Diff line number Diff line change
@@ -1,101 +1,18 @@
# AutoDisputer configuration file
feeds: # please reference https://github.com/tellor-io/dataSpecs/tree/main/types for examples of QueryTypes w/ Query Parameters
feeds:
#ETH/USD
- query_id: "0x83a7f3d48786ac2667503a61e8c415438ed2922eb86a2906e4ee66d9a2ce4992"
threshold:
thresholds:
type: Percentage
amount: 0.75 # 75%
#BTC/USD
alrt_amount: 0.25 # 75
disp_amount: 0.75 # 75
# BTC/USD
- query_id: "0xa6f013ee236804827b77696d350e9f0ac3e879328f2a3021d473a0b778ad78ac"
threshold:
thresholds:
type: Percentage
amount: 0.75 # 75%
#OP/USD
- query_id: "0xafc6a3f6c18df31f1078cf038745b48e55623330715d90efe3dc7935efd44938"
threshold:
type: Percentage
amount: 0.75 # 75%
#STETH/USD
- query_id: "0x907154958baee4fb0ce2bbe50728141ac76eb2dc1731b3d40f0890746dd07e62"
threshold:
type: Percentage
amount: 0.75 # 75%
#TRB/USD
- query_id: "0x5c13cd9c97dbb98f2429c101a2a8150e6c7a0ddaff6124ee176a3a411067ded0"
threshold:
type: Percentage
amount: 0.75 # 75%
#BRL/USD
- query_id: "0x7f3fc5bbf0bcc372beece1d2711095b6c884c69e21dad1180f2160adfcd8b044"
threshold:
type: Percentage
amount: 0.75 # 75%
#CNY/USD
- query_id: "0x2c81613b335c890096fd1c9a89766a2d71da2c9636505a9cb3b3dc7877cdad4b"
threshold:
type: Percentage
amount: 0.75 # 75%
#WSTETH/USD
- query_id: "0x1962cde2f19178fe2bb2229e78a6d386e6406979edc7b9a1966d89d83b3ebf2e"
threshold:
type: Percentage
amount: 0.75 # 75%
#RETH/USD
- query_id: "0x0bc2d41117ae8779da7623ee76a109c88b84b9bf4d9b404524df04f7d0ca4ca7"
threshold:
type: Percentage
amount: 0.75 # 75%
#CBETH/USD
- query_id: "0xbb5e0a51ab0e06354439f377e326ca71ec8149249d163f75f543fcdc25818e76"
threshold:
type: Percentage
amount: 0.75 # 75%
#OETH/USD
- query_id: "0xf30c232070ffa631fc6fc7b350ba261dab4d43cc98d43f4a29bff453b06e0911"
threshold:
type: Percentage
amount: 0.75 # 75%
#USDC/USD
- query_id: "0x8ee44cd434ed5b0e007eee581fbe0855336f3f84484e8d9989a620a4a49aa0f7"
threshold:
type: Percentage
amount: 0.75 # 75%
#USDT/USD
- query_id: "0x68a37787e65e85768d4aa6e385fb15760d46df0f67a18ec032d8fd5848aca264"
threshold:
type: Percentage
amount: 0.75 # 75%
#WBTC/USD
- query_id: "0x6fad0305c4cbd56b25a8ff90ec4e40031d1a74a5512f38c361514198d6184b6d"
threshold:
type: Percentage
amount: 0.75 # 75%
#WMNT/USD
- query_id: "0x931529a866017d1d1356bf4098b91e48060da9cede36f019446209a246abbef8"
threshold:
type: Percentage
amount: 0.75 # 75%
#METH/USD
- query_id: "0x3a9e54c25e1da43fe0321b83f173cf8db9026d012a9012422c2029b42bce0c09"
threshold:
type: Percentage
amount: 0.75 # 75%
#wUSDM/USD
- query_id: "0x6908dd654640ba7c223a7bfb615a6b6238b839f31e3cdcc8804483a620439912"
threshold:
type: Percentage
amount: 0.75 # 75%
#sDAI/USD
- query_id: "0x05cddb6b67074aa61fcbe1d2fd5924e028bb699b506267df28c88f7deac4edc6"
threshold:
type: Percentage
amount: 0.75 # 75%
#sFRAX/USD
- query_id: "0x53895ab7997ea4c92803bf333392bdbf8a79b10df9f1ef098ff3cea77a87f6b5"
threshold:
type: Percentage
amount: 0.75 # 75%
#EVMCALL
alrt_amount: 0.25 # 75
disp_amount: 0.75 # 75
# EVMCALL
- query_type: EVMCall
threshold:
thresholds:
type: Equality
3 changes: 3 additions & 0 deletions monitored-chains.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"monitored_chains": [1, 11155111, 80002, 1337]
}
3 changes: 3 additions & 0 deletions monitored-chains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"monitored_chains": [1, 11155111, 80002, 1337]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ telliot-core = "^0.3.8"
lru-dict = "^1.3.0"
numpy = "^1.26.4"

[tool.poetry.dev-dependencies]
[poetry.dev.dependencies]
pytest = "^7.4.4"
black = "^22.12.0"
pre-commit = "^2.21.0"
Expand Down
Loading
Loading