Before you start
- Both tokens registered. The Multiliquid admin registers a token, with its price sources, before anyone can pair it. Contact the Multiliquid team to register one.
- Issuer approval for permissioned tokens. The issuer must admit two addresses: your wallet, which owns the token accounts you fund from, and your vault authority, the PDA that owns your vaults. Step 1 derives it. Admitting one does not admit the other, and the issuer must also thaw both token accounts if it freezes new ones.
- The fee token. Protocol fees are paid in the token that
client.fetchGlobalConfig()returns asfeeTokenMint. - SOL for network fees and rent. Your wallet pays for the pair, its vaults, and the records the program keeps.
- The SDK client and a wallet, set up as in Swap on-chain. Here the wallet is the capital provider’s.
send.ts
1. Get your vault authority admitted
Your vaults are token accounts owned by a PDA derived from your wallet. Derive it, and send both addresses to the issuer of each permissioned token:2. Open the pair
Pass the two mints in any order, and a fee for each direction in basis points:redemptionFeeBps applies to swaps from the quote mint to the base mint, and discountRateBps to swaps from base to quote. The quote mint is not always the stablecoin, so read accounts.quoteTokenMintAddress and set each fee for the direction you mean. Each fee is at most 9,900 basis points, and the two together must be less than 10,000.
Opening the pair also creates a vault for each mint, if you have none yet, and your fee account. A pair opens unpaused.
3. Fund your fee account
Every swap debits its protocol fee from your fee account, in the fee token. Swaps on all your pairs fail while it cannot pay, so keep it funded:4. Add inventory
Fund the vault each swap pays out of: the RWA vault for users who buy, and the stablecoin vault for users who sell.5. Change fees or pause
update_pair sets both fees and the pause flag together, so pass all three:
6. Withdraw inventory
Withdraw any amount the vault holds:7. Close the pair
Closing a pair reclaims its rent. When no other pair of yours uses a vault, the program also returns the vault’s balance to you and closes it:swapProgramClient.getCloseLpFeeAccountInstructionAsync. Close it no earlier: swaps on any pair you still own fail without it.
When something goes wrong
Errors lists every program error.
Next steps
Pairs and liquidity
Every pair and liquidity instruction, including Treasury routing.
Ladder pricing
Change fees with rolling volume, from an off-chain worker.
Security
What you control, and what the admin controls.