Lending

Kamino Lending historical data as Parquet

Every Kamino Lending instruction and event in Solana history, decoded with an Anchor IDL that we checked against real transactions. Trawl gives you 5 event tables and 66 instruction tables, with a column for each account, argument and field. Calls from other programs (CPI) are in the result too.

Updated

The preset

Program
KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
Preset
kamino-lending
Tables
5 event tables and 66 instruction tables, and part-* with the raw bytes of each match
Price
$4 for one recent epoch, $8.68 for one week of chain

The price is the same for every program: you pay for the archive the scan reads, not for the rows. Pricing.

# ask for a price: a 402 with the quote, no payment yet
curl -X POST https://trawl.run/scan \
  -H 'Content-Type: application/json' \
  -d '{"preset":"kamino-lending","start_epoch":1058,"end_epoch":1058}'

-- then, in DuckDB, on the files of the job
SELECT slot, signature, before
FROM 'ev-borrow_order_cancel_event-*.parquet'
ORDER BY slot
LIMIT 10;

Add "filter": {"accounts": ["<wallet>"]} to keep only the transactions that touch one wallet. How a filter changes a preset.

Event tables

One table for each event in the IDL. Each row also has log_index and the context columns. An event that the program writes two ways gives one row.

ev-borrow_order_cancel_event
fields: before JSON string
ev-borrow_order_full_fill_event
fields: before JSON string
ev-borrow_order_partial_fill_event
fields: before JSON string, after JSON string
ev-borrow_order_place_event
fields: after JSON string
ev-borrow_order_update_event
fields: before JSON string, after JSON string

Instruction tables

One table for each instruction in the IDL: the named accounts, then the arguments. Each row also has the context columns: slot, tx_index, signature, success, fee, program_id, ix_index, is_inner, inner_index, stack_height, accounts. What each one holds.

