Skip to content

cETH underlyingPrice is 0 must be always 1 #9

@achiko

Description

@achiko

Get Markets data

curl --request POST \
  --url https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2 \
  --header 'content-type: application/json' \
  --data '{"query":"{\n  \n  markets {\n    name,\n    underlyingSymbol,\n    underlyingPrice    \n  }\n  \n}\n\n\n"}'

 {
        "name": "Compound Ether",
        "underlyingSymbol": "ETH",
        "underlyingPrice": "0"
   }

cEth "underlyingPrice": "0" 1 ETH is always = 1 ETH and main calculation unit is Ether in compound.

underlyingPrice participates in function totalCollateralValueInEth in compound-subgraph-wrapper https://github.com/graphprotocol/compound-subgraph-wrapper/blob/master/src/index.ts#L136

tokenInEth = collateralFactor * exchangeRate * underlyingPrice;  // always returns 0 when collateral is cEth. 
totalCollateralValueInEth = tokenInEth * cTokenBalance;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions