> For the complete documentation index, see [llms.txt](https://docs.divergence-protocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.divergence-protocol.com/technical-reference/periphery/params.md).

# Params

## CreateAndInitBattleParams

The parameters for creating and initializing a battle

```javascript
struct CreateAndInitBattleParams {
    BattleKey bk;
    uint160 sqrtPriceX96;
}
```

**Params:**

| **Name**     | **Type**  | **Description**                                   |
| ------------ | --------- | ------------------------------------------------- |
| bk           | BattleKey | The battle key containing a pool's specifications |
| sqrtPriceX96 | uint160   | The starting sqrtPrice of the pool                |

## AddLiquidityParams

The parameters for adding liquidity to a battle

```javascript
struct AddLiqParams {
    BattleKey battleKey;
    address recipient;
    int24 tickLower;
    int24 tickUpper;
    LiquidityType liquidityType;
    uint128 amount;
    uint256 deadline;
}
```

**Params:**

| **Name**      | **Type**      | **Description**                                                                        |
| ------------- | ------------- | -------------------------------------------------------------------------------------- |
| battleKey     | BattleKey     | The battle key                                                                         |
| recipient     | address       | The address that receives the NFT                                                      |
| tickLower     | int24         | The lower tick of the position                                                         |
| tickUpper     | int24         | The upper tick of the position                                                         |
| liquidityType | LiquidityType | Specifies the type of liquidity seeded to the position is collateral, Spear, or Shield |
| amount        | uint128       | The amount of collateral, Spear or Shield to add                                       |
| deadline      | uint256       | The deadline of the transaction                                                        |

## TradeParams

Represents the parameters for a trade

```javascript
struct TradeParams {
    BattleKey battleKey;
    TradeType tradeType;
    uint256 amountSpecified;
    address recipient;
    uint256 amountOutMin;
    uint160 sqrtPriceLimitX96;
    uint256 deadline;
}
```

**Params:**

| **Name**          | **Type**  | **Description**                                                                  |
| ----------------- | --------- | -------------------------------------------------------------------------------- |
| battleKey         | BattleKey | The battle key                                                                   |
| tradeType         | TradeType | The trade type (buy Spear or buy Shield)                                         |
| amountSpecified   | uint256   | How much collateral input or SToken output amount to be swapped in/out           |
| recipient         | address   | The address to receive the output of the swap                                    |
| amountOutMin      | uint256   | The minimum amount of Spear or Shield output to receive                          |
| sqrtPriceLimitX96 | uint160   | The maximum/minimum Q64.96 sqrtPrice limit. When reached, the trade is completed |
| deadline          | uint256   | The deadline of the transaction                                                  |


---

# 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://docs.divergence-protocol.com/technical-reference/periphery/params.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.
