Skip to content
docs

KaminoVaultProtocolSolana

Defined in: protocol-lending-kamino-solana/src/vault.ts:98

A Kamino Earn vault (kVault) as a LendingProtocol: supply deposits the vault’s asset for shares (kept in the wallet; staked in the vault farm with skipFarm: false), withdraw redeems shares for the asset; borrow / repay reject, a vault does not lend to its depositors.

The transaction comes from Kamino’s API and is signed only after the wallet’s guard proves it carries only the instructions the operation takes, on this vault and the wallet’s own accounts, and moves exactly the declared balances (the deposit out, the asset in at the minimum, no other token account touched). The bounds come from the chain: the share price from the vault’s state and its reserves, the position from the wallet’s shares account and farm stake; the API’s price must agree with it. Reads (getVault, getPosition, APY, TVL) are the API’s.

new KaminoVaultProtocolSolana(account, config): KaminoVaultProtocolSolana

Defined in: protocol-lending-kamino-solana/src/vault.ts:102

IWalletAccountReadOnly | IWalletAccount

KaminoVaultConfig

KaminoVaultProtocolSolana

KaminoBase.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

Defined in: core/dist/index-QWdcwE6y.d.ts:309

KaminoBase._account


protected readonly _config: KaminoVaultConfig

Defined in: core/dist/index-QWdcwE6y.d.ts:310

KaminoBase._config


readonly api: KaminoApi

Defined in: protocol-lending-kamino-solana/src/base.ts:72

KaminoBase.api


protected readonly rentAllowance: bigint

Defined in: protocol-lending-kamino-solana/src/base.ts:74

KaminoBase.rentAllowance


protected readonly slippageBps: number

Defined in: protocol-lending-kamino-solana/src/base.ts:73

KaminoBase.slippageBps


readonly vault: string

Defined in: protocol-lending-kamino-solana/src/vault.ts:99

borrow(): Promise<LendingResult>

Defined in: protocol-lending-kamino-solana/src/vault.ts:310

Borrow against collateral.

Promise<LendingResult>

KaminoBase.borrow


protected decimals(mint): Promise<number>

Defined in: protocol-lending-kamino-solana/src/base.ts:104

Mint decimals: the account reads the mint when it can; well-known mints need no RPC.

string

Promise<number>

KaminoBase.decimals


describeActivity(_tx, _ctx): ActivityItem | null

Defined in: core/dist/index-QWdcwE6y.d.ts:320

Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return null when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.

ChainTx

DescribeActivityContext

ActivityItem | null

KaminoBase.describeActivity


getApy(): Promise<number>

Defined in: protocol-lending-kamino-solana/src/vault.ts:164

Net APY in percent.

Promise<number>


getPosition(): Promise<VaultPosition>

Defined in: protocol-lending-kamino-solana/src/vault.ts:169

Shares (wallet + farm) and what they are worth now.

Promise<VaultPosition>


getVault(): Promise<VaultInfo>

Defined in: protocol-lending-kamino-solana/src/vault.ts:158

The vault as the API describes it: asset, shares, rate, fees, TVL.

Promise<VaultInfo>


protected guard(expect, instructions): SerializedGuard

Defined in: protocol-lending-kamino-solana/src/base.ts:121

Expectation

readonly InstructionRule[]

SerializedGuard

KaminoBase.guard


protected me(): Promise<string>

Defined in: protocol-lending-kamino-solana/src/base.ts:98

Promise<string>

KaminoBase.me


protected memo(): string | undefined

Defined in: protocol-lending-kamino-solana/src/base.ts:169

string | undefined

KaminoBase.memo


quoteBorrow(): Promise<LendingQuote>

Defined in: protocol-lending-kamino-solana/src/vault.ts:311

Network fee of borrow.

Promise<LendingQuote>

KaminoBase.quoteBorrow


protected quoteBuilt(base64, expect, instructions): Promise<{ fee: bigint; }>

Defined in: protocol-lending-kamino-solana/src/base.ts:153

Simulate the built transaction through the account’s guard and return its fee; nothing is signed.