ix-init_lending_market
accounts: lendingMarketOwner, lendingMarket, lendingMarketAuthority, systemProgram, rent, instructionSysvarAccount
args: quoteCurrency binary
ix-update_lending_market
accounts: signer, lendingMarket, instructionSysvarAccount
args: mode u64, value binary
ix-update_lending_market_owner
accounts: lendingMarketOwnerCached, lendingMarket, instructionSysvarAccount
ix-init_reserve
accounts: signer, lendingMarket, lendingMarketAuthority, reserve, reserveLiquidityMint, reserveLiquiditySupply, feeReceiver, reserveCollateralMint, reserveCollateralSupply, initialLiquiditySource, rent, liquidityTokenProgram, collateralTokenProgram, systemProgram, instructionSysvarAccount
ix-clone_reserve_config
accounts: signer, targetLendingMarket, sourceReserve, targetReserve, instructionSysvarAccount
args: customizations JSON string
ix-init_farms_for_reserve
accounts: lendingMarketOwner, lendingMarket, lendingMarketAuthority, reserve, farmsProgram, farmsGlobalConfig, farmState, farmsVaultAuthority, rent, systemProgram, instructionSysvarAccount
args: mode u8
ix-update_reserve_config
accounts: signer, globalConfig, lendingMarket, reserve, instructionSysvarAccount
args: mode variant name, value binary, skipConfigIntegrityValidation bool
ix-redeem_fees
accounts: reserve, reserveLiquidityMint, reserveLiquidityFeeReceiver, reserveSupplyLiquidity, lendingMarket, lendingMarketAuthority, tokenProgram
ix-withdraw_protocol_fee
accounts: globalConfig, lendingMarket, reserve, reserveLiquidityMint, lendingMarketAuthority, feeVault, feeCollectorAta, tokenProgram, instructionSysvarAccount
args: amount u64
ix-seed_deposit_on_init_reserve
accounts: signer, lendingMarket, reserve, reserveLiquidityMint, reserveLiquiditySupply, initialLiquiditySource, liquidityTokenProgram
ix-topup_reserve_rewards
accounts: signer, lendingMarket, reserve, reserveLiquidityMint, reserveLiquiditySupply, sourceLiquidity, liquidityTokenProgram
args: amount u64
ix-socialize_loss
accounts: lendingMarketOwner, obligation, lendingMarket, reserve, instructionSysvarAccount
args: liquidityAmount u64
ix-socialize_loss_v2
accounts: socializeLossAccounts_lendingMarketOwner, socializeLossAccounts_obligation, socializeLossAccounts_lendingMarket, socializeLossAccounts_reserve, socializeLossAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, lendingMarketAuthority, farmsProgram
args: liquidityAmount u64
ix-mark_obligation_for_deleveraging
accounts: lendingMarketOwner, obligation, lendingMarket, instructionSysvarAccount
args: autodeleverageTargetLtvPct u8
ix-refresh_reserve
accounts: reserve, lendingMarket, pythOracle, switchboardPriceOracle, switchboardTwapOracle, scopePrices
ix-refresh_reserves_batch
args: skipPriceUpdates bool
ix-calculate_ctoken_exchange_rate
accounts: reserve
ix-deposit_reserve_liquidity
accounts: owner, reserve, lendingMarket, lendingMarketAuthority, reserveLiquidityMint, reserveLiquiditySupply, reserveCollateralMint, userSourceLiquidity, userDestinationCollateral, collateralTokenProgram, liquidityTokenProgram, instructionSysvarAccount
args: liquidityAmount u64
ix-redeem_reserve_collateral
accounts: owner, lendingMarket, reserve, lendingMarketAuthority, reserveLiquidityMint, reserveCollateralMint, reserveLiquiditySupply, userSourceCollateral, userDestinationLiquidity, collateralTokenProgram, liquidityTokenProgram, instructionSysvarAccount
args: collateralAmount u64
ix-init_obligation
accounts: obligationOwner, feePayer, obligation, lendingMarket, seed1Account, seed2Account, ownerUserMetadata, rent, systemProgram
args: args JSON string
ix-init_obligation_farms_for_reserve
accounts: payer, owner, obligation, lendingMarketAuthority, reserve, reserveFarmState, obligationFarm, lendingMarket, farmsProgram, rent, systemProgram
args: mode u8
ix-refresh_obligation_farms_for_reserve
accounts: crank, baseAccounts_obligation, baseAccounts_lendingMarketAuthority, baseAccounts_reserve, baseAccounts_reserveFarmState, baseAccounts_obligationFarmUserState, baseAccounts_lendingMarket, farmsProgram, rent, systemProgram
args: mode u8
ix-refresh_obligation
accounts: lendingMarket, obligation
ix-deposit_obligation_collateral
accounts: owner, obligation, lendingMarket, depositReserve, reserveDestinationCollateral, userSourceCollateral, tokenProgram, instructionSysvarAccount
args: collateralAmount u64
ix-deposit_obligation_collateral_v2
accounts: depositAccounts_owner, depositAccounts_obligation, depositAccounts_lendingMarket, depositAccounts_depositReserve, depositAccounts_reserveDestinationCollateral, depositAccounts_userSourceCollateral, depositAccounts_tokenProgram, depositAccounts_instructionSysvarAccount, lendingMarketAuthority, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram
args: collateralAmount u64
ix-withdraw_obligation_collateral
accounts: owner, obligation, lendingMarket, lendingMarketAuthority, withdrawReserve, reserveSourceCollateral, userDestinationCollateral, tokenProgram, instructionSysvarAccount
args: collateralAmount u64
ix-withdraw_obligation_collateral_v2
accounts: withdrawAccounts_owner, withdrawAccounts_obligation, withdrawAccounts_lendingMarket, withdrawAccounts_lendingMarketAuthority, withdrawAccounts_withdrawReserve, withdrawAccounts_reserveSourceCollateral, withdrawAccounts_userDestinationCollateral, withdrawAccounts_tokenProgram, withdrawAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram
args: collateralAmount u64
ix-borrow_obligation_liquidity
accounts: owner, obligation, lendingMarket, lendingMarketAuthority, borrowReserve, borrowReserveLiquidityMint, reserveSourceLiquidity, borrowReserveLiquidityFeeReceiver, userDestinationLiquidity, referrerTokenState, tokenProgram, instructionSysvarAccount
args: liquidityAmount u64
ix-borrow_obligation_liquidity_v2
accounts: borrowAccounts_owner, borrowAccounts_obligation, borrowAccounts_lendingMarket, borrowAccounts_lendingMarketAuthority, borrowAccounts_borrowReserve, borrowAccounts_borrowReserveLiquidityMint, borrowAccounts_reserveSourceLiquidity, borrowAccounts_borrowReserveLiquidityFeeReceiver, borrowAccounts_userDestinationLiquidity, borrowAccounts_referrerTokenState, borrowAccounts_tokenProgram, borrowAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram
args: liquidityAmount u64
ix-repay_obligation_liquidity
accounts: owner, obligation, lendingMarket, repayReserve, reserveLiquidityMint, reserveDestinationLiquidity, userSourceLiquidity, tokenProgram, instructionSysvarAccount
args: liquidityAmount u64
ix-repay_obligation_liquidity_v2
accounts: repayAccounts_owner, repayAccounts_obligation, repayAccounts_lendingMarket, repayAccounts_repayReserve, repayAccounts_reserveLiquidityMint, repayAccounts_reserveDestinationLiquidity, repayAccounts_userSourceLiquidity, repayAccounts_tokenProgram, repayAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, lendingMarketAuthority, farmsProgram
args: liquidityAmount u64
ix-repay_and_withdraw_and_redeem
accounts: repayAccounts_owner, repayAccounts_obligation, repayAccounts_lendingMarket, repayAccounts_repayReserve, repayAccounts_reserveLiquidityMint, repayAccounts_reserveDestinationLiquidity, repayAccounts_userSourceLiquidity, repayAccounts_tokenProgram, repayAccounts_instructionSysvarAccount, withdrawAccounts_owner, withdrawAccounts_obligation, withdrawAccounts_lendingMarket, withdrawAccounts_lendingMarketAuthority, withdrawAccounts_withdrawReserve, withdrawAccounts_reserveLiquidityMint, withdrawAccounts_reserveSourceCollateral, withdrawAccounts_reserveCollateralMint, withdrawAccounts_reserveLiquiditySupply, withdrawAccounts_userDestinationLiquidity, withdrawAccounts_placeholderUserDestinationCollateral, withdrawAccounts_collateralTokenProgram, withdrawAccounts_liquidityTokenProgram, withdrawAccounts_instructionSysvarAccount, collateralFarmsAccounts_obligationFarmUserState, collateralFarmsAccounts_reserveFarmState, debtFarmsAccounts_obligationFarmUserState, debtFarmsAccounts_reserveFarmState, farmsProgram
args: repayAmount u64, withdrawCollateralAmount u64
ix-deposit_and_withdraw
accounts: depositAccounts_owner, depositAccounts_obligation, depositAccounts_lendingMarket, depositAccounts_lendingMarketAuthority, depositAccounts_reserve, depositAccounts_reserveLiquidityMint, depositAccounts_reserveLiquiditySupply, depositAccounts_reserveCollateralMint, depositAccounts_reserveDestinationDepositCollateral, depositAccounts_userSourceLiquidity, depositAccounts_placeholderUserDestinationCollateral, depositAccounts_collateralTokenProgram, depositAccounts_liquidityTokenProgram, depositAccounts_instructionSysvarAccount, withdrawAccounts_owner, withdrawAccounts_obligation, withdrawAccounts_lendingMarket, withdrawAccounts_lendingMarketAuthority, withdrawAccounts_withdrawReserve, withdrawAccounts_reserveLiquidityMint, withdrawAccounts_reserveSourceCollateral, withdrawAccounts_reserveCollateralMint, withdrawAccounts_reserveLiquiditySupply, withdrawAccounts_userDestinationLiquidity, withdrawAccounts_placeholderUserDestinationCollateral, withdrawAccounts_collateralTokenProgram, withdrawAccounts_liquidityTokenProgram, withdrawAccounts_instructionSysvarAccount, depositFarmsAccounts_obligationFarmUserState, depositFarmsAccounts_reserveFarmState, withdrawFarmsAccounts_obligationFarmUserState, withdrawFarmsAccounts_reserveFarmState, farmsProgram
args: liquidityAmount u64, withdrawCollateralAmount u64
ix-deposit_reserve_liquidity_and_obligation_collate
accounts: owner, obligation, lendingMarket, lendingMarketAuthority, reserve, reserveLiquidityMint, reserveLiquiditySupply, reserveCollateralMint, reserveDestinationDepositCollateral, userSourceLiquidity, placeholderUserDestinationCollateral, collateralTokenProgram, liquidityTokenProgram, instructionSysvarAccount
args: liquidityAmount u64
ix-deposit_reserve_liquidity_and_obligation_collate_2
accounts: depositAccounts_owner, depositAccounts_obligation, depositAccounts_lendingMarket, depositAccounts_lendingMarketAuthority, depositAccounts_reserve, depositAccounts_reserveLiquidityMint, depositAccounts_reserveLiquiditySupply, depositAccounts_reserveCollateralMint, depositAccounts_reserveDestinationDepositCollateral, depositAccounts_userSourceLiquidity, depositAccounts_placeholderUserDestinationCollateral, depositAccounts_collateralTokenProgram, depositAccounts_liquidityTokenProgram, depositAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram
args: liquidityAmount u64
ix-withdraw_obligation_collateral_and_redeem_reserv
accounts: owner, obligation, lendingMarket, lendingMarketAuthority, withdrawReserve, reserveLiquidityMint, reserveSourceCollateral, reserveCollateralMint, reserveLiquiditySupply, userDestinationLiquidity, placeholderUserDestinationCollateral, collateralTokenProgram, liquidityTokenProgram, instructionSysvarAccount
args: collateralAmount u64
ix-withdraw_obligation_collateral_and_redeem_reserv_2
accounts: withdrawAccounts_owner, withdrawAccounts_obligation, withdrawAccounts_lendingMarket, withdrawAccounts_lendingMarketAuthority, withdrawAccounts_withdrawReserve, withdrawAccounts_reserveLiquidityMint, withdrawAccounts_reserveSourceCollateral, withdrawAccounts_reserveCollateralMint, withdrawAccounts_reserveLiquiditySupply, withdrawAccounts_userDestinationLiquidity, withdrawAccounts_placeholderUserDestinationCollateral, withdrawAccounts_collateralTokenProgram, withdrawAccounts_liquidityTokenProgram, withdrawAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram
args: collateralAmount u64
ix-liquidate_obligation_and_redeem_reserve_collater
accounts: liquidator, obligation, lendingMarket, lendingMarketAuthority, repayReserve, repayReserveLiquidityMint, repayReserveLiquiditySupply, withdrawReserve, withdrawReserveLiquidityMint, withdrawReserveCollateralMint, withdrawReserveCollateralSupply, withdrawReserveLiquiditySupply, withdrawReserveLiquidityFeeReceiver, userSourceLiquidity, userDestinationCollateral, userDestinationLiquidity, collateralTokenProgram, repayLiquidityTokenProgram, withdrawLiquidityTokenProgram, instructionSysvarAccount
args: liquidityAmount u64, minAcceptableReceivedLiquidityAmount u64, maxAllowedLtvOverridePercent u64
ix-liquidate_obligation_and_redeem_reserve_collater_2
accounts: liquidationAccounts_liquidator, liquidationAccounts_obligation, liquidationAccounts_lendingMarket, liquidationAccounts_lendingMarketAuthority, liquidationAccounts_repayReserve, liquidationAccounts_repayReserveLiquidityMint, liquidationAccounts_repayReserveLiquiditySupply, liquidationAccounts_withdrawReserve, liquidationAccounts_withdrawReserveLiquidityMint, liquidationAccounts_withdrawReserveCollateralMint, liquidationAccounts_withdrawReserveCollateralSupply, liquidationAccounts_withdrawReserveLiquiditySupply, liquidationAccounts_withdrawReserveLiquidityFeeReceiver, liquidationAccounts_userSourceLiquidity, liquidationAccounts_userDestinationCollateral, liquidationAccounts_userDestinationLiquidity, liquidationAccounts_collateralTokenProgram, liquidationAccounts_repayLiquidityTokenProgram, liquidationAccounts_withdrawLiquidityTokenProgram, liquidationAccounts_instructionSysvarAccount, collateralFarmsAccounts_obligationFarmUserState, collateralFarmsAccounts_reserveFarmState, debtFarmsAccounts_obligationFarmUserState, debtFarmsAccounts_reserveFarmState, farmsProgram
args: liquidityAmount u64, minAcceptableReceivedLiquidityAmount u64, maxAllowedLtvOverridePercent u64
ix-flash_repay_reserve_liquidity
accounts: userTransferAuthority, lendingMarketAuthority, lendingMarket, reserve, reserveLiquidityMint, reserveDestinationLiquidity, userSourceLiquidity, reserveLiquidityFeeReceiver, referrerTokenState, referrerAccount, sysvarInfo, tokenProgram
args: liquidityAmount u64, borrowInstructionIndex u8
ix-flash_borrow_reserve_liquidity
accounts: userTransferAuthority, lendingMarketAuthority, lendingMarket, reserve, reserveLiquidityMint, reserveSourceLiquidity, userDestinationLiquidity, reserveLiquidityFeeReceiver, referrerTokenState, referrerAccount, sysvarInfo, tokenProgram
args: liquidityAmount u64
ix-request_elevation_group
accounts: owner, obligation, lendingMarket
args: elevationGroup u8
ix-init_referrer_token_state
accounts: payer, lendingMarket, reserve, referrer, referrerTokenState, rent, systemProgram
ix-init_user_metadata
accounts: owner, feePayer, userMetadata, referrerUserMetadata, rent, systemProgram
args: userLookupTable base58 string
ix-withdraw_referrer_fees
accounts: referrer, referrerTokenState, reserve, reserveLiquidityMint, reserveSupplyLiquidity, referrerTokenAccount, lendingMarket, lendingMarketAuthority, tokenProgram
ix-init_referrer_state_and_short_url
accounts: referrer, referrerState, referrerShortUrl, referrerUserMetadata, rent, systemProgram
args: shortUrl string
ix-delete_referrer_state_and_short_url
accounts: referrer, referrerState, shortUrl, rent, systemProgram
ix-set_obligation_order
accounts: owner, obligation, lendingMarket
args: index u8, order JSON string
ix-set_borrow_order
accounts: owner, obligation, lendingMarket, reserve, filledDebtDestination, debtLiquidityMint, instructionSysvarAccount, eventAuthority, program
args: orderConfig JSON string, minExpectedCurrentRemainingDebtAmount u64
ix-set_borrow_order_v2
accounts: owner, obligation, lendingMarket, reserve, filledDebtDestination, debtLiquidityMint, instructionSysvarAccount, eventAuthority, program
args: orderIdx u8, orderConfig JSON string, minExpectedCurrentRemainingDebtAmount u64
ix-update_obligation_config
accounts: owner, obligation, borrowReserve, depositReserve, lendingMarket
args: mode variant name, value binary
ix-rollover_fixed_term_borrow
accounts: rolloverAccounts_payer, rolloverAccounts_obligation, rolloverAccounts_lendingMarket, rolloverAccounts_lendingMarketAuthority, rolloverAccounts_sourceBorrowReserve, rolloverAccounts_targetBorrowReserve, rolloverAccounts_liquidityMint, rolloverAccounts_sourceBorrowReserveLiquidity, rolloverAccounts_targetBorrowReserveLiquidity, rolloverAccounts_tokenProgram, sourceFarmsAccounts_obligationFarmUserState, sourceFarmsAccounts_reserveFarmState, targetFarmsAccounts_obligationFarmUserState, targetFarmsAccounts_reserveFarmState, farmsProgram
ix-fill_borrow_order
accounts: borrowAccounts_payer, borrowAccounts_obligation, borrowAccounts_lendingMarket, borrowAccounts_lendingMarketAuthority, borrowAccounts_borrowReserve, borrowAccounts_borrowReserveLiquidityMint, borrowAccounts_reserveSourceLiquidity, borrowAccounts_borrowReserveLiquidityFeeReceiver, borrowAccounts_userDestinationLiquidity, borrowAccounts_referrerTokenState, borrowAccounts_tokenProgram, borrowAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram, eventAuthority, program
ix-fill_borrow_order_v2
accounts: borrowAccounts_payer, borrowAccounts_obligation, borrowAccounts_lendingMarket, borrowAccounts_lendingMarketAuthority, borrowAccounts_borrowReserve, borrowAccounts_borrowReserveLiquidityMint, borrowAccounts_reserveSourceLiquidity, borrowAccounts_borrowReserveLiquidityFeeReceiver, borrowAccounts_userDestinationLiquidity, borrowAccounts_referrerTokenState, borrowAccounts_tokenProgram, borrowAccounts_instructionSysvarAccount, farmsAccounts_obligationFarmUserState, farmsAccounts_reserveFarmState, farmsProgram, eventAuthority, program
args: orderIdx u8
ix-initiate_obligation_ownership_transfer
accounts: owner, obligation, instructionSysvarAccount
args: newOwner base58 string
ix-approve_obligation_ownership_transfer
accounts: globalAdmin, globalConfig, obligation, pendingOwner, instructionSysvarAccount
ix-accept_obligation_ownership
accounts: pendingOwner, obligation, instructionSysvarAccount
ix-abort_obligation_ownership_transfer
accounts: owner, obligation, instructionSysvarAccount
ix-enqueue_to_withdraw
accounts: owner, lendingMarket, lendingMarketAuthority, reserve, userSourceCollateralTa, userDestinationLiquidityTa, reserveLiquidityMint, reserveCollateralMint, collateralTokenProgram, withdrawTicket, ownerQueuedCollateralVault, systemProgram, progressCallbackCustomAccount0, progressCallbackCustomAccount1, instructionSysvarAccount
args: collateralAmount u64, progressCallbackType variant name
ix-withdraw_queued_liquidity
accounts: payer, lendingMarket, lendingMarketAuthority, reserve, reserveLiquidityMint, reserveCollateralMint, reserveLiquiditySupply, ownerQueuedCollateralVault, userDestinationLiquidity, collateralTokenProgram, liquidityTokenProgram, withdrawTicket, withdrawTicketOwner, associatedTokenProgram, systemProgram, progressCallbackProgram, progressCallbackCustomAccount0, progressCallbackCustomAccount1, instructionSysvarAccount
ix-recover_invalid_ticket_collateral
accounts: payer, lendingMarket, lendingMarketAuthority, reserve, reserveCollateralMint, ownerQueuedCollateralVault, userSourceCollateral, collateralTokenProgram, withdrawTicket, withdrawTicketOwner, instructionSysvarAccount
args: ticketSequenceNumber u64
ix-cancel_withdraw_ticket
accounts: owner, lendingMarket, lendingMarketAuthority, reserve, reserveCollateralMint, ownerQueuedCollateralVault, userDestinationCollateral, collateralTokenProgram, withdrawTicket
args: ticketSequenceNumber u64, collateralAmountToCancel u64
ix-init_global_config
accounts: payer, globalConfig, programData, systemProgram, rent, instructionSysvarAccount
ix-update_global_config
accounts: globalAdmin, globalConfig, instructionSysvarAccount
args: mode variant name, value binary
ix-update_global_config_admin
accounts: pendingAdmin, globalConfig, instructionSysvarAccount
ix-idl_missing_types
accounts: signer, globalConfig, lendingMarket, reserve, instructionSysvarAccount
args: reserveFarmKind variant name, feeCalculation variant name, reserveStatus variant name, updateConfigMode variant name, updateLendingMarketConfigValue JSON string, updateLendingMarketConfigMode variant name

Files are split at 2 GB: ix-<name>-tNN-SSSS.parquet. Large integers stay exact: u128 is a decimal string. All decoded types.

Get Kamino Lending data for your range.

Select an epoch range and get a firm price. You pay only when you send the job.

Get a price