Guides
Supply and withdraw on Kamino
kamino.supply puts an asset from your private balance into a Kamino reserve and gives you the reserve's deposit token. kamino.withdraw turns the deposit token back into the asset. Between the two, the deposit token sits in your private balance as a note, earning what the reserve pays.
You need a private balance holding the asset you are supplying. Enter and leave covers getting one.
How the position is held
Supplying to a Kamino reserve returns a deposit token: kUSDC for USDC, kSOL for SOL. The token is the position. Its exchange rate to the asset rises as the reserve earns interest, so the same amount of kUSDC redeems for more USDC later.
Both hooks are flow hooks. Each run takes one asset in and returns one asset out, and nothing stays open at Kamino under your name. There is no seat. The deposit token is a note like any other: it shows on Balance, and you can leave with it or hold it.
Supply
Open the hook
On Balance, under Run a hook, press Supply in the Kamino group.
Choose the asset and amount
Pick the asset in and type the amount. The asset out is the reserve's deposit token.
Read the quote and run
The quote shows the deposit tokens you receive after the run fee and the relayer's fee. Press Run. At Done, the deposit token is in your balance.
const USDC = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
const KUSDC = 'B8V6WVjPxW1UGwVDfxH2d2r8SyT4cqn7dQRK6XneVa7D'
const supplied = await pook.run('kamino.supply', {
in: USDC,
out: KUSDC,
amount: '5000000', // 5 USDC in base units
})Withdraw
Withdrawing is the same run in the other direction. The amount is in deposit tokens.
Open the hook
On Balance, under Run a hook, press Withdraw in the Kamino group.
Choose the deposit token and amount
Pick the deposit token as the asset in and type how much of it to redeem. To withdraw everything, use the full amount your balance shows.
Read the quote and run
The quote shows the asset you receive. Press Run.
const { assets } = await pook.balance()
const held = assets.find((a) => a.mint === KUSDC)
const withdrawn = await pook.run('kamino.withdraw', {
in: KUSDC,
out: USDC,
amount: held.amount, // every deposit token you hold
})What the run does at Kamino
Kamino asks for a reserve to be refreshed in the same transaction before it is used. Both hooks name refresh_reserve as a companion, the relayer adds it in front of the run, and the Pook program checks it is there. You do not send it yourself.
The hook's resolver works out the reserve and its accounts from the asset you name. The quote returns the resolved call, and that call is what your proof fixes.
The minimum out works as in any run: the program measures the deposit tokens, or the asset, that arrived, and fails the run if it is less than the quote's minimumOut.
What the chain shows
Each run shows the hook, the reserve, the amount in and the amount out. Kamino records a deposit and a redemption made by Pook's stage, the same address for every holder. Nothing at Kamino or in the transaction names your wallet.