Documentation
How $Liquidify works, from fee collection to autonomous liquidity management.
Overview
What is Liquidify?
$Liquidify is a Solana token with an autonomous agent that manages all creator fees. There is no team wallet. There is no manual process. Every single fee generated by trading goes back into strengthening the token.
Pre-migration: fees are used to buy back $Liquidify on the bonding curve, accumulating tokens. Post-migration: fees are used to deepen the liquidity pool on PumpSwap AMM. The agent decides automatically based on on-chain state.
SDK setup
Agent initialization
The agent is a TypeScript process built on two official Pump.fun SDKs: pump-sdk for bonding curve operations, and pump-swap-sdk for AMM interactions post-migration. It connects to a Solana RPC, loads the agent keypair, and initializes both online (on-chain reads) and offline (instruction building) SDK instances.
import { createRequire } from "node:module";
import { Connection, Keypair, LAMPORTS_PER_SOL } from "@solana/web3.js";
import { TOKEN_2022_PROGRAM_ID } from "@solana/spl-token";
const require = createRequire(import.meta.url);
const { OnlinePumpSdk, PumpSdk, getBuyTokenAmountFromSolAmount } = require("@pump-fun/pump-sdk");
const { OnlinePumpAmmSdk, PumpAmmSdk, canonicalPumpPoolPda } = require("@pump-fun/pump-swap-sdk");
const connection = new Connection(process.env.RPC_URL, "confirmed");
const agent = Keypair.fromSecretKey(bs58.decode(process.env.AGENT_PRIVATE_KEY));
const mint = new PublicKey(process.env.MINT_ADDRESS);
const pumpOnline = new OnlinePumpSdk(connection);
const pumpOffline = new PumpSdk();
const pumpAmmOnline = new OnlinePumpAmmSdk(connection);
const pumpAmmOffline = new PumpAmmSdk();Fee collection
Step 1: Claim creator fees
Every cycle starts by checking the creator fee vault. Pump.fun accumulates trading fees in a vault PDA tied to the token creator. The agent calls getCreatorVaultBalanceBothPrograms to check both the bonding curve vault and the AMM vault in a single call.
If the vault holds more than 0.01 SOL, the agent claims everything. It measures actual SOL received by comparing wallet balance before and after — not the vault estimate. This protects against any discrepancy between the reported amount and what the program actually transfers.
// check vault balance across both programs
const lamports = await pumpOnline
.getCreatorVaultBalanceBothPrograms(agent.publicKey);
if (lamports.toNumber() / LAMPORTS_PER_SOL < 0.01) return; // wait
// claim all accumulated creator fees
const solBefore = await connection.getBalance(agent.publicKey);
const claimIx = await pumpOnline
.collectCoinCreatorFeeInstructions(agent.publicKey, agent.publicKey);
await sendAndConfirm(connection, new Transaction().add(...claimIx), agent);
const solAfter = await connection.getBalance(agent.publicKey);
const claimed = (solAfter - solBefore) / LAMPORTS_PER_SOL;Migration detection
How the agent decides
After claiming, the agent needs to decide: buyback or LP? It first tries getMinimumDistributableFee which returns an isGraduated flag. If that call fails (older token or network issue), it falls back to checking if the canonical PumpSwap AMM pool account exists on-chain.
// primary: check graduation status via SDK
let isMigrated = false;
try {
const feeResult = await pumpOnline.getMinimumDistributableFee(mint);
isMigrated = feeResult.isGraduated;
} catch {
// fallback: check if canonical AMM pool exists on-chain
const poolKey = canonicalPumpPoolPda(mint);
const poolInfo = await connection.getAccountInfo(poolKey);
if (poolInfo) isMigrated = true;
}Pre-migration
Step 2a: Buyback on bonding curve
While the token is on the bonding curve, the agent uses 100% of claimed fees to buy $Liquidify directly through the Pump.fun bonding curve program. It fetches the current global state and bonding curve reserves to calculate exactly how many tokens the SOL will buy.
The SDK's getBuyTokenAmountFromSolAmount computes the output using the constant-product formula adjusted for protocol and creator fees. The real bonding curve data is used — virtualSolReserves, virtualTokenReserves, and tokenTotalSupply.
// fetch on-chain bonding curve state
const global = await pumpOnline.fetchGlobal();
const { bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo } =
await pumpOnline.fetchBuyState(mint, agent.publicKey, TOKEN_2022_PROGRAM_ID);
// calculate how many tokens we get for our SOL
const solBn = new BN(Math.floor(solAmount * 1e9));
const amount = getBuyTokenAmountFromSolAmount({
global,
feeConfig: null,
mintSupply: bondingCurve.tokenTotalSupply,
bondingCurve,
amount: solBn,
});
// execute buy through bonding curve program
const buyIx = await pumpOffline.buyInstructions({
global,
bondingCurveAccountInfo,
bondingCurve,
associatedUserAccountInfo,
mint,
user: agent.publicKey,
solAmount: solBn,
amount,
slippage: 2,
tokenProgram: TOKEN_2022_PROGRAM_ID,
});
await sendAndConfirm(connection, new Transaction().add(...buyIx), agent);Post-migration
Step 2b: Add liquidity to AMM
Once $Liquidify migrates to PumpSwap AMM, the strategy shifts entirely. Instead of buybacks, 100% of fees go into deepening the liquidity pool. This happens in two transactions.
First, 65% of the SOL is used to buy tokens through the AMM. This gives the agent the tokens it needs for the deposit.
// Tx 1 — buy tokens with 65% of SOL
const buySolBn = new BN(Math.floor(solAmount * 0.65 * 1e9));
const poolKey = canonicalPumpPoolPda(mint);
const swapState = await pumpAmmOnline.swapSolanaState(poolKey, agent.publicKey);
const buyIx = await pumpAmmOffline.buyQuoteInput(swapState, buySolBn, 5);
await sendAndConfirm(connection, new Transaction().add(...buyIx), agent);
// wait for tokens to land on-chain
await new Promise(r => setTimeout(r, 4000));Then, the remaining 35% SOL plus the bought tokens are deposited together as balanced liquidity. The SDK auto-calculates the correct token ratio. The deposit instruction requires a manual v2 PDA append (the SDK handles this for swaps but not deposits).
// Tx 2 — deposit SOL + tokens as LP (35% of SOL)
const depositSolBn = new BN(Math.floor(solAmount * 0.35 * 1e9));
const liquidityState = await pumpAmmOnline
.liquiditySolanaState(poolKey, agent.publicKey);
const { lpToken } = pumpAmmOffline
.depositAutocompleteBaseAndLpTokenFromQuote(liquidityState, depositSolBn, 10);
const depositIx = await pumpAmmOffline
.depositInstructions(liquidityState, lpToken, 10);
// deposit needs manual v2 PDA (SDK doesn't add it for deposits)
for (const ix of depositIx) {
if (ix.programId.equals(PUMP_AMM_PROGRAM_ID)) {
ix.keys.push({
pubkey: poolV2Pda(mint),
isSigner: false,
isWritable: false,
});
}
}
await sendAndConfirm(connection, new Transaction().add(...depositIx), agent);The loop
Agent cycle
The agent runs an infinite loop. Each iteration: check vault, claim if possible, detect migration status, execute the right strategy, log results, wait. Default cycle interval is 60 seconds.
The agent always keeps 0.02 SOL in the wallet as a reserve for transaction fees. It never spends more than what was just claimed. Pre-existing SOL and tokens in the wallet are untouched.
while (true) {
const vault = await checkVaultBalance();
if (vault < 0.01) { await sleep(60_000); continue; }
await claimFees();
const migrated = await isTokenMigrated();
if (!migrated) {
await doBuyback(claimed); // bonding curve buy
} else {
await doAddLp(claimed); // 65% buy + 35% LP deposit
}
await logCycle(); // save to supabase
await sleep(60_000);
}Thinking feed
The thinking station
After every cycle, the agent generates a short summary of what it did and why. This is created using OpenAI and stored in Supabase alongside the cycle data.
The website displays these thoughts in real time with a blinking cursor, giving the appearance of an AI that's actively thinking. Each thought shows the action type (buyback, LP, monitoring) and when it happened.
Data flow
Architecture
Solana blockchain: the agent interacts directly with Pump.fun's on-chain programs — the bonding curve program (6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P) and the PumpSwap AMM program (PSwapMdSai8tjrEXcxFeQth87xC4rRsa4VA5mhGhXkP). All actions settle on-chain.
Supabase: stores cumulative stats (total collected, total bought back, total added to pool), the activity feed, and the latest agent thought. Updated after every cycle.
Vercel: the website fetches data from Supabase and displays it. Only the anon key is exposed to the frontend. The website is read-only — no admin panel, no manual controls.
Platform
Coming soon: launch your own
The same engine that powers $Liquidify will be available as a platform. Launch your own token with a built-in autonomous LP agent.
Same fee collection. Same buyback-to-LP pipeline. Same real-time thinking feed. Just your token.