Create tokens and pools
Prepare factory issuance and a direct CLMM pool with explicit mint ordering and price.
Use the client from the Getting started. All results are unsigned and require the transaction lifecycle.
Issue a token
prepareCreateToken accepts tokenId, decimals, initialSupply, mintAuthority, and an optional creator. Supply is a bigint quantity in atoms. The factory creates a recipient PDA; it is not the creator's associated token account. Use the returned recipient as an explicit token-account override when spending that issuance.
See Token factory for supply and authority rules.
Create a direct pool
Canonical mint order is ascending by address bytes. orderMints orders the pair, but never silently inverts a price. The initial sqrtPriceX64 always represents sqrt(B atoms / A atoms) × 2^64 after ordering.
import { defaultPoolConfiguration, orderMints } from "@grapl/sdk";
import type { GraplClient, PreparedTransaction } from "@grapl/sdk";
import type { Address } from "@solana/kit";
export async function prepareEqualAtomPricePool(
client: GraplClient,
firstMint: Address,
secondMint: Address,
poolId: bigint,
): Promise<PreparedTransaction> {
const [mintA, mintB] = orderMints(firstMint, secondMint);
return client.prepareCreatePool({
poolId,
mintA,
mintB,
sqrtPriceX64: 1n << 64n,
configuration: defaultPoolConfiguration(),
});
}This example starts at equal atom price, which is equal displayed token price only if decimals match. The SDK helper's unhooked default uses tick spacing 64, a 3,000 ppm trade fee, a 10,000 ppm fee ceiling, and allocates the entire post-protocol remainder to LPs. Mandatory 10% protocol retention still applies in Pool 6. These are convenience defaults, not requirements for every grapl pool.
Pool creation does not supply liquidity. Confirm creation, then open and fund a position. Reserves currently use classic SPL Token; Token-2022 reserve mints are unsupported.
Curves and graduation
The protocol has curve creation, trading, graduation, and remainder instructions. Use the existing generated builders with prepareInstructions when you need those operations; this direct client does not offer curve or zap convenience methods. Read Bonding curves and Zaps for semantics and the instruction reference for exact accounts.