API · developer reference

Build on jolt.

JOLT is an on chain program; there is no hosted API in between. Every instruction, account, event and error code below is generated from the program IDL, and the TypeScript client builds every instruction. Your wallet signs each transaction, and nothing holds your keys or funds.

01

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.

ValueState
Program idHh6s9Mph1L8iC11KuJUtMEwwxv8RAn3v9uXVWB1q2JPtOpening soon
DLMM programLBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxoMeteora DLMM
Clientprogram/client: PDAs, fetchers and builders for all 22 instructionsTypeScript
Price sourceDLMM oracle TWAP over the jolt's window (twap_window_secs)On chain
02

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.

InstructionAccountsArgs
post_jolt
Project. 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_programargs: PostJoltArgs
deposit_sol
LP, 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_programlamports: u64
withdraw_before_live
LP, 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_programnone
cancel_jolt
Project while charging, or anyone after the deadline plus grace.
signer (signer), config (pda), jolt (mut) (pda)none
go_live
Keeper. 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, rentexpected_active_id: i32, max_slippage: u16
harvest_fees
Anyone. 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_programnone
claim
LP. 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_programnone
rebalance
Keeper. 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, rentexpected_active_id: i32, max_slippage: u16
turnover
Keeper 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_positionnone
measure_depth
Read only, by simulation. Logs organic and total depth.
keeper (signer), config (pda), jolt (mut) (pda), lb_pair, bid_position, ask_positionnone
blow_fuse
Anyone 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, oracletrigger: u8
close
Anyone after the term ends. Moves the jolt to unwinding.
signer (signer), jolt (mut) (pda)none
unwind
Anyone 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_programside: u8
settle
Anyone after both sides are unwound. Loss, cover, bonus, refunds and the protocol fee.
signer (signer), config (pda), jolt (mut) (pda), treasury (mut)none
project_claim
Project. 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_programnone
close_jolt
Anyone 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_programnone
initialize_config
Program upgrade authority, once. Creates the config; the signer becomes admin and names the keeper.
admin (signer, mut), config (mut) (pda), program_data, system_programparams: ConfigParams, keeper: pubkey
update_config
Admin. Changes the tunables (bounds checked) for jolts posted afterwards.
admin (signer), config (mut) (pda)params: ConfigParams
set_paused
Admin. Pauses posts, deposits, go live and rebalance. Exits always work.
admin (signer), config (mut) (pda)paused: bool
propose_authority
Admin. Step one of an admin (role 0) or keeper (role 1) handover.
admin (signer), config (mut) (pda)role: u8, proposed: pubkey
accept_authority
The proposed key. Step two: it signs to take the role.
new_authority (signer), config (mut) (pda)role: u8
migrate_config
Admin. Grows a config account written by an earlier program version to the current layout.
admin (signer, mut), config (mut) (pda), system_programtwap_window_secs: u32, max_twap_deviation_bins: u16, unwind_grace_secs: u32
03

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.

FieldType
adminpubkey
treasurypubkey
keeperpubkey
rent_fee_bpsu16
listing_feeu64
turnover_bonus_bpsu16
min_cover_bpsu16
min_term_secsu64
max_term_secsu64
min_depthu64
max_depthu64
min_fill_bpsu16
max_charge_secsu64
cancel_grace_secsu64
min_depositu64
max_bins_per_sideu16
pausedbool
jolt_countu64
bumpu8
pending_adminpubkey
pending_keeperpubkey
twap_window_secsu32
max_twap_deviation_binsu16
unwind_grace_secsu32
versionu8

Jolt

Seeds ["jolt", id u64 le]. One rental: terms, times, escrow, LP accumulators, the two DLMM positions, the oracle snapshot and the settlement figures.

FieldType
idu64
bumpu8
vault_x_bumpu8
vault_y_bumpu8
statusJoltStatus
end_reasonEndReason
fuse_triggeru8
projectpubkey
mintpubkey
lb_pairpubkey
vault_xpubkey
vault_ypubkey
depth_targetu64
term_secsu64
apr_bpsu16
cover_bpsu16
floor_bini32
turnover_depthu64
depth_range_bpsu16
depth_binsu32
bid_binsu16
ask_binsu16
bin_stepu16
rent_fee_bpsu16
turnover_bonus_bpsu16
min_fill_bpsu16
posted_ati64
charge_deadlinei64
live_ati64
ends_ati64
ended_ati64
rent_prepaidu64
rent_totalu64
rent_accruedu64
capacitoru64
token_amountu64
total_sharesu64
lp_countu32
lp_closedu32
acc_rent_per_shareu128
acc_fee_x_per_shareu128
acc_fee_y_per_shareu128
lp_idle_yu64
lp_idle_xu64
project_idle_xu64
bid_positionpubkey
bid_loweri32
bid_upperi32
ask_positionpubkey
ask_loweri32
ask_upperi32
bid_openbool
ask_openbool
lp_out_yu64
lp_out_xu64
ask_out_yu64
ask_out_xu64
settle_active_idi32
lp_valueu64
lp_lossu64
cover_paidu64
rent_bonusu64
rent_refundu64
lp_settle_solu64
lp_settle_xu64
project_claim_solu64
project_claim_xu64
protocol_fee_owedu64
protocol_fee_paidu64
lp_paid_solu64
lp_paid_xu64
oraclepubkey
twap_window_secsu32
max_twap_deviation_binsu16
unwind_grace_secsu32
settle_spot_idi32
settle_twap_secsu32

