# AuraSpell

The `AuraSpell` contract is a contract that defines how the Blueberry Protocol interacts with Aura pools. It enables users to open and close positions and interact with the Blueberry Money Market, Balancer pools, and Aura pools.&#x20;

### Contract Dependencies

#### OpenZeppelin Contracts

The contract imports `SafeERC20Upgradeable` from the OpenZeppelin Contracts Upgradeable library, which is an open-source library that provides secure and tested implementations of popular token standards and other useful utilities.

#### BasicSpell

The contract imports `BasicSpell`, which is a custom implementation that serves as the base contract for the `AuraSpell`.

#### Interfaces

The contract imports interfaces for interacting with several external contracts, including Curve Oracle, Wrapped Aura Pools, Balancer Pool, and Uniswap V2 Router02.

### State Variables

The contract has several state variables for storing contract addresses and external contract instances.

* `IWAuraPools public wAuraPools`: The address of the Wrapped Aura Pools contract.
* `ICurveOracle public crvOracle`: The address of the Curve Oracle contract.
* `address public AURA`: The address of the AURA token.

### Functions

#### initialize

{% code overflow="wrap" %}

```solidity
function initialize(IBank bank_, address werc20_, address weth_, address wAuraPools_) external initializer
```

{% endcode %}

The `initialize` function initializes the contract and sets the initial state variables.

#### addStrategy

{% code overflow="wrap" %}

```solidity
function addStrategy(address bpt, uint256 maxPosSize) external onlyOwner
```

{% endcode %}

This function adds a strategy to the contract.

#### openPositionFarm

{% code overflow="wrap" %}

```solidity
function openPositionFarm(OpenPosParam calldata param) external exisitingStrategy(param.StrategyId) existingCollateral(param.strategyId, param.collToken)
```

{% endcode %}

This function adds liquidity to the Balancer pool and stakes it in the Aura pool.

#### closePositionFarm

{% code overflow="wrap" %}

```solidity
function closePositionFarm(
    ClosePosParam calldata param,
    IUniswapV2Router02 swapRouter,
    address[][] calldata swapPath
)
    external
    existingStrategy(param.strategyId)
    existingCollateral(param.strategyId, param.collToken);

```

{% endcode %}

This function closes a position in the farm, removing liquidity from the Balancer pool and unstaking from the Aura pool.

```
```


---

# 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://v1.docs.blueberry.garden/developer-guides/contracts/spell/auraspell.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.
