Hidden1

For protocol teams

Nothing to change in your program. A hook is a public record, on chain, of one instruction you already ship.

What a hook pins

  • Your program id and the first bytes of the instruction's data (its discriminator).
  • The instruction's accounts in order: fixed addresses, the stage PDA where your user signs, and the stage's output account.
  • The account where the output lands, which the run measures.

A record is written once and cannot be edited. Registration is open to anyone: the author's wallet signs and pays, and its key is stored in the record. The program still refuses forbidden targets and protected accounts, and these lints run before anything is signed.

What your program sees

  • A normal call from another program (a cross-program invocation), signed by the stage PDA as the user.
  • The amount arrives in the stage's account before the call; your instruction moves it like any user's.
  • Instructions that refuse cross-program calls cannot be hooks. Instructions that need more than one signer cannot either: the stage is the only signer inside a run.

Draft a hook from your IDL

Paste a program id. The server reads the program's Anchor IDL account from mainnet, and for the instruction you pick shows where each argument sits in the data, which argument is the amount, which accounts the stage fills, and what would block it. These are real reads; errors are shown as they come back.

Try: Kamino LendJupiterMarinade

Read from chain: kamino_lending IDL (legacy), 66 instructions.

Program KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD Instruction deposit_reserve_liquidity_and_obligation_collateral_v2 Data prefix d8e0bf1bcc9766af Publishable yes

Arguments

NameTypeSizeOffsetRole
liquidity_amountu6488amountIn

Accounts

#NameWritableSignerRole in a run
0deposit_accounts.owneryesyesstage-signer
1deposit_accounts.obligationyesnofixed
2deposit_accounts.lending_marketnonofixed
3deposit_accounts.lending_market_authoritynonofixed
4deposit_accounts.reserveyesnofixed
5deposit_accounts.reserve_liquidity_mintnonofixed
6deposit_accounts.reserve_liquidity_supplyyesnofixed
7deposit_accounts.reserve_collateral_mintyesnofixed
8deposit_accounts.reserve_destination_deposit_collateralyesnofixed
9deposit_accounts.user_source_liquidityyesnostage-in
10deposit_accounts.placeholder_user_destination_collateralnonofixed
11deposit_accounts.collateral_token_programnonoprogram
12deposit_accounts.liquidity_token_programnonoprogram
13deposit_accounts.instruction_sysvar_accountnonoprogram
14farms_accounts.obligation_farm_user_stateyesnofixed
15farms_accounts.reserve_farm_stateyesnofixed
16farms_programnonoprogram

Lints

No lints.