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

# Collect fees

> Collect an Aave vault's accrued performance fees to its admin wallet.

Collect an Aave vault's accrued performance fees with the [collect fees](/api-reference/wallets/earn/fees-collect) endpoint. Fees accrue in the vault contract; this action moves the available fees from the vault to the vault's admin wallet. Fee collection is only supported for Aave vaults.

<Info>
  View the full [API reference](/api-reference/wallets/earn/fees-collect) for the collect fees
  endpoint.
</Info>

<Tip>
  If your app has gas sponsorship configured, usage of the `/earn/ethereum/fees/collect` endpoint
  will be [gas-sponsored by default](/wallets/actions/overview#gas-management). There is no need to
  specify additional parameters for sponsorship.
</Tip>

## Usage

<Tabs>
  <Tab title="REST API">
    Make a `POST` request to:

    ```bash theme={"system"}
    https://api.privy.io/api/v1/wallets/{wallet_id}/earn/ethereum/fees/collect
    ```

    The `wallet_id` in the path must be the vault's **admin wallet** — find it in the Privy Dashboard or as `admin_wallet_id` in the [get vault details](/wallets/actions/earn/get-vault-details) response. A single call collects all available fees for the vault; partial collection is not supported.

    ### Parameters

    <ParamField path="vault_id" type="string" required>
      The ID of the vault to collect fees from. Must be an Aave vault.
    </ParamField>

    <Info>
      This endpoint accepts your app secret or a wallet signer. If the admin wallet was created
      automatically when the vault was deployed and has not been modified, your app secret alone
      authorizes the request. Admin wallets with an `owner_id` must provide an [authorization
      signature](/api-reference/authorization-signatures) as a request header.
    </Info>

    ### Returns

    <ResponseField name="id" type="string">
      The wallet action ID. Use this to poll status with [get wallet action](/api-reference/wallets/actions/get).
    </ResponseField>

    <ResponseField name="wallet_id" type="string">
      The ID of the admin wallet collecting the fees.
    </ResponseField>

    <ResponseField name="type" type="string">
      The action type. Always `"earn_fee_collect"` for this endpoint.
    </ResponseField>

    <ResponseField name="status" type="'pending' | 'succeeded' | 'rejected' | 'failed'">
      The current status of the fee collection action.
    </ResponseField>

    <ResponseField name="caip2" type="string">
      Chain identifier in CAIP-2 format.
    </ResponseField>

    <ResponseField name="vault_id" type="string">
      The ID of the vault fees were collected from.
    </ResponseField>

    <ResponseField name="vault_address" type="string">
      The onchain address of the vault contract.
    </ResponseField>

    <ResponseField name="asset_address" type="string">
      The underlying asset's token address.
    </ResponseField>

    <ResponseField name="amount" type="string | null">
      The collected amount in the underlying asset, as a human-readable decimal. `null` while the action is pending; populated after onchain confirmation. This is your app's share after the revenue split.
    </ResponseField>

    <ResponseField name="raw_amount" type="string | null">
      The collected amount in the smallest unit of the underlying asset. Populated after onchain confirmation.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of when the action was created.
    </ResponseField>

    ### Example

    ```bash theme={"system"}
    curl -X POST https://api.privy.io/api/v1/wallets/{wallet_id}/earn/ethereum/fees/collect \
      -H "privy-app-id: <your-app-id>" \
      -H "Authorization: Basic <credentials>" \
      -H "Content-Type: application/json" \
      -d '{
        "vault_id": "<your-aave-vault-id>"
      }'
    ```

    ```json Example response theme={"system"}
    {
      "id": "<action-id>",
      "wallet_id": "<admin-wallet-id>",
      "type": "earn_fee_collect",
      "status": "pending",
      "caip2": "eip155:8453",
      "vault_id": "<your-aave-vault-id>",
      "vault_address": "0x1234567890123456789012345678901234567890",
      "asset_address": "0x1234567890abcdef1234567890abcdef12345678",
      "amount": null,
      "raw_amount": null,
      "created_at": "2025-04-01T12:00:00.000Z"
    }
    ```
  </Tab>
</Tabs>

<Tip>
  Track the collection by polling [get wallet action](/api-reference/wallets/actions/get) or
  listening for the
  [`wallet_action.earn_fee_collect.succeeded`](/api-reference/webhooks/wallet-action/earn-fee-collect/succeeded)
  webhook.
</Tip>

## Next steps

<Card title="Aave integration guide" icon="landmark" href="/wallets/actions/earn/providers/aave" arrow>
  Deposit, withdraw, read positions, and collect fees for Aave vaults.
</Card>