string

Expectation

readonly InstructionRule[]

Promise<{ fee: bigint; }>

KaminoBase.quoteBuilt


quoteRepay(): Promise<LendingQuote>

Defined in: protocol-lending-kamino-solana/src/vault.ts:313

Network fee of repay.

Promise<LendingQuote>

KaminoBase.quoteRepay


quoteSupply(o): Promise<VaultSupplyQuote>

Defined in: protocol-lending-kamino-solana/src/vault.ts:250

Network fee of supply.

KaminoVaultSupplyOptions

Promise<VaultSupplyQuote>

KaminoBase.quoteSupply


quoteWithdraw(o): Promise<VaultWithdrawQuote>

Defined in: protocol-lending-kamino-solana/src/vault.ts:295

Network fee of withdraw.

KaminoVaultWithdrawOptions

Promise<VaultWithdrawQuote>

KaminoBase.quoteWithdraw


protected readChain(addresses): Promise<(ChainAccount | null)[]>

Defined in: protocol-lending-kamino-solana/src/base.ts:127

Accounts from the chain through the wallet’s RPC, in the order asked (null where none exists).

readonly string[]

Promise<(ChainAccount | null)[]>

KaminoBase.readChain


protected receiveExpectation(mint, expected, extraLamports?, max?): Expectation

Defined in: protocol-lending-kamino-solana/src/base.ts:146

The wallet must receive at least expected × (1 − slippage) of mint (and at most max, when given); rent is the only SOL it may lose.

string

bigint

bigint = 0n

bigint

Expectation

KaminoBase.receiveExpectation


repay(): Promise<LendingResult>

Defined in: protocol-lending-kamino-solana/src/vault.ts:312

Repay a borrow.

Promise<LendingResult>

KaminoBase.repay


protected requireSigningAccount(methodName): IWalletAccount

Defined in: core/dist/index-QWdcwE6y.d.ts:322

The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.

string

IWalletAccount

KaminoBase.requireSigningAccount


protected requireSolana(): void

Defined in: protocol-lending-kamino-solana/src/base.ts:89

Refuse anything that is not a mainnet Solana account before an API call is made in its name.

void

KaminoBase.requireSolana


protected sendBuilt(base64, expect, instructions, method): Promise<{ fee: bigint; hash: string; }>

Defined in: protocol-lending-kamino-solana/src/base.ts:161

Guard, sign and broadcast the built transaction; the account refuses before signing if the proof fails.

string

Expectation

readonly InstructionRule[]

string

Promise<{ fee: bigint; hash: string; }>

KaminoBase.sendBuilt


protected spendExpectation(mint, amount, extraLamports?): Expectation

Defined in: protocol-lending-kamino-solana/src/base.ts:136

The wallet sends amount of mint (SOL counts on the lamport side) and may lose rent on top.

string

bigint

bigint = 0n

Expectation

KaminoBase.spendExpectation


protected state(): Promise<ApiVault>

Defined in: protocol-lending-kamino-solana/src/vault.ts:119

The vault’s static state (cached per instance), checked against what the API cannot choose: it is this vault, on the kVault program, its shares mint is the one the program derives for it, and it takes the configured asset. Mint decimals come from the chain when the account can read them (round 3, H7: a changed sharesMint turned the withdraw guard into a pass for any token).

Promise<ApiVault>


supply(o): Promise<LendingResult>

Defined in: protocol-lending-kamino-solana/src/vault.ts:257

Deposit into the market or vault. Sends an approval first when needed.

KaminoVaultSupplyOptions

Promise<LendingResult>

KaminoBase.supply


protected surface(): SolanaAccountSurface

Defined in: protocol-lending-kamino-solana/src/base.ts:94

SolanaAccountSurface

KaminoBase.surface


withdraw(o): Promise<LendingResult>

Defined in: protocol-lending-kamino-solana/src/vault.ts:303

Withdraw a deposit.

KaminoVaultWithdrawOptions

Promise<LendingResult>

KaminoBase.withdraw