> For the complete documentation index, see [llms.txt](https://docs.fluxbeam.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluxbeam.xyz/developers/pool-api.md).

# Pool API

The FluxBeam Pool API allows developers to quickly and easily integrate the creation of pools within their platform.&#x20;

## Create Pool

{% openapi src="/files/BTXW41fbdTNJwtnc3yie" path="/v1/token\_pools" method="post" fullWidth="false" %}
[swagger.json](https://1346299214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2Aiu5M1GjdMOI04TEPX%2Fuploads%2FtJlI9ZjUrfH7QfZeH8wj%2Fswagger.json?alt=media\&token=5f2a6e1a-245d-4019-ae4b-3cc068913b76)
{% endopenapi %}

### Example

{% code fullWidth="false" %}

```javascript
import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';

const form = {
	payer: "", 	  // Wallet address of the payer
	tokenA: "", 	  // Token A Mint
	tokenB: "", 	  // Token B Mint
	tokenAAmount: "", // Token A Liquidity Amount
	tokenBAmount: ""  // Token B Liquidity Amount
}

const resp = await (
	await fetch(`https://api.fluxbeam.xyz/v1/token_pools`, {
		method: 'POST',
		headers: {'Content-Type': 'application/json'},
		body: JSON.stringify({
			"payer": form.payer,
			"token_a": form.tokenA,
			"token_b": .form.tokenB,
			"token_a_amount": form.tokenAAmount,
			"token_b_amount": form.tokenBAmount
		})
	})).json()

console.log("Pool Address:", resp.pool)

//Decode the transaction from base64
const swapTransactionBuf = Buffer.from(resp.transaction, 'base64');
const transaction = VersionedTransaction.deserialize(swapTransactionBuf);

console.log("Transaction",transaction);

//Sign the transaction with the payer wallet
transaction.sign([wallet.payer]);

//Execute the transaction
const client= new Connection('{RPC_URL}');
const sig = client.sendRawTransaction(transaction.serialize(), {maxRetries: 3, skipPreflight: true})

console.log("Transaction Signature:", sig)
```

{% endcode %}