LpPosition

Seeds ["lp", jolt, owner]. One LP: deposit (its shares), reward debts and claimed totals. It is the receipt.

FieldType
ownerpubkey
joltpubkey
depositedu64
rent_debtu128
fee_x_debtu128
fee_y_debtu128
rent_claimedu64
fee_sol_claimedu64
fee_x_claimedu64
settledbool
bumpu8
04

Events

Every state change emits an Anchor event in the transaction logs; decode them with the IDL (EventParser).

EventFields
AuthorityAcceptedrole: u8, previous: pubkey, new: pubkey
AuthorityProposedrole: u8, current: pubkey, proposed: pubkey
ConfigInitializedadmin: pubkey, treasury: pubkey, keeper: pubkey
ConfigUpdatedadmin: pubkey, treasury: pubkey, rent_fee_bps: u16, listing_fee: u64, twap_window_secs: u32, max_twap_deviation_bins: u16
FeesHarvestedjolt: pubkey, lp_fee_x: u64, lp_fee_y: u64, project_fee_x: u64, project_fee_y: u64
JoltCancelledjolt: pubkey
JoltClosedjolt: pubkey, token_dust: u64, lamports_to_treasury: u64
JoltFuseBlownjolt: pubkey, trigger: u8, active_id: i32, floor_bin: i32, twap_bin: i32, twap_secs: i64
JoltLivejolt: 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
JoltPostedjolt: 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
JoltSettledjolt: 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
JoltTermEndedjolt: pubkey
JoltTurnoverjolt: pubkey, organic_depth: u64, unused_rent: u64
PauseSetadmin: pubkey, paused: bool
PositionUnwoundjolt: pubkey, side: u8, out_x: u64, out_y: u64, fee_x: u64, fee_y: u64, spot_id: i32, valuation_id: i32
ProjectClaimedjolt: pubkey, sol: u64, x: u64
Rebalancedjolt: pubkey, old_lower: i32, old_upper: i32, new_lower: i32, new_upper: i32, sol_in_bins: u64, idle_x: u64
RentClaimedjolt: pubkey, lp: pubkey, rent: u64, fee_sol: u64, fee_x: u64, settle_sol: u64, settle_x: u64
SolDepositedjolt: pubkey, lp: pubkey, lamports: u64, total_filled: u64
SolWithdrawnjolt: pubkey, lp: pubkey, lamports: u64
05

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.

CodeNameMessage
6000InvalidParamsA parameter is missing or out of range
6001JoltNotChargingThe jolt is not taking LP deposits right now
6002CoverTooLowThe capacitor is below the minimum cover ratio for posting
6003TokenNotEligibleMint or freeze authority is live, or the token program is not supported
6004PoolNotEligibleThe DLMM pool is not a <token>/wSOL pair for this mint or is not enabled
6005PausedProtocol is paused
6006UnauthorizedKeeperSigner is not the keeper
6007UnauthorizedAdminSigner is not the admin
6008UnauthorizedProjectSigner is not the project
6009UnauthorizedOwnerSigner is not the position owner
6010JoltNotLiveThe jolt is not live
6011JoltNotUnwindingThe jolt is not unwinding
6012JoltNotSettledThe jolt is not settled
6013NotFilledThe jolt cannot go live yet: not filled and the charge deadline has not passed
6014BelowMinFillThe jolt reached the deadline below the minimum fill
6015DepthExceededDeposit would exceed the target depth
6016TermNotEndedThe term has not ended yet
6017FuseNotTriggeredThe fuse condition is not met
6018TurnoverNotReachedOrganic depth is below the turnover target
6019ActiveBinSlippageActive bin moved beyond the allowed slippage
6020RangeBelowFloorThe liquidity range would sit at or below the floor bin
6021PositionsOpenPositions are still open
6022AlreadyUnwoundPosition already unwound
6023NothingToClaimNothing to claim
6024AlreadyClaimedAlready settled for this LP
6025AccountMismatchAccount does not match the jolt
6026InvalidDlmmAccountInvalid DLMM account
6027MathOverflowMath overflow
6028CannotCancelCannot cancel this jolt now
6029ClaimsOutstandingOutstanding claims remain
6030InvalidTriggerUnknown fuse trigger
6031DepositTooSmallDeposit below the minimum
6032TwapNotReadyThe DLMM oracle history does not cover the TWAP window yet
6033PriceDeviationSpot price is too far from the TWAP; retry when the price settles
6034OracleTooShortThe DLMM oracle of this pool is too short for the TWAP window
6035NoPendingAuthorityNo authority handover is pending for this signer
06

TypeScript client

Every builder returns a TransactionInstruction and resolves the DLMM accounts from chain.

TypeScript · program/client
// 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);