> For the complete documentation index, see [llms.txt](https://devs.maxapy.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devs.maxapy.io/maxapy-erc4626/strategies/ethereum-usdc/sommelier/sommelierturboghostrategy.md).

# SommelierTurboGHOStrategy

## Overview

The SommelierTurboGHOStrategy contract is a strategy that supplies tokens into a Sommelier Vault to earn yield, with specific handling for GHO token conversions through Uniswap V3.

## Constants

```solidity
address constant gho = GHO_MAINNET;                                            // GHO token address
IUniswapV3Router constant router = IUniswapV3Router(UNISWAP_V3_ROUTER_MAINNET);  // Uniswap V3 router
```

## Functions

### Initialization Functions

#### initialize

```solidity
function initialize(
    IMaxApyVault _vault,
    address[] calldata _keepers,
    bytes32 _strategyName,
    address _strategist,
    ICellar _cellar
) public override initializer
```

Initializes the strategy with required components.

Parameters:

* `_vault`: MaxApy vault address
* `_keepers`: Array of keeper addresses
* `_strategyName`: Name of the strategy
* `_strategist`: Strategist address
* `_cellar`: Sommelier cellar address

### Core Functions

#### liquidateExact

```solidity
function liquidateExact(uint256 amountNeeded) external virtual override checkRoles(VAULT_ROLE) returns (uint256 loss)
```

Withdraws exactly amountNeeded to vault.

Parameters:

* `amountNeeded`: Amount to withdraw

Returns:

* `loss`: Amount of realized loss

### Internal Core Functions

#### \_divest

```solidity
function _divest(uint256 shares) internal override returns (uint256 withdrawn)
```

Withdraws assets from Cellar Vault.

Parameters:

* `shares`: Amount of shares to withdraw

Returns:

* `withdrawn`: Amount of assets received

#### \_swapGho

```solidity
function _swapGho(uint256 amountIn) internal returns (uint256)
```

Swaps GHO tokens to underlying using Uniswap V3.

Parameters:

* `amountIn`: Amount of GHO to swap

Returns:

* Amount received after swap

### Internal View Functions

#### \_ghoBalance

```solidity
function _ghoBalance() internal view returns (uint256)
```

Returns the contract's GHO balance.

Returns:

* Current GHO balance


---

# 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://devs.maxapy.io/maxapy-erc4626/strategies/ethereum-usdc/sommelier/sommelierturboghostrategy.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.
