# Farm Facet

{% hint style="warning" %}
Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.
{% endhint %}

The Farm Facet allows Farmers to perform multiple Beanstalk functions calls in a single transaction using `farm` calls.

## Call Functions

### [Farm](https://github.com/BeanstalkFarms/Beanstalk/blob/fd132ae4eda02e502441c3d28d04ad2c21b4e339/protocol/contracts/farm/facets/FarmFacet.sol#L35)

```solidity
function farm(bytes[] calldata data)
    external
    payable
    withEth
    returns (bytes[] memory results);
```

Loops through the list of encoded selectors in `data` and performs a `delegateCall` on each of them.

| Parameter | Type      | Description                                      |
| --------- | --------- | ------------------------------------------------ |
| `data`    | `bytes[]` | The encoded function data for each of the calls. |

| Return Value | Type      | Description                             |
| ------------ | --------- | --------------------------------------- |
| `results`    | `bytes[]` | The return data from each of the calls. |

### [Advanced Farm](https://github.com/BeanstalkFarms/Beanstalk/blob/fd132ae4eda02e502441c3d28d04ad2c21b4e339/protocol/contracts/farm/facets/FarmFacet.sol#L53)

```solidity
function advancedFarm(AdvancedFarmCall[] calldata data)
    external
    payable
    withEth
    returns (bytes[] memory results);
```

Execute multiple AdvancedFarmCalls.

| Parameter | Type                 | Description                                                               |
| --------- | -------------------- | ------------------------------------------------------------------------- |
| `data`    | `AdvancedFarmCall[]` | The encoded function data for each of the calls to make to this contract. |

| Return Value | Type      | Description                                              |
| ------------ | --------- | -------------------------------------------------------- |
| `results`    | `bytes[]` | The results from each of the calls passed in via `data`. |

## View Functions

None.

## Events

None.


---

# Agent Instructions: 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:

```
GET https://docs.bean.money/developers/protocol/depot/farm-facet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
