# Reporting Options

{% hint style="info" %}
You can check Telliot options running `telliot --help`.&#x20;
{% endhint %}

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FKagy3nV09kmwi6ZagFc9%2Fimage.png?alt=media&#x26;token=35f07ab3-0910-45e4-b72f-1f4c067512d0" alt=""><figcaption><p>You can also dive in options, like this: <code>telliot report --help</code> and it will explain more details about 'report' option</p></figcaption></figure>

## Staking and Unstaking

<mark style="color:blue;">We reccomend to quickly do this from Fetch Dashbord's</mark> [Staking section](https://testnet.fetchoracle.com/#/staking-rewards)<mark style="color:blue;">, but Telliot also has built in functions you can use.</mark>

### Staking

Using `telliot stake` you can stake additional tokens to your current stake. Select your account with `-a` and `--amount`, like this:

`telliot stake -a <yourAccName> --amount 600000`

It will ask you to confirm your password and it will deposit the extra amount you typed on top of your current stake amount. For example, if your previous amount was 500,000 and you use `--amount 600000` you'll end up with 1,100,000 tokens deposited.

After staking you get a successful deposit transaction URL and telliot stops.

{% hint style="info" %}
You can also stake using the `-s` option while running the usual `telliot report` command. Notice, though, that this option will only top up the amount you chose according to your current stake amount. If you type `-s 600000` and have 500000 already staked, it will stake an additional 100000 only, topping up 500000 to the 600000 desired.

For this function to work correctly, you need to have the `--password` flag enabled and enter it at least once OR just set the PASSWORD= variable in .env file for automatically unlocking your account when password is needed.
{% endhint %}

{% hint style="warning" %}
**NOTE:** If the reporter account's actual stake is reduced after a dispute, the reporter will attempt to stake the difference in FETCH to return to the original desired stake amount if the `-s` is present.

To avoid this, run it without the `-s` flag. It may stop reporting when there's deduction in stake amount depending on your total stake.
{% endhint %}

### Requesting Withdraw

To start the unstake process we use `telliot request-withdraw` to put the tokens in the 7 days lock period state before actually withdrawing them. Process is similar to staking.

`telliot request-withdraw -a <yourAccName> --amount 200000`

After confirming the password you get a requestStakingWithdraw transaction URL if successful and Telliot stops.

### Withdrawing Locked Balance

<mark style="color:blue;">Remember you can check Fetch Dashboard's</mark> [Staking section](https://testnet.fetchoracle.com/#/staking-rewards) <mark style="color:blue;">for detailed info on the state of your locked balance and withdrawal.</mark>

To use Telliot to withdraw we need `telliot withdraw` and the acc name. After the 7 days have passed, calling this function withdraws ALL the tokens in Locked Balance.&#x20;

{% hint style="danger" %}
Everytime tokens in locked balance are moved, by unstaking or staking/re-staking, the 7 days reset!

Be mindful of that and only unstake the amount you actually won't need for the next 7 days and when you are sure you won't need to stake any more tokens to that reporter during the unstake period.&#x20;

Also, tokens you stake while having tokens in 'locked balance' are deducted from 'locked balance' prior to your actual wallet balance.
{% endhint %}

`telliot withdraw -a <yourAccName>`

If the 7 days are gone since you requested the withdraw, you'll get a transaction URL confirming the withdrawal. Otherwise, you'll get a revert saying the 7 days haven't passed yet.

## Submitting Once

To submit a simple single report, add the `--submit-once` option, like this:

```
telliot report -a <yourAccName> -qt pls-usd-spot --submit-once
```

After one value is submitted to Fetch Oracle, the Telliot process will terminate.

## Reporting in Intervals

To stop trying to report every 7 seconds, we can use the `-wp` option and specify what interval, in seconds, we want Telliot to *try* to submit a report. Here' how:

```
telliot report -a <yourAccName> -qt pls-usd-spot -wp 3600
```

Here, Telliot will submit the first report and then wait 3,600 seconds (1 hour) to try to submit the next one. If you are out of report lock period it will succeed, otherwise, it will try again 3,600 seconds later.

## Stop reporting based on Native token balance

```
telliot report -a <yourAccName> -qt pls-usd-spot -mnb 40000
```

You can use the -mnb option to stop Telliot when it detects your native token balance (PLS in PulseChain) reached the threshold you set.

The example above would have stopped Telliot from submitting when reaching <40,000 PLS balance. If you send more PLS to the account it will resume reporting.

## Reporting When Profitable

Telliot can submit when there's a percentage profit or USD profit from time based rewards and tips.

Using the `-p` option we set 2 parameters: % and USD thresholds. If we don't want to check for profits and just submit we can use `-p YOLO 0` which would report straight away and not check for profits at all.

By default Telliot checks for at least 100% profit above 0 USD. The profit is calculated using the FETCH price of fetch-usd-spot source against the gas cost to submit the transaction.

Example:

`-p 1000 2` would only submit a report if the profit after calculating the gas price is above *1000% or 2 Dollars* (based on the FETCH price at the time of reporting).

If you want to use only percentage profit or only USD, set the un-desired value to something really high, so it never passes the validation and only the desired one is checked, example:

`-p 200 999` would only submit with a 200% profit, since 999 USD will very unlikely ever happen.

