# DeFi Strategies

## Get strategies for the token

## Get strategies for a token.

<mark style="color:blue;">`GET`</mark> `https://api.web3watcher.fi/v1/strategies/bytoken/{token_symbol}`

The method returns the list of strategies for your token.

#### Request Body

| Name                                            | Type      | Description                                      |
| ----------------------------------------------- | --------- | ------------------------------------------------ |
| token\_symbol<mark style="color:red;">\*</mark> | string    | The symbol (name) of the token                   |
| offset                                          | int       | the number of strategies displayed per page      |
| pagination                                      | int       | num of page                                      |
| token\_amount                                   | int       | the amount of token to invest                    |
| period                                          | int       | period of investment in days                     |
| stop\_criteria                                  | \[string] | Criteria to not include some strategy categories |

{% tabs %}
{% tab title="200 Success" %}

```json
{
    "status":"200",
    "message":"Success",
    "result":[
        {
        "strategy_name":"lido_curve",
        "strategy_id":"389201",
        "strategy_category":"liqSt_dex",
        "defi_in":[
                {
                "defi_name":"lido",
                "defi_contract":"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
                },
                {
                "defi_name":"curve",
                "defi_contract":"0xD533a949740bb3306d119CC777fa900bA034cd52",
                },
        ],
        "current_apy": 0.04,
        "breackdown_apy":[
                {
                "token_symbol": "stETH",
                "current_apy": 0.038,
                },
                {
                "token_symbol": "crv",
                "current_apy": 0.02,
                },
        ],
        "current_risk_rating": "AB",
        "current_available_liquidity_token": 30000,
        "tokens_in": [
                {
                "token_symbol": "eth",
                },
        ],
        "tokens_out": [
                {
                "token_symbol": "stEth",
                },
                {
                "token_symbol": "crv",
                },
        ],
        },
    ],
    "offset": 1,
    "pagination": 1,
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```json
{
    "status":"401",
    "message":"Permission denied",
    "result":[],
    "offset": 1,
    "page": 1,
}
```

{% endtab %}
{% endtabs %}

## Get health status by strategy id

## Get health status for deFi(s) inside of the strategy.

<mark style="color:blue;">`GET`</mark> `https://api.web3watcher.fi/v1/strategies/health/{strategy_id}/`

The method returns the current health state of the strategy though deFi risk metrics.

#### Request Body

| Name                                           | Type      | Description                                              |
| ---------------------------------------------- | --------- | -------------------------------------------------------- |
| strategy\_id<mark style="color:red;">\*</mark> | string    | The id of the strategy                                   |
| offset                                         | int       | the number of risk factors per page                      |
| pagination                                     | int       | num of page                                              |
| track\_deFi                                    | \[string] | the list of deFi to receive risk factors by each of them |

{% tabs %}
{% tab title="200 Success" %}

```json
{
    "status":"200",
    "message":"Success",
    "result": {
        "strategy_name":"lido_curve",
        "strategy_id":"389201",
        "strategy_category":"liqSt_dex",
        "current_apy": 0.04,
        "breackdown_apy":[
                {
                "token_symbol": "stETH",
                "current_apy": 0.038,
                },
                {
                "token_symbol": "crv",
                "current_apy": 0.02,
                },
        ],
        "current_risk_rating": "AB",
        "current_available_liquidity_token": 30000,
        "tokens_in": [
                {
                "token_symbol": "eth",
                },
        ],
        "tokens_out": [
                {
                "token_symbol": "stEth",
                },
                {
                "token_symbol": "crv",
                },
        ],
        "risk_factors":[
                {
                "deFi_name": "curve",
                "factor_name": "f_whales",
                "factor_score": 90,
                "factor_score_change": -2,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_santiment",
                "factor_score": 90,
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_deposit_price",
                "factor_score": "87",
                "factor_score_change": +1,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_apy",
                "factor_score": "90",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_stop_withdraw",
                "factor_score": "92",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_reward_liquiduty",
                "factor_score": "83",
                "factor_score_change": -4,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_token_backing",
                "factor_score": "81",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_flashloan",
                "factor_score": "75",
                "factor_score_change": -15,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_spec_addrs_change",
                "factor_score": "95",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_proxy",
                "factor_score": "95",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_oracle",
                "factor_score": "89",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_dao",
                "factor_score": "75",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_audit",
                "factor_score": "95",
                "factor_score_change": 0,
                },
        },
    "offset": 99,
    "pagination": 1,
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```json
{
    "status":"401",
    "message":"Permission denied",
    "result":[],
    "offset": 99,
    "page": 1,
}
```

{% endtab %}
{% endtabs %}

## Get health status by strategy name

## Get health status for deFi(s) inside of the strategy.

<mark style="color:blue;">`GET`</mark> `https://api.web3watcher.fi/v1/strategies/health/{strategy_name}`

The method returns the current health state of the strategy though deFi risk metrics.

#### Request Body

| Name                                             | Type      | Description                                              |
| ------------------------------------------------ | --------- | -------------------------------------------------------- |
| strategy\_name<mark style="color:red;">\*</mark> | string    | The name of the strategy                                 |
| offset                                           | int       | the number of risk factors per page                      |
| pagination                                       | int       | num of page                                              |
| track\_deFi                                      | \[string] | the list of deFi to receive risk factors by each of them |

{% tabs %}
{% tab title="200 Success" %}

```json
{
    "status":"200",
    "message":"Success",
    "result": {
        "strategy_name":"lido_curve",
        "strategy_id":"389201",
        "strategy_category":"liqSt_dex",
        "current_apy": 0.04,
        "breackdown_apy":[
                {
                "token_symbol": "stETH",
                "current_apy": 0.038,
                },
                {
                "token_symbol": "crv",
                "current_apy": 0.02,
                },
        ],
        "current_risk_rating": "AB",
        "current_available_liquidity_token": 30000,
        "tokens_in": [
                {
                "token_symbol": "eth",
                },
        ],
        "tokens_out": [
                {
                "token_symbol": "stEth",
                },
                {
                "token_symbol": "crv",
                },
        ],
        "risk_factors":[
                {
                "deFi_name": "curve",
                "factor_name": "f_whales",
                "factor_score": 90,
                "factor_score_change": -2,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_santiment",
                "factor_score": 90,
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_deposit_price",
                "factor_score": "87",
                "factor_score_change": +1,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_apy",
                "factor_score": "90",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_stop_withdraw",
                "factor_score": "92",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_reward_liquiduty",
                "factor_score": "83",
                "factor_score_change": -4,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_token_backing",
                "factor_score": "81",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_flashloan",
                "factor_score": "75",
                "factor_score_change": -15,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_spec_addrs_change",
                "factor_score": "95",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_proxy",
                "factor_score": "95",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_oracle",
                "factor_score": "89",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_dao",
                "factor_score": "75",
                "factor_score_change": 0,
                },
                {
                "deFi_name": "curve",
                "factor_name": "f_audit",
                "factor_score": "95",
                "factor_score_change": 0,
                },
        },
    "offset": 99,
    "pagination": 1,
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```json
{
    "status":"401",
    "message":"Permission denied",
    "result":[],
    "offset": 99,
    "page": 1,
}
```

{% endtab %}
{% endtabs %}


---

# 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://p2p-2.gitbook.io/watcher-api/reference/api-reference/defi-strategies.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.
