Developers
Instructions
All nineteen instructions: their tag, arguments, who signs, and what each one checks before it changes anything.
Instruction data is one tag byte followed by Borsh-encoded arguments: little-endian integers, booleans as one byte. The SDK builds every one of them with the right accounts; the account lists here are in the SDK's source under instructions.ts.
Lending
| Tag | Instruction | Arguments | Signer | Checks |
|---|---|---|---|---|
| 2 | deposit | amount: u64, min_shares: u64 | Lender | Pool not paused, shares ≥ min_shares |
| 3 | withdraw | shares: u64, min_usdc: u64 | Lender | Enough pool cash, USDC ≥ min_usdc |
Credit accounts
| Tag | Instruction | Arguments | Signer | Checks |
|---|---|---|---|---|
| 4 | open | collateral: u64, borrow: u64 | Owner | Not paused, pool cash ≥ borrow, health ≥ 1.10 after |
| 5 | add_collateral | asset: u8 (0 USDC, 1 SOL), amount: u64 | Owner | No move in progress |
| 12 | borrow | amount: u64 | Owner | Not paused, pool cash, health ≥ 1.10 after |
| 6 | repay | amount: u64 | Anyone | No move in progress; charges at most amount |
| 11 | release | asset: u8 (0–3), amount: u64 | Owner | Debt is zero, no move in progress |
Moves
| Tag | Instruction | Arguments | Signer | Checks |
|---|---|---|---|---|
| 7 | begin | nonce: u64, mode: u8, end_index: u16 | Owner, or anyone for mode 2 | Matching end, only adapter steps between, mode 2 only below 1.00 |
| 8 | adapter | nonce: u64, action: u8, amount: u64, limit_a: u64, limit_b: u64 | Same as begin | Inside the active move; not paused unless unwinding; limits met |
| 9 | end | nonce: u64, withdraw_usdc: u64, withdraw_wsol: u64, write_off: bool | Same as begin | By mode: see below |
end by mode:
- 0, move. Sends the withdrawals to the owner, then requires health ≥ 1.10.
- 1, close. No withdrawals or write-off, no receipts left; repays the whole debt and sends all remaining USDC and SOL to the owner.
- 2, liquidation. No withdrawals; repays up to the account's USDC × 10,000 ÷ 10,500 and pays the liquidator 5% of it. With
write_off, requires no receipts left and writes off what remains unpaid. Otherwise, if debt remains, collateral ÷ debt may not have fallen.
Adapter actions
| Action | Target call | amount | limit_a | limit_b | Modes |
|---|---|---|---|---|---|
| 0 | Save deposit | USDC in | Least receipts out | Must be 0 | 0 |
| 1 | Save redeem | Receipts in | Least USDC out | Must be 0 | 0, 1, 2 |
| 2 | Orca deposit | LP tokens out | Most USDC in | Most SOL in | 0 |
| 3 | Orca withdraw | LP tokens in, fee included | Least USDC out | Least SOL out | 0, 1, 2 |
Redeeming a whole dust balance may return zero USDC only when limit_a is zero; any other zero-output redemption fails.
Administration
| Tag | Instruction | Arguments | Signer | Checks |
|---|---|---|---|---|
| 0 | initialize_pool | base_bps, slope1_bps, slope2_bps, kink_bps: u16 | Program upgrade authority | Once; kink strictly between 0 and 10,000; top rate ≤ 300% |
| 1 | register_adapters | The 433-byte adapter config | Pool admin | Once; every account checked against the live targets |
| 10 | pause | paused: bool | Pool admin | Before the council exists |
| 13 | create_council | — | Pool admin | Once; YOKE has six decimals, a minted supply and no mint or freeze authority; the council becomes the pool admin |
Council and governance
| Tag | Instruction | Arguments | Signer | Checks |
|---|---|---|---|---|
| 14 | bond | amount: u64 | Owner | Moves YOKE into the council vault |
| 15 | unbond | amount: u64 | Owner | The bond holds no seat; at most what is bonded |
| 16 | set_seat | seat: u8, vacate: bool | Governance | Seat 0–4; the outgoing bond is released; the incoming bond holds no seat and at least 1,000,000 YOKE |
| 17 | council_pause | paused: bool | Three to five seated members | The council is the pool admin; each signer holds a seat, none twice |
| 18 | update_adapters | The 433-byte adapter config | Governance | Same custody mints; every account checked against the live targets |
Every instruction must be called directly by the transaction, except set_seat and update_adapters: SPL Governance runs those by CPI when a passed proposal executes.