> For the complete documentation index, see [llms.txt](https://cetus-1.gitbook.io/cetus-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cetus-1.gitbook.io/cetus-developer-docs/developer/via-clmm-contract/data-structure.md).

# Data Structure

## Clmm

### 1. Position

```rust
/// The Cetus clmmpool's position NFT.
struct Position has key, store {
    id: UID,
    pool: ID,
    index: u64,
    coin_type_a: TypeName,
    coin_type_b: TypeName,
    name: String,
    description: String,
    url: String,
    tick_lower_index: I32,
    tick_upper_index: I32,
    liquidity: u128,
}
```

### 2. Rewarder

```rust
struct Rewarder has copy, drop, store {
    reward_coin: TypeName,
    emissions_per_second: u128,
    growth_global: u128,
}
```

### 3. Pool

```rust
/// The clmmpool
struct Pool<phantom CoinTypeA, phantom CoinTypeB> has key, store {
    id: UID,

    coin_a: Balance<CoinTypeA>,
    coin_b: Balance<CoinTypeB>,

    /// The tick spacing
    tick_spacing: u32,

    /// The numerator of fee rate, the denominator is 1_000_000.
    fee_rate: u64,

    /// The liquidity of current tick index
    liquidity: u128,

    /// The current sqrt price
    current_sqrt_price: u128,

    /// The current tick index
    current_tick_index: I32,

    /// The global fee growth of coin a,b as Q64.64
    fee_growth_global_a: u128,
    fee_growth_global_b: u128,

    /// The amounts of coin a,b owend to protocol
    fee_protocol_coin_a: u64,
    fee_protocol_coin_b: u64,

    /// The tick manager
    tick_manager: TickManager,

    /// The rewarder manager
    rewarder_manager: RewarderManager,

    /// The position manager
    position_manager: PositionManager,

    /// is the pool pause
    is_pause: bool,

    /// The pool index
    index: u64,

    /// The url for pool and postion
    url: String,

}
```

### 4. AddLiquidityReceipt

```rust
/// Flash loan resource for add_liquidity
struct AddLiquidityReceipt<phantom CoinTypeA, phantom CoinTypeB> {
    pool_id: ID,
    amount_a: u64,
    amount_b: u64
}
```

## 5. FlashSwapReceipt

```rust
/// Flash loan resource for swap.
/// There is no way in Move to pass calldata and make dynamic calls, but a resource can be used for this purpose.
/// To make the execution into a single transaction, the flash loan function must return a resource
/// that cannot be copied, cannot be saved, cannot be dropped, or cloned.
struct FlashSwapReceipt<phantom CoinTypeA, phantom CoinTypeB> {
    pool_id: ID,
    a2b: bool,
    partner_id: ID,
    pay_amount: u64,
    ref_fee_amount: u64
}
```


---

# 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://cetus-1.gitbook.io/cetus-developer-docs/developer/via-clmm-contract/data-structure.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.
