# LiquidityProvider

`Version: 0.1.7`

## ILiquidityProvider

Fully qualified path: `spline_v0::lp::ILiquidityProvider`

```rust
pub trait ILiquidityProvider<TStorage>
```

### Trait functions

#### create\_and\_initialize\_pool

creates and initializes a pool with ekubo key `pool_key` with initial tick `initial_tick`. only owner of liquidity provider can initialize

Fully qualified path: `spline_v0::lp::ILiquidityProvider::create_and_initialize_pool`

```rust
fn create_and_initialize_pool(
    ref self: TStorage,
    pool_key: ekubo::types::keys::PoolKey,
    initial_tick: ekubo::types::i129::i129,
    profile_params: Span<ekubo::types::i129::i129>,
)
```

#### compound\_fees

compounds any existing fees on pool with ekubo key `pool_key` into the liquidity factor

Fully qualified path: `spline_v0::lp::ILiquidityProvider::compound_fees`

```rust
fn compound_fees(ref self: TStorage, pool_key: ekubo::types::keys::PoolKey) -> u128
```

#### add\_liquidity

adds an amount of liquidity factor to pool with ekubo key `pool_key`, minting shares to caller

Fully qualified path: `spline_v0::lp::ILiquidityProvider::add_liquidity`

```rust
fn add_liquidity(
    ref self: TStorage,
    pool_key: ekubo::types::keys::PoolKey,
    factor: u128,
    amount0_max: u128,
    amount1_max: u128,
) -> u256
```

#### remove\_liquidity

removes an amount of liquidity factor from pool with ekubo key `pool_key`

Fully qualified path: `spline_v0::lp::ILiquidityProvider::remove_liquidity`

```rust
fn remove_liquidity(
    ref self: TStorage,
    pool_key: ekubo::types::keys::PoolKey,
    shares: u256,
    amount0_min: u128,
    amount1_min: u128,
) -> u128
```

#### sweep

sweeps any tokens in this contract to recipient. only callable by owner

Fully qualified path: `spline_v0::lp::ILiquidityProvider::sweep`

```rust
fn sweep(
    ref self: TStorage,
    token: starknet::ContractAddress,
    recipient: starknet::ContractAddress,
    amount: u256,
)
```

#### core

returns the ekubo core for pools deployed by this liquidity provider

Fully qualified path: `spline_v0::lp::ILiquidityProvider::core`

```rust
fn core(self: @TStorage) -> ekubo::interfaces::core::ICoreDispatcher
```

#### profile

returns the profile for pools deployed by this liquidity provider

Fully qualified path: `spline_v0::lp::ILiquidityProvider::profile`

```rust
fn profile(self: @TStorage) -> spline_v0::profile::ILiquidityProfileDispatcher
```

#### pool\_token

returns the liquidity provider token for pool with ekubo key `pool_key`

Fully qualified path: `spline_v0::lp::ILiquidityProvider::pool_token`

```rust
fn pool_token(self: @TStorage, pool_key: ekubo::types::keys::PoolKey) -> starknet::ContractAddress
```

#### pool\_liquidity\_factor

Fully qualified path: `spline_v0::lp::ILiquidityProvider::pool_liquidity_factor`

```rust
fn pool_liquidity_factor(self: @TStorage, pool_key: ekubo::types::keys::PoolKey) -> u128
```

#### pool\_reserves

Fully qualified path: `spline_v0::lp::ILiquidityProvider::pool_reserves`

```rust
fn pool_reserves(self: @TStorage, pool_key: ekubo::types::keys::PoolKey) -> (u128, u128)
```

#### pool\_minimum\_liquidity\_factor

returns the minimum liquidity factor for pool with ekubo key `pool_key` for pool price at given tick

Fully qualified path: `spline_v0::lp::ILiquidityProvider::pool_minimum_liquidity_factor`

```rust
fn pool_minimum_liquidity_factor(
    self: @TStorage, pool_key: ekubo::types::keys::PoolKey, tick: ekubo::types::i129::i129,
) -> u128
```


---

# 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://docs.spline.finance/integration/technical-reference/liquidityprovider.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.
