Mintvelocity

SDK

Put it on a mint

A mint with your hook, a pool or a bonding curve your program opens, or a launch on Mintvelocity’s launchpad from a config.

On a mint you create

token.createMint(creator, mint.publicKey, { decimals, name, symbol, uri, maxSupply, mintAuthority, freezeAuthority, hookProgram, hookFlags, hookAuthority, metadataAuthority }) - the mint names its hook and the callbacks it subscribes to. token.setHook(creator, mint, hookProgram, hookFlags) changes the hook or its flags while the hook authority is held; token.setAuthority(creator, mint, 'hook', null) locks it: with no hook authority, which program runs is fixed.

Every transfer, mint and burn of a hooked mint carries the hook program, its signer and the extras: fetchTokenHook(connection, { mint, source, destination, authority }) resolves them and the builders take the result: token.transfer(authority, source, destination, mint, amount, hook).

Your own pools and curves

swap.createPool is permissionless for an ordinary pool: any two mints of the standard, any LP fee from 0 to 9,000 bps, with or without a pool hook. A bonding curve (virtual reserves) is opened only by its hook program, which signs with hookAuthority(program), its ["hook-authority"] PDA, and graduates it with finalizeCurve: a launchpad of your own. The pool hook’s extras live in a registry under the pool, registryAddress(program, pool), whose address poolAddress gives before the pool exists.

A pool you open pays the DEX’s protocol fee of the quote side as the config sets it when the pool is created, and keeps every cut its hook takes; the share model (the LP fee and a quarter of the cuts to Mintvelocity) applies only to the curves the launchpad opens. A swap on it is swap.swapWithHooks with each mint’s token hook and the pool hook’s extras. What is open and what stays Mintvelocity’s: build on Mintvelocity.

Integrator fee (router)

An app that routes swaps (a terminal, a wallet, a bot) can charge its own fee on any of the DEX’s pools: build the swap as you would, then wrap it with router.swapV2. The fee is 1 to 100 bps (ROUTER_MAX_FEE_BPS, 1%) of the quote side, rounded down; a buy pays it from its input before the DEX swaps the rest, a sell from what the DEX delivered. A fifth goes to the DEX config’s treasury, the rest to your app’s wallet in SOL. The DEX’s fees and every hook’s still apply, as on a direct swap. Mintvelocity’s own site charges none.

Partner fee

An app or a service that launches coins through the SDK can take a share of every coin’s creator fee without writing a hook: make a partner config with buildCreatePartnerConfig. It fixes the creator fee and names a partner wallet with its share, 1% to 100% of the creator fee (what is left after Mintvelocity’s quarter), paid to the partner on every claim of every coin launched from it, whoever launches, in SOL. It can carry any custom hook and an author’s share too (at most 100% in all), and it never changes. Anyone may pay a coin’s fees out with launch.distributeFeesSol, every party at once to its own fixed wallet, so a partner claims whenever it likes. A coin with a companion can’t launch from a partner config.

On the launchpad

The rules travel in a LaunchConfig, made once and reused; paste its key under “Custom config” on the launch page. The hook must be immutable, timelocked, or upgradeable only by Mintvelocity (make it immutable after deploying); the launch program refuses the config otherwise. The launch creates the mint, so prepare your hook for the mint address the page shows first (the launch does it itself for a Workshop hook). A hook you deployed yourself is shown as a custom hook written by its creator, with who can upgrade it, and no reading; a Workshop hook’s config shows the reading instead.

templateHook.prepare(hook, payer, mint) - the template’s standard prepare. inspectTokenHook(connection, hook, mint) and inspectConfig(connection, config, mint) run the page’s checks. buildCreateConfig(creator, { rules, creatorFeeBps, customHook, customHookFlags, label }) makes the config; buildCreateListedConfig(creator, args, shareBps) a listed one: the share named (1 to 5,000 bps; 5,000 is half, the most) of the creator fee of every launch someone else makes from it goes to its creator.

Transactions

buildV0Transaction(payer, instructions, blockhash, [protocolLookupTable(key)]) builds a v0 message that loads the fixed addresses from the protocol table (its first entries never change; later ones are only appended). explainFailure(logs) names the program that failed and its error, in words.