> For the complete documentation index, see [llms.txt](https://docs-v4.venus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-v4.venus.io/technical-reference/reference-isolated-pools/risk-fund-and-shortfall/risk-fund-v2.md).

# RiskFund

## RiskFundV2

Contract with basic features to track/hold different assets for different Comptrollers.

## Solidity API

#### sweepToken

Function to sweep baseAsset for pool; Tokens are sent to address(to)

```solidity
function sweepToken(address tokenAddress, address to, uint256 amount) external
```

**Parameters**

| Name         | Type    | Description                                 |
| ------------ | ------- | ------------------------------------------- |
| tokenAddress | address | Address of the asset(token)                 |
| to           | address | Address to which assets will be transferred |
| amount       | uint256 | Amount need to sweep for the pool           |

**📅 Events**

* Emits SweepToken event on success

**⛔️ Access Requirements**

* Only Governance

**❌ Errors**

* ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero
* ZeroValueNotAllowed is thrown when amount is zero

***

#### sweepTokenFromPool

Function to sweep token from pool

```solidity
function sweepTokenFromPool(address tokenAddress, address comptroller, uint256 amount) external
```

**Parameters**

| Name         | Type    | Description                                      |
| ------------ | ------- | ------------------------------------------------ |
| tokenAddress | address | Address of the asset(token)                      |
| comptroller  | address | Pool address to which assets will be transferred |
| amount       | uint256 | Amount need to sweep from the pool               |

**📅 Events**

* Emits sweepTokenFromPool event on success

**⛔️ Access Requirements**

* Only Governance

**❌ Errors**

* ZeroAddressNotAllowed is thrown when tokenAddress/comptroller address is zero
* ZeroValueNotAllowed is thrown when amount is zero

***

#### getPoolsBaseAssetReserves

Get the Amount of the Base asset in the risk fund for the specific pool.

```solidity
function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256)
```

**Parameters**

| Name        | Type    | Description                |
| ----------- | ------- | -------------------------- |
| comptroller | address | Comptroller address(pool). |

**Return Values**

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \[0] | uint256 | Base Asset's reserve in risk fund. |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-v4.venus.io/technical-reference/reference-isolated-pools/risk-fund-and-shortfall/risk-fund-v2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
