Get Compound Positions

Compound Resolver fetch Position of user. You can view details like source code, ABIs on Etherscan.

Get Position

Fetch compound position of a user with just a single call.

dsa.compound.getPosition(address, key);
addressaddressThe user address.
keystring(Optional) the key type to return in the response. Default will use `token`.
- `token` eth, dai, usdc, etc.
- `ctoken` ceth, cdai, cusdc, etc.
- `address` "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "0x6B175474E89094C44Da98b954EedeAC495271d0F", etc.
- `caddress` "0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5", "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643", etc.

Returns: Object with all the Compound details.

"eth": {
  "priceInEth": 1,
  "exchangeRate": 200118987.03198305,
  "supply": 0.020001941382760555,
  "borrow": 0,
  "supplyRate": 0.01053365240736,
  "supplyYield": 0.010534205695367227,
  "borrowRate": 2.05689983754528,
  "borrowYield": 2.078140652407834,
"dai": {},
"usdc": {},
"totalSupplyInEth": 0.043728986801881906,
"totalBorrowInEth": 0.0023955855814168704,
"maxBorrowLimitInEth": 0.032796740101411426,
"status": 0.05478255401320606,
"liquidation": 0.7499999999999999
Return ParameterTypeDescription
priceInEthnumberToken price w.r.t Ethereum price.
exchangeRatenumberExchange rate of cToken.
supplynumberSupply balance of token.
borrownumberBorrow balance of token.
supplyRatenumberSupply APR of token.
supplyYieldnumberSupply APY of token.
borrowRatenumberBorrow APR of token.
borrowYieldnumberBorrow APY of token.
totalSupplyInEthnumberTotal supply w.r.t Ethereum.
totalBorrowInEthnumberTotal borrow w.r.t Ethereum.
maxBorrowLimitInEthnumberMax borrow limit w.r.t Ethereum.
statusnumberCurrent status.
Mulitply by 100 to convert into %.
liquidationnumberPosition breakage limit.
Mulitply by 100 to convert into %.

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.

Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.

Best way to stay connected with our progress.