Reference
Hook schema
Every field of a hook, in the form you write for defineHook and in the form the Pook program stores, with the rule the program applies to each value when the hook is published and when it runs. Hooks says what each part is for.
The definition
defineHook(definition) checks a definition against the HookDraft schema and returns it frozen. pook.publishHook({ hook }) takes the result. A key the schema does not name is refused. The one key defineHook takes beside the schema's is notes, an array of strings kept on the definition and left out of what is published. Write a hook walks through one from start to finish.
A definition has two layers. The descriptive fields name every argument and account of the instruction, and the API returns them with the hook. The on-chain fields are the exact values the program stores. When an on-chain field is absent, it is derived from the descriptive fields by the mapping below.
In this page, hex means an even-length string of hex digits with no 0x prefix, and an address is base58 of 32 bytes.
Descriptive fields
| Field | Type | Required | Meaning |
|---|---|---|---|
id | string, 2 to 48 characters | yes | The hook id, such as jupiter.swap. Stored on chain. |
protocol | string, 1 to 32 | yes | The protocol's short name, such as jupiter. The registry filters by it. |
protocolName | string, 1 to 64 | yes | The protocol's name as shown, such as Jupiter. |
label | string, 1 to 64 | yes | The action's name, such as Swap. |
description | string, 1 to 280 | yes | One or two sentences on what a run does. |
kind | flow or seat | yes | The kind. Stored on chain. |
targetProgram | address | yes | The program the hook calls. Stored on chain. |
instructionName | string, 1 to 64 | yes | The instruction's name in the target program. |
discriminator | hex, up to 256 bytes | yes | The instruction's leading bytes. |
dataTemplate | object | yes | The instruction data with named slots. |
accountsTemplate | array, 1 to 48 entries | yes | The instruction's accounts, each with a role. |
companionInstructions | array, up to 8 entries | no | Instructions that must be in the same transaction. |
formFields | array, up to 16 entries | no | The inputs of the run screen. See Form fields. |
mintIn | address or null | yes | The one mint going in, or null when the run chooses. |
mintOut | address or null | yes | The one mint coming out, or null when the run chooses. |
assetInSymbol | string up to 24, or null | no | The symbol shown for the asset in. |
assetOutSymbol | string up to 24, or null | no | The symbol shown for the asset out. |
dataTemplate
| Field | Type | Required | Meaning |
|---|---|---|---|
baseHex | hex, up to 256 bytes | yes | The instruction data as the target program expects it, with zero bytes where a slot writes. |
slots | array, up to 16 entries | yes | The values that change from run to run, in the order they are applied. |
Each entry of slots:
| Field | Type | Required | Meaning |
|---|---|---|---|
name | string, 1 to 64 | yes | The argument's name in the instruction. |
kind | slot kind | yes | Where the value comes from. |
offset | integer, 0 to 256 | yes | The byte position in the data. |
length | integer, 0 to 256 | yes | The number of bytes. |
type | slot type | yes | How the bytes are read. |
label | string up to 64 | no | The name shown for the value. |
description | string up to 240 | no | A note on the value. |
The slot kinds, with the on-chain kind each becomes:
| Kind | Type | Meaning |
|---|---|---|
amount_in | AmountInU64Le | The run’s amount in. |
min_out | MinOutU64Le | The run’s minimum out. |
caller_arg | CallerSlice or CallerTail | A value the caller supplies at run time. |
seat_arg | CallerSlice or CallerTail | A value the caller supplies for a seat action. |
The slot types:
| Type | Type | Meaning |
|---|---|---|
u8 | 1 byte | Unsigned integer. |
u16 | 2 bytes | Unsigned integer, little-endian. |
u32 | 4 bytes | Unsigned integer, little-endian. |
u64 | 8 bytes | Unsigned integer, little-endian. |
u128 | 16 bytes | Unsigned integer, little-endian. |
bool | 1 byte | 0 or 1. |
pubkey | 32 bytes | An address. |
bytes | length | Raw bytes. With length 0 on a caller slot, the slot becomes a caller tail. |
accountsTemplate
One entry per account, in the order the target program reads them.
| Field | Type | Required | Meaning |
|---|---|---|---|
index | integer, 0 to 47 | yes | The account's position in the instruction. |
name | string, 1 to 64 | yes | The account's name in the instruction. |
role | role | yes | Who supplies the account. |
address | address or null | no | The address, for the roles that fix one. |
writable | boolean | yes | Whether the target program writes to it. |
signer | boolean | yes | Whether it signs the call. |
description | string up to 240 | no | A note on the account. |
The roles, with the on-chain kind each becomes:
| Role | Type | Meaning |
|---|---|---|
fixed | Fixed | One address written into the hook. Set it in address. |
stage_authority | StagePda | Pook’s stage, the address that signs the call. |
stage_in | StageIn | The stage’s account holding the run’s amount in. |
stage_out | StageOut | The stage’s account the result arrives in. |
seat_pda | SeatPda | The seat. Seat hooks only. |
caller_supplied | Caller | One account the caller supplies at run time. |
program | Fixed | A program the instruction names, such as the token program. Set it in address. |
sysvar | Fixed | A sysvar the instruction names. Set it in address. |
payer | Payer | The relayer. Seat hooks only. |
companionInstructions
| Field | Type | Required | Meaning |
|---|---|---|---|
programId | address | yes | The program the companion instruction belongs to. |
instructionName | string, 1 to 64 | yes | The instruction's name. |
discriminator | hex, up to 8 bytes | yes | The leading bytes of the instruction's data. |
position | before or after | yes | before when it has to come ahead of the run. |
description | string up to 240 | no | A note on what it does. |
On-chain fields
Each of these is optional. One that is present is published as written and replaces its own derivation. The others are still derived.
| Field | Type | Meaning |
|---|---|---|
mintInConstraint | { kind: 'None' }, { kind: 'Any' }, { kind: 'Sol' } or { kind: 'Spl', mint } | The mint constraint on the asset in. |
mintOutConstraint | the same | The mint constraint on the asset out. |
wrapSolIn | boolean | Wrap SOL going in. false when absent. |
unwrapSolOut | boolean | Unwrap wrapped SOL coming out. false when absent. |
dataTemplateHex | hex, up to 256 bytes | The data template's bytes. |
dataSlots | array, up to 16 entries | Each { offset, len, kind }, with offset and len integers from 0 to 256 and kind a data slot kind. |
accountSlots | array, up to 48 entries | Each { kind, isWritable, isSigner, pubkey }, with kind an account slot kind. pubkey is the System program's address when absent. |
companions | array, up to 8 entries | Each { programId, discriminatorHex, discLen, mustPrecede }, with discriminatorHex up to 8 bytes and discLen from 0 to 8. See Companions. |
From descriptive to on-chain
| On-chain value | Taken from | Rule |
|---|---|---|
hook_id | id | Copied. |
target_program | targetProgram | Copied. |
kind | kind | flow becomes Flow, seat becomes Seat. |
mint_in | mintInConstraint, else mintIn | null becomes Any. The wrapped SOL mint or the System program's address becomes Sol. Any other address becomes Spl with that mint. |
mint_out | mintOutConstraint, else mintOut | The same rule. |
wrap_sol_in | wrapSolIn | false when absent. |
unwrap_sol_out | unwrapSolOut | false when absent. |
data_template | dataTemplateHex, else dataTemplate.baseHex | The hex decoded to bytes. |
data_slots | dataSlots, else dataTemplate.slots | One slot per entry, in array order. offset is copied and length becomes len. Kind amount_in becomes AmountInU64Le. Kind min_out becomes MinOutU64Le. Any other kind becomes CallerTail when its type is bytes and its length is 0, and CallerSlice otherwise. |
account_slots | accountSlots, else accountsTemplate | One slot per entry, in array order. writable becomes is_writable, signer becomes is_signer, and address becomes pubkey, or the System program's address when there is none. Role stage_authority becomes StagePda, stage_in becomes StageIn, stage_out becomes StageOut, seat_pda becomes SeatPda, payer becomes Payer. Roles fixed, program and sysvar become Fixed. caller_supplied becomes Caller. |
companions | companions, else companionInstructions | programId is copied. discriminator becomes the discriminator bytes. disc_len is the discriminator's length in bytes, 8 at most. must_precede is true when position is before. |
Three values come only from the on-chain fields: a None constraint, a CallerRemaining slot, and a wrap or unwrap flag set to true.
The schema holds a definition to the limits the program enforces: an id of 48 UTF-8 bytes, a template of 256 bytes, 16 data slots, 48 account slots and 8 companions.
The record on chain
A hook is one account owned by the Pook program. publish_hook creates it and the author pays its rent. Program lists the instruction's accounts and errors.
The hook address
The address is derived from the seeds [b"hook", hook_id_hash] under the Pook program. hook_id_hash is the SHA-256 of the id's UTF-8 bytes with the first byte set to 0. The same id always gives the same address, and publishing an id that already has an account fails with HookAlreadyPublished.
The hook id
An id uses lowercase a-z, 0-9, ., _ and -. It starts and ends with a letter or a digit and has at least 2 characters. The program stores up to 48 bytes.
publish_hook arguments
The instruction data is the tag byte 2, then these fields in order. Integers are little-endian. A boolean is one byte, 0 or 1. A list is a 4-byte count followed by its entries.
| Field | Encoding | Limit |
|---|---|---|
hook_id | 4-byte length, then UTF-8 bytes | 1 to 48 bytes |
target_program | 32 bytes | |
kind | 1 byte | 0 or 1 |
mint_in | 1 tag byte, then 32 bytes when the tag is 3 | |
mint_out | the same | |
wrap_sol_in | 1 byte | |
unwrap_sol_out | 1 byte | |
data_template | 4-byte length, then the bytes | up to 256 bytes |
data_slots | list of 5-byte entries | up to 16 |
account_slots | list of 35-byte entries | up to 48 |
companions | list of 42-byte entries | up to 8 |
A data slot entry:
| Field | Encoding |
|---|---|
offset | 2 bytes |
len | 2 bytes |
kind | 1 byte, the data slot kind's tag |
An account slot entry:
| Field | Encoding |
|---|---|
kind | 1 byte, the account slot kind's tag |
is_writable | 1 byte |
is_signer | 1 byte |
pubkey | 32 bytes. Read for Fixed slots. |
A companion entry:
| Field | Encoding |
|---|---|
program_id | 32 bytes |
discriminator | 8 bytes, padded with zeros |
disc_len | 1 byte, 0 to 8 |
must_precede | 1 byte |
The Hook account
The account holds the same values with four fields the program adds. decodeHookAccount from @pook/contract reads it.
| Field | Encoding | Meaning |
|---|---|---|
discriminator | 8 bytes | The ASCII bytes PKHOOK01. |
hook_id_hash | 32 bytes | The hash the address is derived from. |
hook_id | 4-byte length, then UTF-8 bytes | The id. |
author | 32 bytes | The wallet that signed publish_hook. |
target_program | 32 bytes | As published. |
kind | 1 byte | As published. |
mint_in | 1 or 33 bytes | As published. |
mint_out | 1 or 33 bytes | As published. |
wrap_sol_in | 1 byte | As published. |
unwrap_sol_out | 1 byte | As published. |
data_template | 4-byte length, then the bytes | As published. |
data_slots | list | As published. |
account_slots | list | As published. |
companions | list | As published. |
bump | 1 byte | The bump of the hook address. |
What publish refuses
publish_hook fails with InvalidHookDefinition when any of these holds:
hook_idis empty or longer than 48 bytes.data_templateis longer than 256 bytes, or there are more than 16 data slots, 48 account slots or 8 companions.target_programis the Pook program, the Solana Privacy Program, the System program or the upgradeable loader.kindisFlowandmint_inisNone.- A
SeatPdaorPayerslot is in a hook whose kind isFlow. - A
Fixed,StageIn,StageOut,CallerorCallerRemainingslot hasis_signerset. - There is more than one
CallerRemainingslot. - A companion's
disc_lenis above 8.
It fails with InvalidHookAccount when the hook account passed is not the address derived from the id. Slot offsets are checked against the data when the hook runs.
Kind
| Kind | Type | Meaning |
|---|---|---|
flow | tag 0 | The stage signs the call. Every run sends an amount in. |
seat | tag 1 | The stage and the seat both sign the call. A run sends an amount in, or none. |
A run states its own kind, and it has to fit the hook's. A flow hook takes a Flow run with an amount in above 0. A seat hook takes a SeatFund run with an amount in above 0, or a SeatAction run with an amount in of 0. A run kind the hook does not take fails with WrongHookKind, and an amount in that does not fit the run kind fails with InvalidInstructionData.
The kind also decides who owns the stage's token accounts. In a flow hook they are the stage address's associated token accounts. In a seat hook they are the seat's associated token accounts. The program measures each account by its change during the run, so a balance already there counts neither as the result nor as unused input. Runs and Seats cover the rest.
Mint constraints
mint_in and mint_out each hold one constraint. The run names its own mint in and mint out, and each is checked against the hook's constraint before any funds move. A mismatch fails with MintConstraintViolated.
| Constraint | Type | Meaning |
|---|---|---|
None | tag 0 | No asset on this side. The run must carry none: an amount in of 0 for mint in, no mint out for mint out. |
Any | tag 1 | Any mint, SOL included. The run must carry an asset on this side and chooses which. |
Sol | tag 2 | Native SOL only. The run’s mint must be the 32 zero bytes that stand for SOL. |
Spl | tag 3 + 32 bytes | One named SPL or Token-2022 mint. The run’s mint must equal it. |
A run has an asset in when its amount in is above 0. A run names SOL and wrapped SOL the same way, as 32 zero bytes: toProgramMintBytes from @pook/contract gives them for either mint.
A run with an amount in names an output owner, also when the hook's mint out is None. Whatever part of the amount in the target program leaves in the stage's account goes back to that owner as a note. When StageIn and StageOut are the same account, that part is counted in the result.
The run's minimum out comes from the hook's resolver. For a hook that has none, the caller sends minimumOut in the quote request, and a quote for a hook with a mint out is refused without it.
Data slot kinds
At run time the program copies data_template, then applies the data slots in the order they are stored. The caller's data is one byte string sent with the run. CallerSlice and CallerTail read it from the front, each starting where the last one stopped.
| Kind | Type | Meaning |
|---|---|---|
AmountInU64Le | tag 0 | Writes the run’s amount in as 8 bytes, little-endian, at offset. len is not read. Fails with DataSlotOutOfBounds when offset + 8 is past the end of the data. |
MinOutU64Le | tag 1 | Writes the run’s minimum out as 8 bytes, little-endian, at offset. len is not read. Fails with DataSlotOutOfBounds when offset + 8 is past the end of the data. |
CallerSlice | tag 2 | Copies the next len bytes of the caller’s data to offset. Fails with DataSlotOutOfBounds when the caller’s data has fewer than len bytes left, or offset + len is past the end of the data. |
CallerTail | tag 3 | Appends every byte the caller’s data has left to the end of the data. offset is not read. A len above 0 is the most bytes the tail may hold, and a longer tail fails with DataSlotOutOfBounds. A len of 0 sets no maximum. |
When every slot has been applied, all of the caller's data must have been read. Bytes left over fail the run with InvalidInstructionData.
The resulting bytes are the data of the call to the target program, and they are part of what the proof fixes.
Account slot kinds
The accounts of the call are built from the account slots in the order they are stored. The run carries a list of caller accounts. Fixed, Caller and CallerRemaining slots take from it in order.
| Kind | Type | Meaning |
|---|---|---|
Fixed | tag 0 | Takes the next caller account. Its address must equal the slot’s pubkey, or the run fails with CallerAccountsMismatch. Passed with the slot’s writable flag. Cannot be a signer. |
StagePda | tag 1 | The stage address. Passed with the slot’s writable and signer flags. The program signs for it. |
StageIn | tag 2 | The stage account holding the amount in. Passed with the slot’s writable flag. Cannot be a signer. A run with no amount in fails with CallerAccountsMismatch. |
StageOut | tag 3 | The stage account the result arrives in. Passed with the slot’s writable flag. Cannot be a signer. A run with no mint out fails with CallerAccountsMismatch. |
SeatPda | tag 4 | The seat’s address. Seat hooks only. Passed with the slot’s writable and signer flags. The program signs for it. |
Caller | tag 5 | Takes the next caller account, whatever its address. Passed with the slot’s writable flag. Cannot be a signer. |
CallerRemaining | tag 6 | Takes every caller account that is left, in order. One per hook. Each is writable or read-only by its own flag in the run. Cannot be a signer. |
Payer | tag 7 | The relayer, the account that pays for the transaction. Seat hooks only. Passed with the slot’s writable and signer flags. |
The run fails with CallerAccountsMismatch when:
- a
FixedorCallerslot finds no caller account left, - a
Fixedslot's account has another address, - the number of accounts a
CallerRemainingslot takes differs from the number of writable flags the run sent, - caller accounts are left over after the last slot.
The writable flags of a CallerRemaining slot are one byte per account, sent with the run: 0 for read-only, anything else for writable. The slot's own is_writable is not read.
What StageIn and StageOut resolve to
| The run's asset | StageIn | StageOut |
|---|---|---|
| An SPL or Token-2022 mint | The stage's associated token account for the mint in | The stage's associated token account for the mint out |
| SOL, with the wrap or unwrap flag set | The stage's wrapped SOL token account | The stage's wrapped SOL token account |
| SOL, with the flag clear | The stage address itself | The stage address itself |
The flag is wrap_sol_in for StageIn and unwrap_sol_out for StageOut. In a seat hook the token accounts are the seat's.
Accounts the program refuses to pass
An account taken by a Fixed, Caller or CallerRemaining slot fails the run with ForbiddenHookAccount when it is one of these:
- the Pook program or the Solana Privacy Program,
- Pook's authority address, the config account or the hook account,
- the run's output tree,
- the author's fee account, or its token account,
- the fee recipient's account for the run,
- the seat's state account,
- the Solana Privacy Program's vault account for an SPL mint out,
- the Solana Privacy Program's vault account the amount in is withdrawn from.
Companions
A companion names an instruction that must be in the same transaction as the run.
| Field | Meaning |
|---|---|
program_id | The program the instruction must belong to. |
discriminator | The bytes the instruction's data must start with. |
disc_len | How many of those bytes are compared, 0 to 8. With 0, any instruction of the program matches. |
must_precede | true when the instruction has to come before the run in the transaction. false when it can be anywhere in it. |
A hook with companions makes the run take the Instructions sysvar. The program reads the transaction's instructions from it and looks for each companion. One that is not found fails the run with MissingCompanionInstruction.
wrap_sol_in and unwrap_sol_out
Both flags act only when the run's asset on that side is native SOL.
| Flag | Set | Clear |
|---|---|---|
wrap_sol_in | The amount in is moved from the stage into its wrapped SOL token account before the call. StageIn is that token account. A part the target program leaves there is unwrapped before it goes back to the holder. | The amount in stays on the stage address as lamports. StageIn is the stage address. |
unwrap_sol_out | The result is measured as the rise in the wrapped SOL token account's balance. After the call the account is closed and the result becomes lamports. StageOut is that token account. | The result is measured as the rise in the stage address's lamports. StageOut is the stage address. |
With unwrap_sol_out set, the wrapped SOL token account's rent goes back to the relayer when the account is closed.
Form fields
formFields describes the inputs of the run screen for a hook. Each entry is one input, and its kind decides which field of the quote request the value is sent in.
| Field | Type | Required | Meaning |
|---|---|---|---|
name | string, 1 to 64 | yes | The input's name. For text and integer it is the key the value is sent under. |
kind | form field kind | yes | The kind of input. |
label | string, 1 to 64 | yes | The label shown above the input. |
required | boolean | yes | Whether a value is needed. |
defaultValue | string up to 128 | no | The starting value. |
placeholder | string up to 128 | no | The hint shown in an empty input. |
| Kind | Type | Meaning |
|---|---|---|
asset_in | mintIn | A choice of the asset going in. Shown when the hook does not name one mint in. |
asset_out | mintOut | A choice of the asset coming out. Shown when the hook does not name one mint out. |
amount | amountIn | Sets the label and placeholder of the amount input. The amount is sent in base units. |
slippage_bps | slippageBps | A choice of slippage in basis points. defaultValue is the starting choice, 50 when absent. |
seat | seatAddress | A choice among your open seats. When required is false, the choice includes opening a new seat. |
text | args[name] | A free input. Its value is sent under the field’s name. |
integer | args[name] | A numeric input. Its value is sent under the field’s name. |
A seat field with required set to true makes the run act on an open seat. With required set to false, a run with no seat chosen opens one first.
The launch hooks
Pook published nine hooks at launch. jupiter.swap as a definition:
import { SYSTEM_PROGRAM_ID } from '@pook/contract'
import { defineHook } from '@pook/sdk'
export const jupiterSwapHook = defineHook({
id: 'jupiter.swap',
protocol: 'jupiter',
protocolName: 'Jupiter',
label: 'Swap',
description: 'One asset in, another out, at Jupiter’s route.',
kind: 'flow',
targetProgram: 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4',
instructionName: 'route_v2',
discriminator: 'bb64facc31c4af14',
mintInConstraint: { kind: 'Any' },
mintOutConstraint: { kind: 'Any' },
wrapSolIn: true,
unwrapSolOut: true,
dataTemplateHex: '',
dataSlots: [{ offset: 0, len: 0, kind: 'CallerTail' }],
accountSlots: [
{ kind: 'Caller', isWritable: false, isSigner: false, pubkey: SYSTEM_PROGRAM_ID },
{ kind: 'StagePda', isWritable: false, isSigner: true, pubkey: SYSTEM_PROGRAM_ID },
{ kind: 'StageIn', isWritable: true, isSigner: false, pubkey: SYSTEM_PROGRAM_ID },
{ kind: 'StageOut', isWritable: true, isSigner: false, pubkey: SYSTEM_PROGRAM_ID },
{ kind: 'CallerRemaining', isWritable: false, isSigner: false, pubkey: SYSTEM_PROGRAM_ID },
],
companions: [],
dataTemplate: {
baseHex: '',
slots: [
{ name: 'routeData', kind: 'caller_arg', offset: 0, length: 0, type: 'bytes', label: 'Jupiter route instruction payload' },
],
},
accountsTemplate: [
{ index: 0, name: 'tokenProgram', role: 'caller_supplied', writable: false, signer: false },
{ index: 1, name: 'userTransferAuthority', role: 'stage_authority', writable: false, signer: true },
{ index: 2, name: 'userSourceTokenAccount', role: 'stage_in', writable: true, signer: false },
{ index: 3, name: 'userDestinationTokenAccount', role: 'stage_out', writable: true, signer: false },
{ index: 4, name: 'routeAccounts', role: 'caller_supplied', writable: false, signer: false },
],
mintIn: null,
mintOut: null,
})The on-chain fields are what is stored: an empty template and one CallerTail slot, so the whole of route_v2's data comes from the hook's resolver, and the route's accounts arrive through CallerRemaining. dataTemplate and accountsTemplate name the same slots for the API to return with the hook.
The other eight, as stored on chain. The programs they call:
| Hook | Kind | Target program | Instruction |
|---|---|---|---|
kamino.supply | Flow | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | deposit_reserve_liquidity |
kamino.withdraw | Flow | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | redeem_reserve_collateral |
jito.stake | Flow | SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy | DepositSol |
jito.unstake | Flow | SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy | WithdrawSol |
kamino.collateral.deposit | Seat | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | deposit_reserve_liquidity_and_obligation_collateral_v2 |
kamino.borrow | Seat | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | borrow_obligation_liquidity_v2 |
kamino.repay | Seat | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | repay_obligation_liquidity_v2 |
kamino.collateral.withdraw | Seat | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD | withdraw_obligation_collateral_and_redeem_reserve_collateral_v2 |
Their assets and data. Every data template is the bytes shown followed by 8 zero bytes, and its one slot fills those 8 bytes.
| Hook | Mint in | Mint out | Wrap SOL in | Unwrap SOL out | Data template starts | Data slot | Account slots |
|---|---|---|---|---|---|---|---|
kamino.supply | Any | Any | yes | no | a9c91e7e06cd6644 | AmountInU64Le at 8 | 12 |
kamino.withdraw | Any | Any | no | yes | ea75b57db98edc1d | AmountInU64Le at 8 | 12 |
jito.stake | Sol | Spl JitoSOL | no | no | 0e | AmountInU64Le at 1 | 10 |
jito.unstake | Spl JitoSOL | Sol | no | no | 10 | AmountInU64Le at 1 | 12 |
kamino.collateral.deposit | Any | None | yes | no | d8e0bf1bcc9766af | AmountInU64Le at 8 | 15 |
kamino.borrow | None | Any | no | yes | a1808ff5abc7c206 | CallerSlice at 8, 8 bytes | 13 |
kamino.repay | Any | None | yes | no | 74aed54cb435d290 | AmountInU64Le at 8 | 10 |
kamino.collateral.withdraw | None | Any | no | yes | eb34779895c51407 | CallerSlice at 8, 8 bytes | 15 |
The JitoSOL mint is J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn. kamino.borrow and kamino.collateral.withdraw send no amount in, so the amount to borrow or withdraw is 8 bytes of caller data placed by the CallerSlice.
Their companions. Each is an instruction of the Kamino Lend program, compared on all 8 bytes, and has to come before the run.
| Hook | Companions |
|---|---|
kamino.supply | refresh_reserve (02da8aeb4fc91966) |
kamino.withdraw | refresh_reserve (02da8aeb4fc91966) |
jito.stake | none |
jito.unstake | none |
kamino.collateral.deposit | refresh_reserve (02da8aeb4fc91966), refresh_obligation (218493e497c04859) |
kamino.borrow | refresh_reserve, refresh_obligation |
kamino.repay | refresh_reserve, refresh_obligation |
kamino.collateral.withdraw | refresh_reserve, refresh_obligation |