# Monitoring

## Network ID

```
NETWORK_ID=369
```

Set this variable inside the .env file to match the network you're monitoring. \
DVM uses this variable for settings, but you still need to double check the [endpoints.yaml](https://docs.fetchoracle.com/votes-and-disputes/introduction-to-dvm/pages/OdTzxGgpsY1IblTiKFCH#endpoints.yaml-file) file.

## Confidence Threshold

{% hint style="warning" %}
Use `-c` or `--confidence-threshold` to specify a universal percentage confidence threshold for monitoring **only**.
{% endhint %}

Use `-a` or `--account-name` to specify a `chained` account to use for disputing:

```bash
cli -a <your account name without quotes>
```

## Alert All NewReports

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

```bash
cli -av
```

## Wait Between Checks

If you leave it as default, your DVM will scan the chain every few seconds for new reports.&#x20;

Use the `-w` (wait) option to set how often DVM will check for new reports:

```bash
cli -w 120
```

## Configuring QueryIDs and Thresholds to Monitor. <a href="#configuring-tresholds" id="configuring-tresholds"></a>

Monitored Feeds and their Thresholds are defined in the `disputer-config.yaml` file.

Generate queryIDs here: <https://go.fetchoracle.com/#/generate-query-id>

By default, the Auto-Disputer will monitor the PLS/USD feed with a threshold percentage of 10%. In the default `disputer-config.yaml`  in `disputable-values-monitor/disputer-config.yaml` this is represented as:

```yaml
# AutoDisputer configuration file
feeds:
  - query_id: "0x83245f6a6a2f6458558a706270fbcc35ac3a81917602c1313d3bfa998dcc2d4b"
    threshold:
      type: Percentage
      amount: 0.1 # 10%

```

Where `0x83245f6a6a2f6458558a706270fbcc35ac3a81917602c1313d3bfa998dcc2d4b` represents the `queryId` of the PLS/USD feed on Fetch Oracle.&#x20;

{% hint style="info" %}
It's recommended to monitor two 'simple' queries at once per DVM instance, although more is also possible.&#x20;
{% endhint %}

To change the query being monitored, simply add the new QueryID in the `query_id` field, using quotes.

To change the percentage threshold to dispute or send alerts, change the amount field where:

0.1 = 10%

1 = 100%

For example, to monitor a second query in the form of a `newQueryId`, follow the same pattern while respecting the file indentation, like so:

```yaml
- query_id: "0x83245f6a6a2f6458558a706270fbcc35ac3a81917602c1313d3bfa998dcc2d4b"
    threshold:
      type: Percentage
      amount: 0.1 # 10%
 - query_id: "newQueryID"
    threshold:
      type: Percentage
      amount: 0.75 # 75%

```

## Token Balance Alerts

### Reporters

Inside `telliot-feeds` folder there's a `.env` file which contains variables for DVM.

You can set `REPORTERS=` with the addresses of reporters to monitor their FETCH and PLS balance on chain. If these balances thresholds are met, DVM will send an alert to your Discord channel.

Instructions are present in the file, just remember to separate wallet addresses in REPORTERS= with a comma and to match the thresholds values with the same number of reporters.

For example, if you have 3 wallets, you need 3 thresholds, one for each wallet, in their respective order:

REPORTERS= "0x1...,0x2...,0x3"\
Threshold values= "100,150,200"

Above, wallet 0x1 will trigger with 100, wallet 2 with 150 and wallet 3 with 200.

### Disputer

You can also monitor FETCH and PLS balances for the disputer wallet selected for disputing (when starting DVM with the `-d` option). Set the thresholds for the tokens and it will send an alert when they're met.

## Stale Reporters

You can set a threshold, in seconds, to get notified if the reporters in REPORTERS= have not submitted

```
NO_REPORTING_THRESHOLD="43200, 43200"
```

The length and order or values should match REPORTERS=

## Stale queryIDs

You can set queryIDs to be monitored for stale submissions. If a queryID doesn't receive a submission in a X amount of seconds, you'll receive an alert.

{% code overflow="wrap" %}

```
#QueryIDs to monitor when was the last time they were reported, separated by commas.
#use "0x00000000000000000000000000000000000000000000000000000000000000000" as default if not using it.

QUERY_IDS="0x00000000000000000000000000000000000000000000000000000000000000000,0x00000000000000000000000000000000000000000000000000000000000000000"

#Thresholds, separated by commas, to send alerts if no report is submitted within threshold for queryIDs above.
#Must follow the length and order of QUERY_IDS=.

QUERYID_LAST_REPORT_THRESHOLD="43200, 43200" #Value in seconds. 43200 is for a 12h check.
```

{% endcode %}

Generate queryIDs here: <https://go.fetchoracle.com/#/generate-query-id>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fetchoracle.com/votes-and-disputes/introduction-to-dvm/monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
