Overview
Build instructions with the TypeScript client or straight from the IDL. The jolt PDA owns both DLMM positions and is the sender of every DLMM call, so only the program can move LP liquidity.
| Value | State | |
|---|---|---|
| Program id | Hh6s9Mph1L8iC11KuJUtMEwwxv8RAn3v9uXVWB1q2JPt | Opening soon |
| DLMM program | LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo | Meteora DLMM |
| Client | program/client: PDAs, fetchers and builders for all 22 instructions | TypeScript |
| Price source | DLMM oracle TWAP over the jolt's window (twap_window_secs) | On chain |
On chain program instructions
Generated from the program IDL, so this table always matches the program. Accounts marked pda are derived by the client; nested dlmm.* accounts are the shared DLMM bundle the client resolves from the pool.
| Instruction | Accounts | Args |
|---|---|---|
post_joltProject. Checks the token, the pool and its oracle, prepays rent and the capacitor, pays the listing fee and escrows the token side. | project (signer, mut), config (mut) (pda), jolt (mut) (pda), mint, wsol_mint, lb_pair, oracle, vault_x (mut) (pda), vault_y (mut) (pda), project_token (mut), treasury (mut), token_program, system_program | args: PostJoltArgs |
deposit_solLP, while charging. SOL is wrapped into the jolt wSOL vault; never above the target depth. | lp (signer, mut), config (pda), jolt (mut) (pda), lp_position (mut) (pda), vault_y (mut), token_program, system_program | lamports: u64 |
withdraw_before_liveLP, while charging or after a cancel. Full refund, LP account closed. | lp (signer, mut), jolt (mut) (pda), lp_position (mut) (pda), vault_y (mut), unwrap (mut), wsol_mint, token_program, system_program | none |
cancel_joltProject while charging, or anyone after the deadline plus grace. | signer (signer), config (pda), jolt (mut) (pda) | none |
go_liveKeeper. Opens the bid position under the price with all LP SOL and the ask position above it with the token, only when spot is close to the TWAP. | keeper (signer, mut), config (pda), jolt (mut) (pda), dlmm.lb_pair (mut), dlmm.bitmap_ext (mut) (optional), dlmm.reserve_x (mut), dlmm.reserve_y (mut), dlmm.token_x_mint, dlmm.token_y_mint, dlmm.vault_x (mut), dlmm.vault_y (mut), dlmm.unwrap (mut), dlmm.event_authority, dlmm.oracle, dlmm.dlmm_program, dlmm.token_program, bid_position (signer, mut), ask_position (signer, mut), system_program, rent | expected_active_id: i32, max_slippage: u16 |
harvest_feesAnyone. Claims DLMM fees on both positions: bid fees to LPs, ask fees to the project. | payer (signer, mut), jolt (mut) (pda), dlmm.lb_pair (mut), dlmm.bitmap_ext (mut) (optional), dlmm.reserve_x (mut), dlmm.reserve_y (mut), dlmm.token_x_mint, dlmm.token_y_mint, dlmm.vault_x (mut), dlmm.vault_y (mut), dlmm.unwrap (mut), dlmm.event_authority, dlmm.oracle, dlmm.dlmm_program, dlmm.token_program, bid_position (mut), ask_position (mut), system_program | none |
claimLP. Streamed rent and harvested fees; after settlement also the final share, then the LP account closes. | lp (signer, mut), jolt (mut) (pda), lp_position (mut) (pda), mint, vault_x (mut), lp_token (mut) (pda), token_program, associated_token_program, system_program | none |
rebalanceKeeper. Moves LP SOL to a fresh bid position under the current active bin, with the same TWAP guard. | keeper (signer, mut), config (pda), jolt (mut) (pda), dlmm.lb_pair (mut), dlmm.bitmap_ext (mut) (optional), dlmm.reserve_x (mut), dlmm.reserve_y (mut), dlmm.token_x_mint, dlmm.token_y_mint, dlmm.vault_x (mut), dlmm.vault_y (mut), dlmm.unwrap (mut), dlmm.event_authority, dlmm.oracle, dlmm.dlmm_program, dlmm.token_program, bid_position (mut), new_bid_position (signer, mut), system_program, rent | expected_active_id: i32, max_slippage: u16 |
turnoverKeeper with an on chain depth check. Ends the jolt early when organic depth reaches the target. | keeper (signer), config (pda), jolt (mut) (pda), lb_pair, bid_position, ask_position | none |
measure_depthRead only, by simulation. Logs organic and total depth. | keeper (signer), config (pda), jolt (mut) (pda), lb_pair, bid_position, ask_position | none |
blow_fuseAnyone when both the spot price and the DLMM oracle TWAP over the window are below the floor (trigger 0); keeper for triggers 1 and 2. | signer (signer), config (pda), jolt (mut) (pda), lb_pair, oracle | trigger: u8 |
closeAnyone after the term ends. Moves the jolt to unwinding. | signer (signer), jolt (mut) (pda) | none |
unwindAnyone while unwinding. Removes all liquidity from one side and closes the position; the LP tokens are valued at the TWAP. | payer (signer, mut), jolt (mut) (pda), dlmm.lb_pair (mut), dlmm.bitmap_ext (mut) (optional), dlmm.reserve_x (mut), dlmm.reserve_y (mut), dlmm.token_x_mint, dlmm.token_y_mint, dlmm.vault_x (mut), dlmm.vault_y (mut), dlmm.unwrap (mut), dlmm.event_authority, dlmm.oracle, dlmm.dlmm_program, dlmm.token_program, position (mut), system_program | side: u8 |
settleAnyone after both sides are unwound. Loss, cover, bonus, refunds and the protocol fee. | signer (signer), config (pda), jolt (mut) (pda), treasury (mut) | none |
project_claimProject. Everything owed to the project so far. | project (signer, mut), jolt (mut) (pda), mint, vault_x (mut), project_token (mut) (pda), token_program, associated_token_program, system_program | none |
close_joltAnyone after every claim. Sweeps dust and closes the jolt account. | signer (signer), config (pda), jolt (mut) (pda), vault_x (mut), vault_y (mut), project (mut), project_token (mut), treasury (mut), token_program | none |
initialize_configProgram upgrade authority, once. Creates the config; the signer becomes admin and names the keeper. | admin (signer, mut), config (mut) (pda), program_data, system_program | params: ConfigParams, keeper: pubkey |
update_configAdmin. Changes the tunables (bounds checked) for jolts posted afterwards. | admin (signer), config (mut) (pda) | params: ConfigParams |
set_pausedAdmin. Pauses posts, deposits, go live and rebalance. Exits always work. | admin (signer), config (mut) (pda) | paused: bool |
propose_authorityAdmin. Step one of an admin (role 0) or keeper (role 1) handover. | admin (signer), config (mut) (pda) | role: u8, proposed: pubkey |
accept_authorityThe proposed key. Step two: it signs to take the role. | new_authority (signer), config (mut) (pda) | role: u8 |
migrate_configAdmin. Grows a config account written by an earlier program version to the current layout. | admin (signer, mut), config (mut) (pda), system_program | twap_window_secs: u32, max_twap_deviation_bins: u16, unwind_grace_secs: u32 |
Accounts
Program owned accounts with their seeds and fields (Borsh, after the 8 byte discriminator).
Config
Seeds ["config"]. Admin, keeper and treasury, pending handovers, fees, bounds, the TWAP window and the pause flag.
| Field | Type |
|---|---|
admin | pubkey |
treasury | pubkey |
keeper | pubkey |
rent_fee_bps | u16 |
listing_fee | u64 |
turnover_bonus_bps | u16 |
min_cover_bps | u16 |
min_term_secs | u64 |
max_term_secs | u64 |
min_depth | u64 |
max_depth | u64 |
min_fill_bps | u16 |
max_charge_secs | u64 |
cancel_grace_secs | u64 |
min_deposit | u64 |
max_bins_per_side | u16 |
paused | bool |
jolt_count | u64 |
bump | u8 |
pending_admin | pubkey |
pending_keeper | pubkey |
twap_window_secs | u32 |
max_twap_deviation_bins | u16 |
unwind_grace_secs | u32 |
version | u8 |
Jolt
Seeds ["jolt", id u64 le]. One rental: terms, times, escrow, LP accumulators, the two DLMM positions, the oracle snapshot and the settlement figures.
| Field | Type |
|---|---|
id | u64 |
bump | u8 |
vault_x_bump | u8 |
vault_y_bump | u8 |
status | JoltStatus |
end_reason | EndReason |
fuse_trigger | u8 |
project | pubkey |
mint | pubkey |
lb_pair | pubkey |
vault_x | pubkey |
vault_y | pubkey |
depth_target | u64 |
term_secs | u64 |
apr_bps | u16 |
cover_bps | u16 |
floor_bin | i32 |
turnover_depth | u64 |
depth_range_bps | u16 |
depth_bins | u32 |
bid_bins | u16 |
ask_bins | u16 |
bin_step | u16 |
rent_fee_bps | u16 |
turnover_bonus_bps | u16 |
min_fill_bps | u16 |
posted_at | i64 |
charge_deadline | i64 |
live_at | i64 |
ends_at | i64 |
ended_at | i64 |
rent_prepaid | u64 |
rent_total | u64 |
rent_accrued | u64 |
capacitor | u64 |
token_amount | u64 |
total_shares | u64 |
lp_count | u32 |
lp_closed | u32 |
acc_rent_per_share | u128 |
acc_fee_x_per_share | u128 |
acc_fee_y_per_share | u128 |
lp_idle_y | u64 |
lp_idle_x | u64 |
project_idle_x | u64 |
bid_position | pubkey |
bid_lower | i32 |
bid_upper | i32 |
ask_position | pubkey |
ask_lower | i32 |
ask_upper | i32 |
bid_open | bool |
ask_open | bool |
lp_out_y | u64 |
lp_out_x | u64 |
ask_out_y | u64 |
ask_out_x | u64 |
settle_active_id | i32 |
lp_value | u64 |
lp_loss | u64 |
cover_paid | u64 |
rent_bonus | u64 |
rent_refund | u64 |
lp_settle_sol | u64 |
lp_settle_x | u64 |
project_claim_sol | u64 |
project_claim_x | u64 |
protocol_fee_owed | u64 |
protocol_fee_paid | u64 |
lp_paid_sol | u64 |
lp_paid_x | u64 |
oracle | pubkey |
twap_window_secs | u32 |
max_twap_deviation_bins | u16 |
unwind_grace_secs | u32 |
settle_spot_id | i32 |
settle_twap_secs | u32 |
LpPosition
Seeds ["lp", jolt, owner]. One LP: deposit (its shares), reward debts and claimed totals. It is the receipt.
| Field | Type |
|---|---|
owner | pubkey |
jolt | pubkey |
deposited | u64 |
rent_debt | u128 |
fee_x_debt | u128 |
fee_y_debt | u128 |
rent_claimed | u64 |
fee_sol_claimed | u64 |
fee_x_claimed | u64 |
settled | bool |
bump | u8 |
Events
Every state change emits an Anchor event in the transaction logs; decode them with the IDL (EventParser).
| Event | Fields |
|---|---|
AuthorityAccepted | role: u8, previous: pubkey, new: pubkey |
AuthorityProposed | role: u8, current: pubkey, proposed: pubkey |
ConfigInitialized | admin: pubkey, treasury: pubkey, keeper: pubkey |
ConfigUpdated | admin: pubkey, treasury: pubkey, rent_fee_bps: u16, listing_fee: u64, twap_window_secs: u32, max_twap_deviation_bins: u16 |
FeesHarvested | jolt: pubkey, lp_fee_x: u64, lp_fee_y: u64, project_fee_x: u64, project_fee_y: u64 |
JoltCancelled | jolt: pubkey |
JoltClosed | jolt: pubkey, token_dust: u64, lamports_to_treasury: u64 |
JoltFuseBlown | jolt: pubkey, trigger: u8, active_id: i32, floor_bin: i32, twap_bin: i32, twap_secs: i64 |
JoltLive | jolt: pubkey, filled: u64, rent_total: u64, rent_refund: u64, active_id: i32, bid_lower: i32, bid_upper: i32, ask_lower: i32, ask_upper: i32, sol_in_bins: u64, token_in_bins: u64, ends_at: i64 |
JoltPosted | jolt: pubkey, id: u64, project: pubkey, mint: pubkey, lb_pair: pubkey, depth_lamports: u64, term_secs: u64, apr_bps: u16, rent_prepaid: u64, capacitor: u64, token_amount: u64, floor_bin: i32, charge_deadline: i64 |
JoltSettled | jolt: pubkey, reason: u8, lp_value: u64, lp_loss: u64, cover_paid: u64, rent_bonus: u64, rent_refund: u64, lp_settle_sol: u64, lp_settle_x: u64, project_sol: u64, project_x: u64, protocol_fee: u64 |
JoltTermEnded | jolt: pubkey |
JoltTurnover | jolt: pubkey, organic_depth: u64, unused_rent: u64 |
PauseSet | admin: pubkey, paused: bool |
PositionUnwound | jolt: pubkey, side: u8, out_x: u64, out_y: u64, fee_x: u64, fee_y: u64, spot_id: i32, valuation_id: i32 |
ProjectClaimed | jolt: pubkey, sol: u64, x: u64 |
Rebalanced | jolt: pubkey, old_lower: i32, old_upper: i32, new_lower: i32, new_upper: i32, sol_in_bins: u64, idle_x: u64 |
RentClaimed | jolt: pubkey, lp: pubkey, rent: u64, fee_sol: u64, fee_x: u64, settle_sol: u64, settle_x: u64 |
SolDeposited | jolt: pubkey, lp: pubkey, lamports: u64, total_filled: u64 |
SolWithdrawn | jolt: pubkey, lp: pubkey, lamports: u64 |
Program errors
Custom error codes of the program, as returned in failed transactions and simulations. The app maps each one to a plain sentence before you sign.
| Code | Name | Message |
|---|---|---|
| 6000 | InvalidParams | A parameter is missing or out of range |
| 6001 | JoltNotCharging | The jolt is not taking LP deposits right now |
| 6002 | CoverTooLow | The capacitor is below the minimum cover ratio for posting |
| 6003 | TokenNotEligible | Mint or freeze authority is live, or the token program is not supported |
| 6004 | PoolNotEligible | The DLMM pool is not a <token>/wSOL pair for this mint or is not enabled |
| 6005 | Paused | Protocol is paused |
| 6006 | UnauthorizedKeeper | Signer is not the keeper |
| 6007 | UnauthorizedAdmin | Signer is not the admin |
| 6008 | UnauthorizedProject | Signer is not the project |
| 6009 | UnauthorizedOwner | Signer is not the position owner |
| 6010 | JoltNotLive | The jolt is not live |
| 6011 | JoltNotUnwinding | The jolt is not unwinding |
| 6012 | JoltNotSettled | The jolt is not settled |
| 6013 | NotFilled | The jolt cannot go live yet: not filled and the charge deadline has not passed |
| 6014 | BelowMinFill | The jolt reached the deadline below the minimum fill |
| 6015 | DepthExceeded | Deposit would exceed the target depth |
| 6016 | TermNotEnded | The term has not ended yet |
| 6017 | FuseNotTriggered | The fuse condition is not met |
| 6018 | TurnoverNotReached | Organic depth is below the turnover target |
| 6019 | ActiveBinSlippage | Active bin moved beyond the allowed slippage |
| 6020 | RangeBelowFloor | The liquidity range would sit at or below the floor bin |
| 6021 | PositionsOpen | Positions are still open |
| 6022 | AlreadyUnwound | Position already unwound |
| 6023 | NothingToClaim | Nothing to claim |
| 6024 | AlreadyClaimed | Already settled for this LP |
| 6025 | AccountMismatch | Account does not match the jolt |
| 6026 | InvalidDlmmAccount | Invalid DLMM account |
| 6027 | MathOverflow | Math overflow |
| 6028 | CannotCancel | Cannot cancel this jolt now |
| 6029 | ClaimsOutstanding | Outstanding claims remain |
| 6030 | InvalidTrigger | Unknown fuse trigger |
| 6031 | DepositTooSmall | Deposit below the minimum |
| 6032 | TwapNotReady | The DLMM oracle history does not cover the TWAP window yet |
| 6033 | PriceDeviation | Spot price is too far from the TWAP; retry when the price settles |
| 6034 | OracleTooShort | The DLMM oracle of this pool is too short for the TWAP window |
| 6035 | NoPendingAuthority | No authority handover is pending for this signer |
TypeScript client
Every builder returns a TransactionInstruction and resolves the DLMM accounts from chain.
// the TypeScript client in program/client: PDAs, fetchers and builders for all 22 instructions
import { Connection, Transaction } from "@solana/web3.js";
import { BN } from "@coral-xyz/anchor";
import { JoltClient, fetchPair, fetchTwap } from "./program/client/src/index";
const client = new JoltClient(new Connection("https://api.mainnet-beta.solana.com"));
// read every jolt and the config
const jolts = await client.fetchAllJolts();
const cfg = await client.fetchConfig();
// the price the fuse sees: DLMM oracle TWAP over the jolt's window
const j = jolts[0].account;
const pair = await fetchPair(client.conn, j.lbPair);
const { bin } = await fetchTwap(client.conn, pair, Math.floor(Date.now() / 1000), j.twapWindowSecs);
// LP: deposit 0.5 SOL into a charging jolt, signed by your wallet
const ix = await client.depositSol(wallet.publicKey, jolts[0].publicKey, new BN(500_000_000));
await wallet.sendTransaction(new Transaction().add(ix), client.conn);