Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cETH underlyingPrice is 0 must be always 1 #9

Open
achiko opened this issue Jun 14, 2020 · 0 comments
Open

cETH underlyingPrice is 0 must be always 1 #9

achiko opened this issue Jun 14, 2020 · 0 comments

Comments

@achiko
Copy link

achiko commented Jun 14, 2020

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant