Concepts
Hooks
A hook is a public record that describes one instruction of a program that already exists. It says which program to call, what bytes to send and which accounts to pass, with marked places where a run's own values go. Once a hook is published, that instruction can be called from a private balance. The program it describes is not changed and is not asked.
What a hook holds
A hook is one account owned by the Pook program. Anyone can read it. The registry shows every one.
| Part | What it is |
|---|---|
| Name | The id people run it by, such as jupiter.swap. Up to 48 bytes. The hook's address is derived from it, so a name can be published once. |
| Author | The wallet that published it. It earns the author's share of every run. |
| Target program | The program the hook calls. |
| Kind | flow for an action that completes in one run, seat for an action on a position that stays open. |
| Mint in, mint out | What may go in and what comes back: nothing, any mint, SOL, or one named mint. |
| Data template | The instruction's bytes, with slots. |
| Account slots | The instruction's accounts in order, each a slot. |
| Companions | Instructions that must be in the same transaction. |
| SOL handling | Whether SOL going in is wrapped first, and whether wrapped SOL coming out is unwrapped. |
The data template and its slots
The data template is the instruction data as the target program expects it, up to 256 bytes, with the values that change from run to run left blank. A data slot says where one of those values goes. A hook has up to 16.
| Slot | What the program writes there |
|---|---|
| Amount in | The run's amount in, as 8 bytes, little-endian. |
| Minimum out | The run's minimum out, as 8 bytes, little-endian. |
| Caller slice | The next bytes the caller supplied, at a fixed place and length. |
| Caller tail | Whatever the caller supplied after that, appended to the end. |
The first two are how Pook's promise reaches the protocol: the amount the proof fixed is the amount the protocol is told to take, and the minimum the proof fixed is the minimum the protocol is told to give. Caller slices and the tail carry values only the caller knows at run time, such as a swap's route.
Every byte the caller supplies must be used by a slot. Bytes left over fail the run.
Account slots
An instruction's accounts are listed in the order the target program reads them, up to 48. Each one is a slot of a kind, with its writable flag.
| Slot | The account passed |
|---|---|
| Fixed | One address written into the hook: a pool, a market, a program. |
| Stage | Pook's stage, the address that signs the call. |
| Stage in | The account holding the run's amount in. It belongs to the stage in a flow hook and to the seat in a seat hook. |
| Stage out | The account the result arrives in, owned the same way. |
| Seat | The seat. Seat hooks only. It can sign. |
| Payer | The relayer. Seat hooks only, for protocols that need someone to pay rent. |
| Caller | One account the caller supplies. |
| Caller remaining | All the accounts the caller supplies after that. One per hook. |
The stage and the seat sign through the program, and in a seat hook the relayer can be passed as a signer. Fixed accounts and accounts the caller supplies are never signers.
What a hook can reach
A hook's call is given the stage accounts, the seat if it is a seat hook, and whatever fixed and caller accounts it names. The stage receives one run's amount in, and the program counts only what changes in the stage during that run: the result goes to the holder, and so does any input the protocol left unused.
The program refuses to pass any of its own accounts to a hook's call. That covers the Pook program and its authority, the config, the hook account, the Solana Privacy Program and its tree and vault accounts, the fee accounts and the seat's state account. A hook cannot target the Pook program, the Solana Privacy Program, the System program or the upgradeable loader.
The authority that owns every holder's notes signs only the calls to the Solana Privacy Program. It is never an account of a hook's call.
So the most a hook's call can touch is the amount one run sent to the stage. After the call the program measures what came back, and less than the run's minimum out fails the whole transaction.
Flow hooks and seat hooks
A flow hook takes an asset and gives one back in the same run: a swap, a supply, a stake. It must name an asset in.
A seat hook acts on a position that stays open at the protocol. It names the seat among its accounts, and the run presents the note that commands that seat. Seats covers them.
The 9 hooks Pook published at launch:
| Hook | Type | Meaning |
|---|---|---|
jupiter.swap | flow | One asset in, another out, at Jupiter’s route. |
kamino.supply | flow | An asset in, its Kamino deposit token out. |
kamino.withdraw | flow | A Kamino deposit token in, the asset out. |
jito.stake | flow | SOL in, JitoSOL out. |
jito.unstake | flow | JitoSOL in, SOL out. |
kamino.collateral.deposit | seat | Collateral in. The first deposit opens a seat. |
kamino.borrow | seat | Borrows against a seat’s collateral. The borrowed asset comes out. |
kamino.repay | seat | An asset in, the seat’s debt down. |
kamino.collateral.withdraw | seat | Collateral out of a seat. |
Companions
Some protocols need other instructions beside the main one. Kamino wants its reserves refreshed in the same transaction before a deposit or a borrow.
A hook can name up to 8 companions: a program, the first bytes of the instruction's data, and whether it has to come before the run. The program checks that each one is in the transaction. Companions are permissionless instructions that the relayer adds to the transaction. The stage does not sign them.
Resolvers
A hook says where the caller's bytes and accounts go. A resolver finds them for one run. For jupiter.swap the resolver asks Jupiter's API for a route and turns it into the caller tail and the remaining accounts. For the Kamino and Jito hooks it derives them from chain state.
A quote runs the hook's resolver and returns the resolved call. That resolved call is what your proof fixes.
A published hook does not change
There is no instruction that edits or removes a hook. A proof names the hook by its address, so what a holder agreed to run is what runs.
A new version is a new hook under a new name. The old one stays in the registry and keeps working.