🖖
Watcher API
  • Welcome
  • Use-cases
  • Quick Start
  • Reference
    • API Reference
      • Tokens
      • DeFi Strategies
      • Risk-triggers
Powered by GitBook
On this page
  • Get your API keys
  • Make your first request
  • Get strategies for a token.

Quick Start

First glance

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

Get your API keys

You can generate an API key with paid subscription in Watcher app.

For testing purposes you can use this key:

Make your first request

To make your first request, send an authenticated request to the pets endpoint. The following code requests token overview for ETH:

Get strategies for a token.

GET 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*

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

{
    "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",
                },
        ],
        "risk_factors":[
                {
                "factor_name": "f_whales",
                },
                {
                "factor_name": "f_santiment",
                },
                {
                "factor_name": "f_deposit_price",
                },
                {
                "factor_name": "f_apy",
                },
                {
                "factor_name": "f_stop_withdraw",
                },
                {
                "factor_name": "f_reward_liquiduty",
                },
                {
                "factor_name": "f_token_backing",
                },
                {
                "factor_name": "f_flashloan",
                },
                {
                "factor_name": "f_spec_addrs_change",
                },
                {
                "factor_name": "f_proxy",
                },
                {
                "factor_name": "f_oracle",
                },
                {
                "factor_name": "f_dao",
                },
                {
                "factor_name": "f_audit",
                },
        ],
        },
    ],
    "offset": 1,
    "pagination": 1,
}
{
    "status":"401",
    "message":"Permission denied",
    "result":[],
    "offset": 1,
    "page": 1,
}

Take a look at how you might call this method using our official libraries, or via curl:

curl https://api.myapi.com/v1/pet  
    -u YOUR_API_KEY:YourApiKeyToken  
    -d token_symbol='eth'  
    -d stop_criteria=['lending'],
    -d offset=1
    -d pagination=1
// Set your API key before making the request
myapi.api_key = YOUR_API_KEY

myapi.strategies.get.byToken(
    token_symbol='eth',
    stop_criteria=['lending'],
    offset=1,
    pagination=1,
)
PreviousUse-casesNextAPI Reference

Last updated 1 year ago