> ## Documentation Index
> Fetch the complete documentation index at: https://yieldxyz.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Compound

> USDC lending for various markets via Compound V3

## What this yield is

* **Protocol**: Compound V3 lending markets
* **Asset**: USDC, WETH, USDT, wstETH, USDS (varies by network)
* **Receipt token**: cTokens (e.g., cUSDC, cWETH)
* **Rewards**: Interest from borrowers + COMP token rewards (if active)
* **Networks**: Ethereum, Polygon, Arbitrum, Optimism, Base

<Note>
  Upon lending into Compound, users receive cTokens which accrue interest over time. These tokens are redeemable for the underlying token at any point.
</Note>

## Required inputs

| Parameter | Description                                                            |
| --------- | ---------------------------------------------------------------------- |
| `yieldId` | The specific Compound V3 yield (e.g., `base-usdc-compound-v3-lending`) |
| `address` | User's wallet address                                                  |
| `amount`  | Amount to deposit                                                      |

## Actions & lifecycle

<Tabs>
  <Tab title="Enter">
    **Action**: Deposit assets into the Compound V3 market

    * Supply the asset (USDC, WETH, etc.)
    * Receive cToken representing your position
    * Begin earning interest immediately
  </Tab>

  <Tab title="Exit">
    **Action**: Withdraw assets from the market

    * Redeem cTokens for underlying assets
    * Receive principal plus accrued interest
    * Instant withdrawal (subject to liquidity)
  </Tab>

  <Tab title="Pending actions">
    **CLAIM\_REWARDS**: Claim accrued COMP rewards

    Users can withdraw COMP reward tokens using the `CLAIM_REWARDS` pending action on the `rewards` balance. The rewards are not automatically claimed when withdrawing from the position.
  </Tab>
</Tabs>

## Example flow

<Steps>
  <Step title="Get yield metadata">
    Fetch available Compound V3 yields and their current rates.
  </Step>

  <Step title="Enter position">
    Call the enter action with your deposit amount.
  </Step>

  <Step title="Sign & submit">
    Sign the transaction and broadcast to the network.
  </Step>

  <Step title="Track balances">
    Monitor your position via the balances endpoint.
  </Step>
</Steps>

<CodeGroup>
  ```bash Get yield metadata theme={null}
  curl --request GET \
    --url https://api.yield.xyz/v1/yields/base-usdc-compound-v3-lending \
    --header 'accept: application/json' \
    --header 'x-api-key: <API_KEY>'
  ```

  ```bash Enter position theme={null}
  curl --request POST \
    --url https://api.yield.xyz/v1/actions/enter \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --header 'x-api-key: <API_KEY>' \
    --data '{
      "yieldId": "base-usdc-compound-v3-lending",
      "address": "0xYOUR_ADDRESS",
      "arguments": {
        "amount": "1000"
      }
    }'
  ```

  ```bash Claim rewards theme={null}
  curl --request POST \
    --url https://api.yield.xyz/v1/actions/manage \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --header 'x-api-key: <API_KEY>' \
    --data '{
      "yieldId": "base-usdc-compound-v3-lending",
      "address": "0xYOUR_ADDRESS",
      "pendingAction": {
        "type": "CLAIM_REWARDS"
      }
    }'
  ```
</CodeGroup>

## Operational notes

<AccordionGroup>
  <Accordion title="COMP rewards">
    If reward mining is active in a given market, users will earn COMP tokens in addition to lending interest. These must be claimed separately using the `CLAIM_REWARDS` pending action.
  </Accordion>

  <Accordion title="Instant withdrawals">
    cTokens are redeemable for the underlying token at any point in time, subject to available liquidity in the market.
  </Accordion>

  <Accordion title="Multi-network support">
    Compound V3 is available on Ethereum, Polygon, Arbitrum, Optimism, and Base with varying asset support.
  </Accordion>
</AccordionGroup>

## Yield IDs for this protocol

<AccordionGroup>
  <Accordion title="Show Compound V3 yield IDs">
    **Yield ID pattern**: `{network}-{asset}-compound-v3-lending`

    ### Arbitrum

    | Yield ID                            | Name                       |
    | ----------------------------------- | -------------------------- |
    | arbitrum-usdc-compound-v3-lending   | USDC Compound v3 Lending   |
    | arbitrum-usdc.e-compound-v3-lending | USDC.e Compound v3 Lending |
    | arbitrum-weth-compound-v3-lending   | WETH Compound v3 Lending   |
    | arbitrum-usdt-compound-v3-lending   | USDT Compound v3 Lending   |

    ### Base

    | Yield ID                       | Name                      |
    | ------------------------------ | ------------------------- |
    | base-usdc-compound-v3-lending  | USDC Compound v3 Lending  |
    | base-usdbc-compound-v3-lending | USDbC Compound v3 Lending |
    | base-weth-compound-v3-lending  | WETH Compound v3 Lending  |
    | base-aero-compound-v3-lending  | AERO Compound v3 Lending  |

    ### Ethereum

    | Yield ID                            | Name                       |
    | ----------------------------------- | -------------------------- |
    | ethereum-weth-compound-v3-lending   | WETH Compound v3 Lending   |
    | ethereum-usdc-compound-v3-lending   | USDC Compound v3 Lending   |
    | ethereum-usdt-compound-v3-lending   | USDT Compound v3 Lending   |
    | ethereum-wsteth-compound-v3-lending | wstETH Compound v3 Lending |
    | ethereum-usds-compound-v3-lending   | USDS Compound v3 Lending   |

    ### Optimism

    | Yield ID                          | Name                     |
    | --------------------------------- | ------------------------ |
    | optimism-usdc-compound-v3-lending | USDC Compound v3 Lending |
    | optimism-usdt-compound-v3-lending | USDT Compound v3 Lending |
    | optimism-weth-compound-v3-lending | WETH Compound v3 Lending |

    ### Polygon

    | Yield ID                           | Name                       |
    | ---------------------------------- | -------------------------- |
    | polygon-usdc.e-compound-v3-lending | USDC.e Compound v3 Lending |
    | polygon-usdt-compound-v3-lending   | USDT Compound v3 Lending   |
  </Accordion>
</AccordionGroup>

## See also

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/documentation/getting-started/quickstart">
    Get started with Yield.xyz
  </Card>

  <Card title="Actions & Balances" icon="arrow-right-arrow-left" href="/documentation/core-concepts/actions-and-transactions">
    Understand how actions work
  </Card>
</CardGroup>
