> For the complete documentation index, see [llms.txt](https://instadapp-3.gitbook.io/instadapp-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://instadapp-3.gitbook.io/instadapp-docs/dsa-sdk/resolvers/compound.md).

# Compound

The Compound Resolver fetchs information about Compound position. You can view details like source code, ABIs on [Etherscan](https://etherscan.io/address/0x9E6Dcb5C5A3F17F7400CD63ae6bEC0c74e65687c#code).

## Get Position

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

```
dsa.compound.getPosition(address, key);
```

| Parameter | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address   | address | The user address.                                                                                                                                                                                                                                                                                                                                                                                             |
| key       | string  | <p>(<strong>Optional</strong>) the key type to return in the response. Default will use `token`.<br>- `token` eth, dai, usdc, etc.<br>- `ctoken` ceth, cdai, cusdc, etc.<br>- `address` "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "0x6B175474E89094C44Da98b954EedeAC495271d0F", etc.<br>- `caddress` "0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5", "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643", etc.</p> |

**Returns:** `Object` with all the Compound details.Copy

```
{
"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 Parameter    | Type   | Description                                                           |
| ------------------- | ------ | --------------------------------------------------------------------- |
| priceInEth          | number | Token price w\.r.t Ethereum price.                                    |
| exchangeRate        | number | Exchange rate of cToken.                                              |
| supply              | number | Supply balance of token.                                              |
| borrow              | number | Borrow balance of token.                                              |
| supplyRate          | number | Supply APR of token.                                                  |
| supplyYield         | number | Supply APY of token.                                                  |
| borrowRate          | number | Borrow APR of token.                                                  |
| borrowYield         | number | Borrow APY of token.                                                  |
| totalSupplyInEth    | number | Total supply w\.r.t Ethereum.                                         |
| totalBorrowInEth    | number | Total borrow w\.r.t Ethereum.                                         |
| maxBorrowLimitInEth | number | Max borrow limit w\.r.t Ethereum.                                     |
| status              | number | <p>Current status.<br>Mulitply by 100 to convert into %.</p>          |
| liquidation         | number | <p>Position breakage limit.<br>Mulitply by 100 to convert into %.</p> |
