# Strategies

Strategies take an investment from the DegenBox and manage a yield generating operation. The DegenBox owner sets a strategy per token, the owner also determines how much of the token balance is going to be in the strategy (the strategy "target percentage") and how much remains in the DegenBox to enable withdrawals.

Because the funds should be able to be sent back to the DegenBox instantly, the harvest function, which can also rebalance to bring the invested amount to the defined target percentage, can be called by anyone.

### `Constructor`[​](https://smart-docs.vercel.app/contract#constructor) <a href="#constructor" id="constructor"></a>

#### `nonpayable`[​](https://smart-docs.vercel.app/contract#constructor) <a href="#constructor" id="constructor"></a>

**Parameters**

| Name                | Type      |
| ------------------- | --------- |
| **\_strategyToken** | `address` |
| **\_bentoBox**      | `address` |

### Functions[​](https://smart-docs.vercel.app/contract#functions) <a href="#functions" id="functions"></a>

* [bentoBox](#bentobox)
* [exit](#exit)
* [exited](#exited)
* [feeCollector](#feecollector)
* [feePercent](#feepercent)
* [harvest](#harvest)
* [maxBentoBoxBalance](#maxbentoboxbalance)
* [owner](#owner)
* [pendingOwner](#pendingowner)
* [resetAllowance](#resetallowance)
* [rewardTokenEnabled](#rewardtokenenabled)
* [safeHarvest](#safeharvest)
* [setFeeParameters](#setfeeparameters)
* [setRewardTokenEnabled](#setrewardtokenenabled)
* [setStrategyExecutor](#setstrategyexecutor)
* [setSwapper](#setswapper)
* [skim](#skim)
* [strategyExecutors](#strategyexecutors)
* [strategyToken](#strategytoken)
* [swapRewards](#swaprewards)
* [swapper](#swapper)
* [tag](#tag)
* [transferOwnership](#transferownership)
* [withdraw](#withdraw)

***

#### `afterExitnonpayable`[​](https://smart-docs.vercel.app/contract#afterExit) <a href="#afterexit" id="afterexit"></a>

**Parameters**

| Name      | Type      |
| --------- | --------- |
| **to**    | `address` |
| **value** | `uint256` |
| **data**  | `bytes`   |

**Return values**

| Name        | Type   |
| ----------- | ------ |
| **success** | `bool` |

#### `bentoBoxview`[​](https://smart-docs.vercel.app/contract#bentoBox) <a href="#bentobox" id="bentobox"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `claimOwnershipnonpayable`[​](https://smart-docs.vercel.app/contract#claimOwnership) <a href="#claimownership" id="claimownership"></a>

**Parameters**

No parameters for this function.

**Return values**

No return values for this function.

#### `exitnonpayable`[​](https://smart-docs.vercel.app/contract#exit) <a href="#exit" id="exit"></a>

**Parameters**

| Name        | Type      |
| ----------- | --------- |
| **balance** | `uint256` |

**Return values**

| Name            | Type     |
| --------------- | -------- |
| **amountAdded** | `int256` |

#### `exitedview`[​](https://smart-docs.vercel.app/contract#exited) <a href="#exited" id="exited"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type   |
| ----- | ------ |
| **/** | `bool` |

#### `feeCollectorview`[​](https://smart-docs.vercel.app/contract#feeCollector) <a href="#feecollector" id="feecollector"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `feePercentview`[​](https://smart-docs.vercel.app/contract#feePercent) <a href="#feepercent" id="feepercent"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type    |
| ----- | ------- |
| **/** | `uint8` |

#### `harvestnonpayable`[​](https://smart-docs.vercel.app/contract#harvest) <a href="#harvest" id="harvest"></a>

**Parameters**

| Name        | Type      |
| ----------- | --------- |
| **balance** | `uint256` |
| **sender**  | `address` |

**Return values**

| Name  | Type     |
| ----- | -------- |
| **/** | `int256` |

#### `maxBentoBoxBalanceview`[​](https://smart-docs.vercel.app/contract#maxBentoBoxBalance) <a href="#maxbentoboxbalance" id="maxbentoboxbalance"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `uint256` |

#### `ownerview`[​](https://smart-docs.vercel.app/contract#owner) <a href="#owner" id="owner"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `pendingOwnerview`[​](https://smart-docs.vercel.app/contract#pendingOwner) <a href="#pendingowner" id="pendingowner"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `poolview`[​](https://smart-docs.vercel.app/contract#pool) <a href="#pool" id="pool"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `resetAllowancenonpayable`[​](https://smart-docs.vercel.app/contract#resetAllowance) <a href="#resetallowance" id="resetallowance"></a>

**Parameters**

No parameters for this function.

**Return values**

No return values for this function.

#### `rewardTokenEnabledview`[​](https://smart-docs.vercel.app/contract#rewardTokenEnabled) <a href="#rewardtokenenabled" id="rewardtokenenabled"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

**Return values**

| Name  | Type   |
| ----- | ------ |
| **/** | `bool` |

#### `safeHarvestnonpayable`[​](https://smart-docs.vercel.app/contract#safeHarvest) <a href="#safeharvest" id="safeharvest"></a>

**Parameters**

| Name                | Type      |
| ------------------- | --------- |
| **maxBalance**      | `uint256` |
| **rebalance**       | `bool`    |
| **maxChangeAmount** | `uint256` |
| **harvestRewards**  | `bool`    |

**Return values**

No return values for this function.

#### `setFeeParametersnonpayable`[​](https://smart-docs.vercel.app/contract#setFeeParameters) <a href="#setfeeparameters" id="setfeeparameters"></a>

**Parameters**

| Name               | Type      |
| ------------------ | --------- |
| **\_feeCollector** | `address` |
| **\_feePercent**   | `uint8`   |

**Return values**

No return values for this function.

#### `setRewardTokenEnablednonpayable`[​](https://smart-docs.vercel.app/contract#setRewardTokenEnabled) <a href="#setrewardtokenenabled" id="setrewardtokenenabled"></a>

**Parameters**

| Name        | Type      |
| ----------- | --------- |
| **token**   | `address` |
| **enabled** | `bool`    |

**Return values**

No return values for this function.

#### `setStrategyExecutornonpayable`[​](https://smart-docs.vercel.app/contract#setStrategyExecutor) <a href="#setstrategyexecutor" id="setstrategyexecutor"></a>

**Parameters**

| Name         | Type      |
| ------------ | --------- |
| **executor** | `address` |
| **value**    | `bool`    |

**Return values**

No return values for this function.

#### `setSwappernonpayable`[​](https://smart-docs.vercel.app/contract#setSwapper) <a href="#setswapper" id="setswapper"></a>

**Parameters**

| Name          | Type      |
| ------------- | --------- |
| **\_swapper** | `address` |

**Return values**

No return values for this function.

#### `skimnonpayable`[​](https://smart-docs.vercel.app/contract#skim) <a href="#skim" id="skim"></a>

**Parameters**

| Name       | Type      |
| ---------- | --------- |
| **amount** | `uint256` |

**Return values**

No return values for this function.

#### `strategyExecutorsview`[​](https://smart-docs.vercel.app/contract#strategyExecutors) <a href="#strategyexecutors" id="strategyexecutors"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

**Return values**

| Name  | Type   |
| ----- | ------ |
| **/** | `bool` |

#### `strategyTokenview`[​](https://smart-docs.vercel.app/contract#strategyToken) <a href="#strategytoken" id="strategytoken"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `swapRewardsnonpayable`[​](https://smart-docs.vercel.app/contract#swapRewards) <a href="#swaprewards" id="swaprewards"></a>

**Parameters**

| Name             | Type      |
| ---------------- | --------- |
| **amountOutMin** | `uint256` |
| **rewardToken**  | `address` |
| **data**         | `bytes`   |

**Return values**

| Name          | Type      |
| ------------- | --------- |
| **amountOut** | `uint256` |

#### `swapperview`[​](https://smart-docs.vercel.app/contract#swapper) <a href="#swapper" id="swapper"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `tagview`[​](https://smart-docs.vercel.app/contract#tag) <a href="#tag" id="tag"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `transferOwnershipnonpayable`[​](https://smart-docs.vercel.app/contract#transferOwnership) <a href="#transferownership" id="transferownership"></a>

**Parameters**

| Name         | Type      |
| ------------ | --------- |
| **newOwner** | `address` |
| **direct**   | `bool`    |
| **renounce** | `bool`    |

**Return values**

No return values for this function.

#### `withdrawnonpayable`[​](https://smart-docs.vercel.app/contract#withdraw) <a href="#withdraw" id="withdraw"></a>

**Parameters**

| Name       | Type      |
| ---------- | --------- |
| **amount** | `uint256` |

**Return values**

| Name             | Type      |
| ---------------- | --------- |
| **actualAmount** | `uint256` |

### Events (for EVM logging)[​](https://smart-docs.vercel.app/contract#events-for-evm-logging) <a href="#events-for-evm-logging" id="events-for-evm-logging"></a>

* [FeeChanged](#feechanged)
* [LogSetStrategyExecutor](#logsetstrategyexecutor)
* [OwnershipTransferred](#ownershiptransferred)
* [RewardSwapped](#rewardswapped)
* [RewardTokenUpdated](#rewardtokenupdated)
* [SwapperChanged](#swapperchanged)

***

#### `FeeChanged`[​](https://smart-docs.vercel.app/contract#FeeChanged) <a href="#feechanged" id="feechanged"></a>

**Parameters**

| Name                     | Type      | Indexed |
| ------------------------ | --------- | ------- |
| **previousFee**          | `uint256` | `false` |
| **newFee**               | `uint256` | `false` |
| **previousFeeCollector** | `address` | `false` |
| **newFeeCollector**      | `address` | `false` |

#### `LogSetStrategyExecutor`[​](https://smart-docs.vercel.app/contract#LogSetStrategyExecutor) <a href="#logsetstrategyexecutor" id="logsetstrategyexecutor"></a>

**Parameters**

| Name         | Type      | Indexed |
| ------------ | --------- | ------- |
| **executor** | `address` | `true`  |
| **allowed**  | `bool`    | `false` |

#### `OwnershipTransferred`[​](https://smart-docs.vercel.app/contract#OwnershipTransferred) <a href="#ownershiptransferred" id="ownershiptransferred"></a>

**Parameters**

| Name              | Type      | Indexed |
| ----------------- | --------- | ------- |
| **previousOwner** | `address` | `true`  |
| **newOwner**      | `address` | `true`  |

#### `RewardSwapped`[​](https://smart-docs.vercel.app/contract#RewardSwapped) <a href="#rewardswapped" id="rewardswapped"></a>

**Parameters**

| Name          | Type      | Indexed |
| ------------- | --------- | ------- |
| **token**     | `address` | `false` |
| **total**     | `uint256` | `false` |
| **amountOut** | `uint256` | `false` |
| **feeAmount** | `uint256` | `false` |

#### `RewardTokenUpdated`[​](https://smart-docs.vercel.app/contract#RewardTokenUpdated) <a href="#rewardtokenupdated" id="rewardtokenupdated"></a>

**Parameters**

| Name        | Type      | Indexed |
| ----------- | --------- | ------- |
| **token**   | `address` | `false` |
| **enabled** | `bool`    | `false` |

#### `SwapperChanged`[​](https://smart-docs.vercel.app/contract#SwapperChanged) <a href="#swapperchanged" id="swapperchanged"></a>

**Parameters**

| Name           | Type      | Indexed |
| -------------- | --------- | ------- |
| **oldSwapper** | `address` | `false` |
| **newSwapper** | `address` | `false` |


---

# 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://dev.abracadabra.money/core-contracts/strategies.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.
