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

# Beefy Finance (beefy)

> Multi-chain yield optimizer. Auto-compounds rewards from LP tokens and other yield sources across many chains.

Multi-chain yield optimizer. Auto-compounds rewards from LP tokens and other yield sources across many chains.

| Fact | Value |
| - | - |
| Category | Yield and vaults |
| Family | none |
| Namespace | `Beefy` on ethereum, optimism, bsc, arbitrum, avalanche |
| Chains | ethereum, optimism, bsc, arbitrum, avalanche |

## What it offers

* **deposit**: Deposit want tokens into Beefy vault
* **depositAll**: Deposit entire balance of want token
* **withdraw**: Withdraw by specifying share amount
* **withdrawAll**: Withdraw entire position

## Notes

* Each vault has a unique address per strategy
* Approve want token to vault before depositing
* Use want() to discover which token a vault accepts
* getPricePerFullShare() returns the exchange rate between shares and want tokens
* Auto-compounds rewards - no manual claiming needed

## Its names in a program

On Ethereum, `Beefy` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Ethereum's BIFI, `0xB1F1ee126e9c96231Cc3d3fAD7C08b4cf873b1f1`.
  require(Beefy.BIFI != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | BIFI | `0xB1F1ee126e9c96231Cc3d3fAD7C08b4cf873b1f1` | `Beefy.BIFI` |
| [Optimism](https://docs.eco.com/sauce-sdk/reference/chains/optimism.md) | BIFI | `0x4E720DD3Ac5CFe1e1fbDE4935f386Bb1C66F4642` | `Beefy.BIFI` |
| [BNB Chain](https://docs.eco.com/sauce-sdk/reference/chains/bsc.md) | BIFI | `0xCa3F508B8e4Dd382eE878A314789373D80A5190A` | `Beefy.BIFI` |
| [Arbitrum One](https://docs.eco.com/sauce-sdk/reference/chains/arbitrum.md) | BIFI | `0x99C409E5f62E4bd2AC142f17caFb6810B8F0BAAE` | `Beefy.BIFI` |
| [Avalanche C-Chain](https://docs.eco.com/sauce-sdk/reference/chains/avalanche.md) | BIFI | `0xd6070ae98b8069de6B494332d1A1a81B6179D960` | `Beefy.BIFI` |

## ABI

Where a line says what an address it returns is, a program that calls the function through
its namespace calls that contract's methods on the result directly:
`<Namespace>.<Contract>.<function>(...).<method>(...)`. A token's methods are the ERC-20
functions, and its writes are SafeERC20.

### `BeefyVaultABI`

`import BeefyVaultABI from "./protocols/beefy/BeefyVaultABI.json";`

* `deposit(uint256 _amount)`
* `depositAll()`
* `withdraw(uint256 _shares)`
* `withdrawAll()`
* `getPricePerFullShare() view returns (uint256)`
* `balance() view returns (uint256)`
* `balanceOf(address account) view returns (uint256)`
* `want() view returns (address)`: the address is a token

## Next steps

* [Protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.