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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new KaminoVaultProtocolSolana(
account,config):KaminoVaultProtocolSolana
Defined in: protocol-lending-kamino-solana/src/vault.ts:102
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”Returns
Section titled “Returns”KaminoVaultProtocolSolana
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:309
Inherited from
Section titled “Inherited from”_config
Section titled “_config”
protectedreadonly_config:KaminoVaultConfig
Defined in: core/dist/index-QWdcwE6y.d.ts:310
Inherited from
Section titled “Inherited from”
readonlyapi:KaminoApi
Defined in: protocol-lending-kamino-solana/src/base.ts:72
Inherited from
Section titled “Inherited from”rentAllowance
Section titled “rentAllowance”
protectedreadonlyrentAllowance:bigint
Defined in: protocol-lending-kamino-solana/src/base.ts:74
Inherited from
Section titled “Inherited from”slippageBps
Section titled “slippageBps”
protectedreadonlyslippageBps:number
Defined in: protocol-lending-kamino-solana/src/base.ts:73
Inherited from
Section titled “Inherited from”
readonlyvault:string
Defined in: protocol-lending-kamino-solana/src/vault.ts:99
Methods
Section titled “Methods”borrow()
Section titled “borrow()”borrow():
Promise<LendingResult>
Defined in: protocol-lending-kamino-solana/src/vault.ts:310
Borrow against collateral.
Returns
Section titled “Returns”Promise<LendingResult>
Overrides
Section titled “Overrides”decimals()
Section titled “decimals()”
protecteddecimals(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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<number>
Inherited from
Section titled “Inherited from”describeActivity()
Section titled “describeActivity()”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.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
Inherited from
Section titled “Inherited from”getApy()
Section titled “getApy()”getApy():
Promise<number>
Defined in: protocol-lending-kamino-solana/src/vault.ts:164
Net APY in percent.
Returns
Section titled “Returns”Promise<number>
getPosition()
Section titled “getPosition()”getPosition():
Promise<VaultPosition>
Defined in: protocol-lending-kamino-solana/src/vault.ts:169
Shares (wallet + farm) and what they are worth now.
Returns
Section titled “Returns”Promise<VaultPosition>
getVault()
Section titled “getVault()”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.
Returns
Section titled “Returns”Promise<VaultInfo>
guard()
Section titled “guard()”
protectedguard(expect,instructions):SerializedGuard
Defined in: protocol-lending-kamino-solana/src/base.ts:121
Parameters
Section titled “Parameters”expect
Section titled “expect”instructions
Section titled “instructions”readonly InstructionRule[]
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”
protectedme():Promise<string>
Defined in: protocol-lending-kamino-solana/src/base.ts:98
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”memo()
Section titled “memo()”
protectedmemo():string|undefined
Defined in: protocol-lending-kamino-solana/src/base.ts:169
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”quoteBorrow()
Section titled “quoteBorrow()”quoteBorrow():
Promise<LendingQuote>
Defined in: protocol-lending-kamino-solana/src/vault.ts:311
Network fee of borrow.
Returns
Section titled “Returns”Promise<LendingQuote>
Overrides
Section titled “Overrides”quoteBuilt()
Section titled “quoteBuilt()”
protectedquoteBuilt(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.
Parameters
Section titled “Parameters”base64
Section titled “base64”string
expect
Section titled “expect”instructions
Section titled “instructions”readonly InstructionRule[]
Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Inherited from
Section titled “Inherited from”quoteRepay()
Section titled “quoteRepay()”quoteRepay():
Promise<LendingQuote>
Defined in: protocol-lending-kamino-solana/src/vault.ts:313
Network fee of repay.
Returns
Section titled “Returns”Promise<LendingQuote>
Overrides
Section titled “Overrides”quoteSupply()
Section titled “quoteSupply()”quoteSupply(
o):Promise<VaultSupplyQuote>
Defined in: protocol-lending-kamino-solana/src/vault.ts:250
Network fee of supply.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<VaultSupplyQuote>
Overrides
Section titled “Overrides”quoteWithdraw()
Section titled “quoteWithdraw()”quoteWithdraw(
o):Promise<VaultWithdrawQuote>
Defined in: protocol-lending-kamino-solana/src/vault.ts:295
Network fee of withdraw.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<VaultWithdrawQuote>
Overrides
Section titled “Overrides”readChain()
Section titled “readChain()”
protectedreadChain(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).
Parameters
Section titled “Parameters”addresses
Section titled “addresses”readonly string[]
Returns
Section titled “Returns”Promise<(ChainAccount | null)[]>
Inherited from
Section titled “Inherited from”receiveExpectation()
Section titled “receiveExpectation()”
protectedreceiveExpectation(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.
Parameters
Section titled “Parameters”string
expected
Section titled “expected”bigint
extraLamports?
Section titled “extraLamports?”bigint = 0n
bigint
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”repay()
Section titled “repay()”repay():
Promise<LendingResult>
Defined in: protocol-lending-kamino-solana/src/vault.ts:312
Repay a borrow.
Returns
Section titled “Returns”Promise<LendingResult>
Overrides
Section titled “Overrides”requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
Parameters
Section titled “Parameters”methodName
Section titled “methodName”string
Returns
Section titled “Returns”IWalletAccount
Inherited from
Section titled “Inherited from”KaminoBase.requireSigningAccount
requireSolana()
Section titled “requireSolana()”
protectedrequireSolana():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.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”sendBuilt()
Section titled “sendBuilt()”
protectedsendBuilt(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.
Parameters
Section titled “Parameters”base64
Section titled “base64”string
expect
Section titled “expect”instructions
Section titled “instructions”readonly InstructionRule[]
method
Section titled “method”string
Returns
Section titled “Returns”Promise<{ fee: bigint; hash: string; }>
Inherited from
Section titled “Inherited from”spendExpectation()
Section titled “spendExpectation()”
protectedspendExpectation(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.
Parameters
Section titled “Parameters”string
amount
Section titled “amount”bigint
extraLamports?
Section titled “extraLamports?”bigint = 0n
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”state()
Section titled “state()”
protectedstate():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).
Returns
Section titled “Returns”Promise<ApiVault>
supply()
Section titled “supply()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>
Overrides
Section titled “Overrides”surface()
Section titled “surface()”
protectedsurface():SolanaAccountSurface
Defined in: protocol-lending-kamino-solana/src/base.ts:94
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”withdraw()
Section titled “withdraw()”withdraw(
o):Promise<LendingResult>
Defined in: protocol-lending-kamino-solana/src/vault.ts:303
Withdraw a deposit.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>