> ## Documentation Index
> Fetch the complete documentation index at: https://creator-a1160a86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Pool

To create a new liquidity pool on Saros AMM, you first need to configure the tokens for the pair and find their Associated Token Accounts (ATAs). This guide will walk you through these initial setup steps.

## 1. Configure Token Details

First, create a `constants.ts` file to store the details of the tokens you want to create a pool for. This makes it easy to reuse token information across your project.

For this example, we'll configure PYUSD and WSOL on the devnet.

```typescript constants.ts theme={null}
export const PYUSD_TOKEN_DEVNET = {
    id: "pyusd",
    mintAddress: "CXk2AMBfi3TwaEL2468s6zP8xq9NxTXjp9gjMgzeUynM",
    symbol: "PYUSD",
    name: "PAYPAL USD",
    decimals: 6,
}

export const WSOL_TOKEN_DEVNET = {
    id: "wsol",
    mintAddress: "So11111111111111111111111111111111111111112",
    symbol: "WSOL",
    name: "Wrapped SOL",
    decimals: 9,
}
```

## 2. Find Associated Token Accounts (ATAs)

Next, we need to find the ATAs for these tokens for a specific wallet. Create a new file named `get-ata.ts` and add the following script.

This script uses the `@solana/spl-token` library to find the ATAs for our configured tokens.

```typescript get-ata.ts theme={null}
import { getAssociatedTokenAddress } from "@solana/spl-token";
import { PublicKey } from "@solana/web3.js";
import { loadWalletFromCLI } from "./wallet.js"; // This is a custom function
import { PYUSD_TOKEN_DEVNET, WSOL_TOKEN_DEVNET } from "./constants.js";

// Note: loadWalletFromCLI() is a custom function to load a keypair.
// You can replace it with your preferred method of loading a wallet,
// for example:
// import { Keypair } from "@solana/web3.js";
// const wallet = Keypair.generate();
const wallet = loadWalletFromCLI();

const pyusdMint = new PublicKey(PYUSD_TOKEN_DEVNET.mintAddress);
const pyusdAta = await getAssociatedTokenAddress(pyusdMint, wallet.publicKey);

const wsolMint = new PublicKey(WSOL_TOKEN_DEVNET.mintAddress);
const wsolaAta = await getAssociatedTokenAddress(wsolMint, wallet.publicKey);

console.log("PYUSD ATA:", pyusdAta.toBase58());
console.log("WSOL ATA:", wsolaAta.toBase58());
```

> [!NOTE]
>
> The `loadWalletFromCLI()` function is a placeholder for your own wallet loading logic. You can use any method you prefer to provide a keypair, such as importing from a JSON file or using `Keypair.generate()` for a new wallet.

## 3. Run the Script

Now, compile your TypeScript files and run the script to get the ATAs.

```bash theme={null}
tsc
node dist/get-ata.js
```

You should see an output similar to this:

```bash theme={null}
PYUSD ATA: BE8s6fiZUYGk91rm5t5XChcEmUjmsMvfF7PvijgT3qcs
WSOL ATA: Ew4kwo6h4W1JLonXR9y7kci6EG6x6An8VDXCrgz1CbYg
```

## 4. Update Token Configuration

Finally, update your `constants.ts` file with the ATAs you just retrieved. This will be useful when you interact with the pool.

```typescript constants.ts theme={null}
export const PYUSD_TOKEN_DEVNET = {
    id: "pyusd",
    mintAddress: "CXk2AMBfi3TwaEL2468s6zP8xq9NxTXjp9gjMgzeUynM",
    symbol: "PYUSD",
    name: "PAYPAL USD",
    decimals: 6,
    myATA: "BE8s6fiZUYGk91rm5t5XChcEmUjmsMvfF7PvijgT3qcs" // [!code ++]
}

export const WSOL_TOKEN_DEVNET = {
    id: "wsol",
    mintAddress: "So11111111111111111111111111111111111111112",
    symbol: "WSOL",
    name: "Wrapped SOL",
    decimals: 9,
    myATA: "Ew4kwo6h4W1JLonXR9y7kci6EG6x6An8VDXCrgz1CbYg", // [!code ++]
}
```

Now you have all the necessary information to proceed with creating a pool.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.