ProtocolPosition

ProtocolPositions is a record of key / Protocol.The protocol's key is indicated by its type (e.g., WALLET, LENDING, STAKING). There are two categories of protocols: "REGULAR" and "COMPLEX."

More detail Protocol types supported by Octav Regular protocols assets are under assets[], while complex ones include additional structures and are nested on a sub protocolPositions object.

"protocolPositions": { 
        "REWARDS": { // Ex of a REGULAR protocol
          "assets": [
            {
              "balance": "0.027360076152603174",
              "chainContract": "arbitrum:0x3d9907f9a368ad0a51be60f7da3b97cf940982d8",
              "chainKey": "arbitrum",
              "contract": "0x3d9907f9a368ad0a51be60f7da3b97cf940982d8",
              "decimal": "18",
              "name": "camelot token",
              "openPnl": "0",
              "price": "857.5030282598688",
              "symbol": "grail",
              "totalCostBasis": "0",
              "value": "23.4613481542778419450964757035712"
            }
          ],
          "name": "Rewards",
          "protocolPositions": [],
          "totalOpenPnl": "23.4613481542778419450964757035712",
          "totalCostBasis": "0",
          "totalValue": "23.4613481542778419450964757035712",
          "unlockAt": "0"
        },
        "LENDING": { // Ex of a COMPLEX protocol
          "assets": [],
          "name": "Lending",
          "protocolPositions": [
                {
                "assets": [],
                "borrowAssets": [
                    {
                        "balance": "45977.83354",
                        "chainContract": "ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                        "chainKey": "ethereum",
                        "contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                        "decimal": "6",
                        "name": "usd coin",
                        "openPnl": "0",
                        "price": "1.001201441730076",
                        "symbol": "usdc",
                        "totalCostBasis": "0",
                        "value": "46033.07322787344393954904"
                    }
                ],
                "dexAssets": [],
                "healthRate": "1.9318371766478242",
                "name": "steth",
                "rewardAssets": [],
                "supplyAssets": [
                    {
                        "balance": "33.284399154760166",
                        "chainContract": "ethereum:0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
                        "chainKey": "ethereum",
                        "contract": "0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
                        "decimal": "18",
                        "name": "lido staked ether",
                        "openPnl": "111050.9810191413682901442995501924",
                        "price": "3336.4273905860614",
                        "symbol": "steth",
                        "totalCostBasis": "0",
                        "value": "111050.9810191413682901442995501924"
                    }
                ],
                "totalCostBasis": "0",
                "totalClosedPnl": "0",
                "totalOpenPnl": "65017.9077912679243505952595501924",
                "unlockAt": "0",
                "vaultAddress": "",
                "poolAddress": "0x4e033931ad43597d96d6bcc25c280717730b58b1",
                "value": "65017.9077912679243505952595501924"
            }
            ],
            "totalOpenPnl": "0",
            "totalCostBasis": "0",
            "totalValue": "65017.9077912679243505952595501924",
            "unlockAt": "0"
        }

}

Nested protocol positions are managing diverse asset types (borrow, supplied, rewards, etc.) and complex positions (e.g., lending) in a single structure.

Typing

Key
Type
Description

name

string

Name of the protocol.

totalOpenPnl

string

Total open profit and loss in the protocol.

totalCostBasis

string

Total cost basis of assets in the protocol.

totalValue

string

Total value of all protocol assets.

unlockAt

string (timestamp)

Unlock time for protocol assets, if applicable.

imgSmall

string

Url of the protocol image (small) includeImages param must be set to true

imgLarge

string

Url of the protocol image (large) includeImages param must be set to true

explorerUrl

string

Explorer link includeExplorerUrls param must be set to true

assets

Asset[]

Array of assets held in the protocol (if applicable) See #protocol-positions-details

supplyAssets

Array of supplied assets (if applicable) See #protocol-positions-details

borrowAssets

Array of borrowed assets (if applicable) See #protocol-positions-details

rewardAssets

Array of reward assets (if applicable) See #protocol-positions-details

dexAssets

Array of dex assets (if applicable) See #protocol-positions-details

protocolPositions

Sub array of protocol positions in case of protocol is considered as 'COMPLEX" . See #protocol-positions-details


Last updated