{% hint style="info" %}
Check the .env file inside `telliot-feeds` folder.&#x20;

In Testnet, the FETCH price is usually mocked to the launch price of 0.001. If you want to use the actual price from tfetch-usd-spot source in Testnet, remove the 0.001 value of the variable and leave it empty.

This is important for calculating profit and reporting tfetch-usd-spot prices in Testnet.

*In Mainnet, it will use the spot price from fetch-usd-spot for profit calculations.*
{% endhint %}

Here are more examples:

`telliot report -a <yourAccName> -qt pls-usd-spot -p 300 5`

Here we're going to submit a report if the percentage profit is above 300% or $5 dollars. If one of these two conditions are met, it reports.

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FRxiWE7KjEMPrwXthsurJ%2Fimage.png?alt=media&#x26;token=0bafa354-25cd-42e6-b05f-0efac5c56c8b" alt=""><figcaption><p>You can see your parameters in the details after confirming password</p></figcaption></figure>

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FSA77Mx0qOnyFg5hSgW3B%2Fimage.png?alt=media&#x26;token=e119330a-1c15-4f2b-8e2b-5bf66a9c1385" alt=""><figcaption><p>Profit is less than $5 dollars, but way above 300%, so it submits the report. If -<code>p</code> was <code>200000</code> and <code>5</code> it would not submit, since both parameters would be above the actual profit.</p></figcaption></figure>

#### Enforcing *no profit* checks:

`telliot report -a <yourAccName> -qt pls-usd-spot -p YOLO 0`

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FNK9rJpePSFNZajKRqOPz%2Fimage.png?alt=media&#x26;token=e6d1a44d-d8ba-42f8-8f2f-8e15e77a80fb" alt=""><figcaption><p>It will not check for profit and just report. You still receive available time based rewards, though.</p></figcaption></figure>

## Reporting for tips

If you leave the `-qt`  option out of the command, Telliot will try to report only when someone tips for an already existing tag. If the tip value matches your profit settings, it will try to submit. Here you'll receive the TBRs + Tips.&#x20;

Tips can be claimed after 12h of submission. This period is to confirm the data submitted is valid.

```
telliot report -a <yourAccName>
```

## Reporting Random Feeds

To support the ecosystem and have a larger chance of getting time based rewards (by not clashing with another reporter submitting the same `QueryID` as you at the same timestamp) you may want to report to multiple random feeds.

Use the `-rf` option to report to a random feed from the list found in `~/telliot-feeds/src/telliot_feeds/feeds` directory. Open the file `__init__.py` to check and edit the queries.

{% hint style="danger" %}
Always check what you're randomly reporting before starting Telliot, to make sure you're comfortable with the queries in there and their sources!

Only report for feeds you have previously tested and checked within the community what they are considering as truth for data submitted.

<https://t.me/fetchoracle>
{% endhint %}

Look for the line containing RANDOM\_FEEDS and the feeds listed there are the ones you'll be submitting, randomly, when using `-rf`.

Comment out the ones you don't want to report to (by adding a `#` in the start of the line) or copy and paste new ones, following the same pattern of the list, from the CATALOG\_FEEDS below it. Remember to save the file when you're done.

To report, the command line will look like this:

```
telliot report -a <yourAccName> -rf
```

## Conditional Reporting

Telliot can report when some conditions are met, like a percent price change or when a price has become stale.

### Reporting when there's a % change

Enables reporting if there’s a percent change in the query tag selected.

Used with ‘conditional’ option, like this:

```
telliot conditional -a <yourAccName> -qt btc-usd-spot --percent-change 0.1
```

Above, if there’s a 10% change in price reported, it will try to report a new one:

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FWoRJu2MXsTxMW9Vtuezs%2Fimage.png?alt=media&#x26;token=d7f2bf67-fd0d-4369-8a2c-4062ffb478af" alt=""><figcaption><p>Didn't report since the price change has not met the threshold of 10%</p></figcaption></figure>

### Reporting when the price is Stale

If the feed is stale by X amount of seconds, it will trigger a report on the query tag selected. By default in the 'conditional' option it will consider a price stale after \~24h of no new reports.

Used with ‘conditional’ option, like this:

```
telliot conditional -a myacc_ts -qt btc-usd-spot -st 6400
```

<figure><img src="https://2715759442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuaWlV2rnUpdykVKTSfXx%2Fuploads%2FPVYA7HT3xABZ0MKrLzZt%2Fimage.png?alt=media&#x26;token=5af6a247-94f8-4291-8d38-3c41a98195df" alt=""><figcaption><p>The last price reported was above the threshold desired of 3600 seconds (1h), so Telliot tried to report</p></figcaption></figure>

## Build Feed Flag (advanced) <a href="#build-feed-flag" id="build-feed-flag"></a>

Use the `build-a-feed` flag (`--build-feed`) to build a DataFeed of a `QueryType` with one or more `QueryParameters`.&#x20;

When reporting, the CLI will list the `QueryTypes` this flag supports. To select a `QueryType`, enter a number from the list provided. Then, enter the corresponding `QueryParameters` for the `QueryType` you have selected.

This way you'll be submitting a manual value to Fetch Oracle. Be mindful of submitting thrustful values, otherwise you may get disputed by others!

```
telliot report -a <yourAccName> --build-feed
```
