> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration

> DAMM v2

The `rust-sdk` provides a convenient way to interact with the DAMM v2 program.

Before you begin, here are some important resources:

<CardGroup cols={1}>
  <Card title="Rust SDK" icon="rust" iconType="solid" href="https://github.com/MeteoraAg/damm-v2/tree/main/rust-sdk">
    Meteora DAMM v2 Rust SDK
  </Card>
</CardGroup>

# Getting Started

To use the Rust SDK, you need to add it as a dependency in your `Cargo.toml` file. Since it's a local dependency in this workspace, you can add it by specifying its path:

```toml theme={"system"}
[dependencies]
rust-sdk = { path = "../rust-sdk" } # Adjust the path accordingly
cp-amm = { path = "../programs/cp-amm" } # The sdk also needs the cp-amm crate
solana-sdk = "1.18.12" # For Pubkey
```

# API Reference

## `get_quote`

Calculates the result of a swap for a given pool.

### Parameters

* `pool: &Pool`: A reference to the `Pool` state account, deserialized from on-chain data.
* `current_timestamp: u64`: The current blockchain timestamp.
* `current_slot: u64`: The current blockchain slot.
* `actual_amount_in: u64`: The amount of the input token to be swapped.
* `a_to_b: bool`: The direction of the swap. `true` for token A to token B, `false` for token B to token A.
* `has_referral: bool`: Indicates if a referral fee should be considered.

### Returns

A `Result<SwapResult>` which contains the details of the swap if successful, including `amount_out`, fees, and new liquidity states.
