Perpetuals

Jupiter Perpetuals historical data as Parquet

Every Jupiter Perpetuals instruction and event in Solana history, decoded with an Anchor IDL that we checked against real transactions. Trawl gives you 25 event tables and 59 instruction tables, with a column for each account, argument and field. Calls from other programs (CPI) are in the result too.

Updated

The preset

Program
PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu
Preset
jupiter-perpetuals
Tables
25 event tables and 59 instruction tables, and part-* with the raw bytes of each match
Price
$4 for one recent epoch, $8.68 for one week of chain

The price is the same for every program: you pay for the archive the scan reads, not for the rows. Pricing.

# ask for a price: a 402 with the quote, no payment yet
curl -X POST https://trawl.run/scan \
  -H 'Content-Type: application/json' \
  -d '{"preset":"jupiter-perpetuals","start_epoch":1058,"end_epoch":1058}'

-- then, in DuckDB, on the files of the job
SELECT slot, signature, positionRequestKey, transferAmount, collateralCustodyPreSwapAmount
FROM 'ev-increase_position_pre_swap_event-*.parquet'
ORDER BY slot
LIMIT 10;

Add "filter": {"accounts": ["<wallet>"]} to keep only the transactions that touch one wallet. How a filter changes a preset.

Event tables

One table for each event in the IDL. Each row also has log_index and the context columns. An event that the program writes two ways gives one row.

ev-create_position_request_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionSide u8, positionMint base58 string, positionCustody base58 string, positionCollateralMint base58 string, positionCollateralCustody base58 string, positionRequestKey base58 string, positionRequestMint base58 string, sizeUsdDelta u64, collateralDelta u64, priceSlippage u64, jupiterMinimumOut u64, preSwapAmount u64, requestChange u8, openTime i64, referral base58 string
ev-instant_create_tpsl_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionSide u8, positionMint base58 string, positionCustody base58 string, positionCollateralCustody base58 string, positionRequestKey base58 string, positionRequestMint base58 string, sizeUsdDelta u64, collateralDelta u64, entirePosition bool, openTime i64
ev-instant_update_tpsl_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionSide u8, positionMint base58 string, positionCustody base58 string, positionCollateralCustody base58 string, positionRequestKey base58 string, positionRequestMint base58 string, sizeUsdDelta u64, collateralDelta u64, entirePosition bool, updateTime i64
ev-close_position_request_event
fields: entirePosition bool, executed bool, requestChange u8, requestType u8, side u8, positionRequestKey base58 string, owner base58 string, mint base58 string, amount u64, openTime i64
ev-increase_position_event
fields: positionKey base58 string, positionSide u8, positionCustody base58 string, positionCollateralCustody base58 string, positionSizeUsd u64, positionMint base58 string, positionRequestKey base58 string, positionRequestMint base58 string, positionRequestChange u8, positionRequestType u8, positionRequestCollateralDelta u64, owner base58 string, pool base58 string, sizeUsdDelta u64, collateralUsdDelta u64, collateralTokenDelta u64, price u64, priceSlippage u64, feeToken u64, feeUsd u64, openTime i64, referral base58 string, positionFeeUsd u64, fundingFeeUsd u64, priceImpactFeeUsd u64
ev-increase_position_pre_swap_event
fields: positionRequestKey base58 string, transferAmount u64, collateralCustodyPreSwapAmount u64
ev-decrease_position_event
fields: positionKey base58 string, positionSide u8, positionCustody base58 string, positionCollateralCustody base58 string, positionSizeUsd u64, positionMint base58 string, positionRequestKey base58 string, positionRequestMint base58 string, positionRequestChange u8, positionRequestType u8, hasProfit bool, pnlDelta u64, owner base58 string, pool base58 string, sizeUsdDelta u64, transferAmountUsd u64, transferToken u64, price u64, priceSlippage u64, feeUsd u64, openTime i64, referral base58 string, positionFeeUsd u64, fundingFeeUsd u64, priceImpactFeeUsd u64, originalPositionCollateralUsd u64, positionCollateralUsd u64, positionOpenTime i64, positionPrice u64
ev-decrease_position_post_swap_event
fields: positionRequestKey base58 string, swapAmount u64, jupiterMinimumOut u64
ev-liquidate_full_position_event
fields: positionKey base58 string, positionSide u8, positionCustody base58 string, positionCollateralCustody base58 string, positionCollateralMint base58 string, positionMint base58 string, positionSizeUsd u64, hasProfit bool, pnlDelta u64, owner base58 string, pool base58 string, transferAmountUsd u64, transferToken u64, price u64, feeUsd u64, liquidationFeeUsd u64, openTime i64, positionFeeUsd u64, fundingFeeUsd u64, priceImpactFeeUsd u64, originalPositionCollateralUsd u64, positionCollateralUsd u64, positionOpenTime i64, positionPrice u64
ev-pool_swap_event
fields: receivingCustodyKey base58 string, dispensingCustodyKey base58 string, poolKey base58 string, amountIn u64, amountOut u64, swapUsdAmount u64, amountOutAfterFees u64, feeBps u64, ownerKey base58 string, receivingAccountKey base58 string
ev-pool_swap_exact_out_event
fields: receivingCustodyKey base58 string, dispensingCustodyKey base58 string, poolKey base58 string, amountIn u64, amountInAfterFees u64, amountOut u64, swapUsdAmount u64, feeBps u64, ownerKey base58 string, receivingAccountKey base58 string
ev-add_liquidity_event
fields: custodyKey base58 string, poolKey base58 string, tokenAmountIn u64, prePoolAmountUsd decimal string, tokenAmountUsd u64, feeBps u64, tokenAmountAfterFee u64, mintAmountUsd u64, lpAmount u64, postPoolAmountUsd decimal string
ev-remove_liquidity_event
fields: custodyKey base58 string, poolKey base58 string, lpAmountIn u64, removeAmountUsd u64, feeBps u64, removeTokenAmount u64, tokenAmountAfterFee u64, postPoolAmountUsd decimal string
ev-instant_create_limit_order_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionSide u8, positionMint base58 string, positionCustody base58 string, positionCollateralMint base58 string, positionCollateralCustody base58 string, positionRequestKey base58 string, positionRequestMint base58 string, sizeUsdDelta u64, collateralDelta u64, openTime i64
ev-instant_increase_position_event
fields: positionKey base58 string, positionSide u8, positionCustody base58 string, positionCollateralCustody base58 string, positionSizeUsd u64, positionMint base58 string, owner base58 string, pool base58 string, sizeUsdDelta u64, collateralUsdDelta u64, collateralTokenDelta u64, price u64, priceSlippage u64, feeToken u64, feeUsd u64, openTime i64, referral base58 string, positionFeeUsd u64, fundingFeeUsd u64, priceImpactFeeUsd u64
ev-instant_decrease_position_event
fields: positionKey base58 string, positionSide u8, positionCustody base58 string, positionCollateralCustody base58 string, positionSizeUsd u64, positionMint base58 string, desiredMint base58 string, hasProfit bool, pnlDelta u64, owner base58 string, pool base58 string, sizeUsdDelta u64, transferAmountUsd u64, transferToken u64, price u64, priceSlippage u64, feeUsd u64, openTime i64, referral base58 string, positionFeeUsd u64, fundingFeeUsd u64, originalPositionCollateralUsd u64, positionCollateralUsd u64, priceImpactFeeUsd u64, positionOpenTime i64, positionPrice u64, positionRequest base58 string
ev-deposit_collateral_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionMint base58 string, positionCustody base58 string, depositAmount u64, userTokenAccount base58 string, time i64
ev-withdraw_collateral_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionMint base58 string, positionCustody base58 string, withdrawAmount u64, userTokenAccount base58 string, custody base58 string, previousCollateralAmount u64, collateralAmount u64, collateralAmountUsd u64, marginUsd u64, time i64
ev-borrow_from_custody_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionMint base58 string, positionCustody base58 string, sizeCustodyToken u64, collateralAmount u64, collateralAmountUsd u64, marginUsd u64, updateTime i64
ev-repay_to_custody_event
fields: owner base58 string, pool base58 string, positionKey base58 string, positionMint base58 string, positionCustody base58 string, sizeCustodyToken u64, updateTime i64, interest decimal string
ev-liquidate_borrow_position_event
fields: positionKey base58 string, positionCustody base58 string, positionSizeUsd u64, owner base58 string, pool base58 string, collateralLockedInUsd u64, collateralLockedInLp u64, remainingCollateralInLp u64, custodyTokenPrice u64, totalBorrowsInUsd u64, liquidationFeeUsd u64, liquidationTime i64
ev-redeem_stake_event
fields: custody base58 string, stakeAccount base58 string, stakeInfo base58 string, stakeRewards u64, custodyTotalStakedAmount u64, currentStakedAmount u64, totalStakingRewards u64, redeemTime i64
ev-withdraw_stake_event
fields: custody base58 string, stakeAccount base58 string, stakeInfo base58 string, stakeRewards u64, custodyTotalStakedAmount u64, totalStakingRewards u64, withdrawAmount u64, withdrawTime i64
ev-delegate_stake_event
fields: custody base58 string, stakeAccount base58 string, stakeInfo base58 string, custodyTotalStakedAmount u64, stakeAmount u64, validatorVoteAccount base58 string, delegateTime i64
ev-withdraw_fees_event
fields: pool base58 string, custody base58 string, custodyMint base58 string, receivingTokenAccount base58 string, totalTradeSwapFees u64, poolTradeSwapFees u64, protocolTradeSwapFees u64, totalBorrowLendingFees u64, poolBorrowLendingFees u64, protocolBorrowLendingFees u64, poolTotalFeesUsd u64, aprBpsBefore u64, aprBpsAfter u64, aprBpsUpdatedAt i64, poolRealizedFeeUsdBefore u64, poolRealizedFeeUsdAfter u64, curtime i64

Instruction tables

One table for each instruction in the IDL: the named accounts, then the arguments. Each row also has the context columns: slot, tx_index, signature, success, fee, program_id, ix_index, is_inner, inner_index, stack_height, accounts. What each one holds.

ix-init
accounts: upgradeAuthority, admin, transferAuthority, perpetuals, perpetualsProgram, perpetualsProgramData, systemProgram, tokenProgram
args: params JSON string
ix-add_pool
accounts: admin, transferAuthority, perpetuals, pool, lpTokenMint, systemProgram, tokenProgram, rent
args: params JSON string
ix-add_custody
accounts: admin, transferAuthority, perpetuals, pool, custody, custodyTokenAccount, custodyTokenMint, systemProgram, tokenProgram, rent
args: params JSON string
ix-set_custody_config
accounts: admin, perpetuals, custody
args: params JSON string
ix-set_pool_config
accounts: admin, perpetuals, pool
args: params JSON string
ix-set_perpetuals_config
accounts: admin, perpetuals
args: params JSON string
ix-transfer_admin
accounts: admin, newAdmin, perpetuals
args: params JSON string
ix-withdraw_fees2
accounts: keeper, transferAuthority, perpetuals, pool, custody, custodyTokenAccount, custodyDovesPriceAccount, custodyPythnetPriceAccount, receivingTokenAccount, tokenProgram
args: params JSON string
ix-create_token_metadata
accounts: admin, perpetuals, pool, transferAuthority, metadata, lpTokenMint, tokenMetadataProgram, systemProgram, rent
args: params JSON string
ix-create_token_ledger
accounts: tokenLedger, payer, systemProgram
ix-realloc_custody
accounts: keeper, custody, systemProgram, rent
ix-realloc_pool
accounts: keeper, pool, systemProgram, rent
ix-create_and_delegate_stake_account
accounts: keeper, perpetuals, pool, custody, custodyTokenAccount, transferAuthority, stakeAccount, stakeInfo, validatorVoteAccount, stakeConfig, wsolMint, tempWsolAccount, rent, clock, stakeHistory, stakeProgram, systemProgram, tokenProgram
args: params JSON string
ix-unstake
accounts: operator, perpetuals, pool, custody, transferAuthority, stakeAccount, stakeInfo, clock, stakeProgram
ix-withdraw_stake
accounts: keeper, perpetuals, pool, custody, custodyTokenAccount, transferAuthority, stakeAccount, stakeInfo, clock, stakeHistory, stakeProgram, systemProgram, tokenProgram
ix-redeem_stake
accounts: keeper, perpetuals, pool, custody, stakeAccount, stakeInfo
ix-operator_set_custody_config
accounts: operator, custody
args: params JSON string
ix-operator_set_pool_config
accounts: operator, pool
args: params JSON string
ix-test_init
accounts: upgradeAuthority, admin, transferAuthority, perpetuals, systemProgram, tokenProgram
args: params JSON string
ix-set_test_time
accounts: admin, perpetuals
args: params JSON string
ix-set_token_ledger
accounts: tokenLedger, tokenAccount, tokenProgram
ix-swap2
accounts: owner, fundingAccount, receivingAccount, transferAuthority, perpetuals, pool, receivingCustody, receivingCustodyDovesPriceAccount, receivingCustodyPythnetPriceAccount, receivingCustodyTokenAccount, dispensingCustody, dispensingCustodyDovesPriceAccount, dispensingCustodyPythnetPriceAccount, dispensingCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-swap_with_token_ledger
accounts: owner, fundingAccount, receivingAccount, transferAuthority, perpetuals, pool, receivingCustody, receivingCustodyDovesPriceAccount, receivingCustodyTokenAccount, dispensingCustody, dispensingCustodyDovesPriceAccount, dispensingCustodyTokenAccount, tokenLedger, tokenProgram, instruction, eventAuthority, program
args: params JSON string
ix-instant_increase_position_pre_swap
accounts: owner, fundingAccount, receivingAccount, transferAuthority, perpetuals, pool, receivingCustody, receivingCustodyDovesPriceAccount, receivingCustodyTokenAccount, dispensingCustody, dispensingCustodyDovesPriceAccount, dispensingCustodyTokenAccount, tokenProgram, instruction, eventAuthority, program
args: params JSON string
ix-add_liquidity2
accounts: owner, fundingAccount, lpTokenAccount, transferAuthority, perpetuals, pool, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, custodyTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-remove_liquidity2
accounts: owner, receivingAccount, lpTokenAccount, transferAuthority, perpetuals, pool, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, custodyTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-create_increase_position_market_request
accounts: owner, fundingAccount, perpetuals, pool, position, positionRequest, positionRequestAta, custody, collateralCustody, inputMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-create_decrease_position_request2
accounts: owner, receivingAccount, perpetuals, pool, position, positionRequest, positionRequestAta, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, desiredMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-create_decrease_position_market_request
accounts: owner, receivingAccount, perpetuals, pool, position, positionRequest, positionRequestAta, custody, collateralCustody, desiredMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-update_decrease_position_request2
accounts: owner, perpetuals, pool, position, positionRequest, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount
args: params JSON string
ix-close_position_request2
accounts: keeper, owner, ownerAta, pool, positionRequest, positionRequestAta, position, mint, tokenProgram, systemProgram, associatedTokenProgram, eventAuthority, program
ix-close_position_request3
accounts: keeper, owner, ownerAta, pool, positionRequest, positionRequestAta, position, custody, mint, tokenProgram, systemProgram, associatedTokenProgram, eventAuthority, program
ix-increase_position4
accounts: keeper, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-increase_position_pre_swap
accounts: keeper, keeperAta, positionRequest, positionRequestAta, position, collateralCustody, collateralCustodyTokenAccount, instruction, tokenProgram, eventAuthority, program
args: params JSON string
ix-increase_position_with_internal_swap
accounts: keeper, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, receivingCustody, receivingCustodyDovesPriceAccount, receivingCustodyPythnetPriceAccount, receivingCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-decrease_position4
accounts: keeper, owner, transferAuthority, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-decrease_position_with_internal_swap
accounts: keeper, owner, transferAuthority, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, dispensingCustody, dispensingCustodyDovesPriceAccount, dispensingCustodyPythnetPriceAccount, dispensingCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-decrease_position_with_tpsl
accounts: keeper, owner, transferAuthority, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-decrease_position_with_tpsl_and_internal_swap
accounts: keeper, owner, transferAuthority, perpetuals, pool, positionRequest, positionRequestAta, position, custody, custodyDovesPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyTokenAccount, dispensingCustody, dispensingCustodyDovesPriceAccount, dispensingCustodyTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-liquidate_full_position4
accounts: signer, perpetuals, pool, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, eventAuthority, program
args: params JSON string
ix-refresh_assets_under_management
accounts: keeper, perpetuals, pool, lpTokenMint
args: params JSON string
ix-set_max_global_sizes
accounts: keeper, custody, pool
args: params JSON string
ix-instant_create_tpsl
accounts: keeper, apiKeeper, owner, receivingAccount, perpetuals, pool, position, positionRequest, positionRequestAta, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, desiredMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-instant_create_limit_order
accounts: keeper, apiKeeper, owner, fundingAccount, perpetuals, pool, position, positionRequest, positionRequestAta, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, inputMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-instant_increase_position
accounts: keeper, apiKeeper, owner, fundingAccount, perpetuals, pool, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, tokenLedger, referral, tokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-instant_decrease_position
accounts: keeper, apiKeeper, owner, receivingAccount, transferAuthority, perpetuals, pool, position, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyPythnetPriceAccount, collateralCustodyTokenAccount, desiredMint, referral, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-instant_decrease_position2
accounts: keeper, apiKeeper, owner, receivingAccount, transferAuthority, perpetuals, pool, position, custody, custodyDovesPriceAccount, collateralCustody, collateralCustodyDovesPriceAccount, collateralCustodyTokenAccount, desiredMint, referral, positionRequest, positionRequestAta, tokenProgram, associatedTokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-instant_update_limit_order
accounts: keeper, apiKeeper, owner, perpetuals, pool, position, positionRequest, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount
args: params JSON string
ix-instant_update_tpsl
accounts: keeper, apiKeeper, owner, perpetuals, pool, position, positionRequest, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, eventAuthority, program
args: params JSON string
ix-get_add_liquidity_amount_and_fee2
accounts: perpetuals, pool, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, lpTokenMint
args: params JSON string
ix-get_remove_liquidity_amount_and_fee2
accounts: perpetuals, pool, custody, custodyDovesPriceAccount, custodyPythnetPriceAccount, lpTokenMint
args: params JSON string
ix-get_assets_under_management2
accounts: perpetuals, pool
args: params JSON string
ix-borrow_from_custody
accounts: owner, perpetuals, pool, custody, transferAuthority, borrowPosition, custodyTokenAccount, userTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-repay_to_custody
accounts: owner, perpetuals, pool, custody, borrowPosition, custodyTokenAccount, userTokenAccount, tokenProgram, eventAuthority, program
args: params JSON string
ix-deposit_collateral_for_borrows
accounts: owner, perpetuals, pool, custody, transferAuthority, borrowPosition, collateralTokenAccount, userTokenAccount, lpTokenMint, tokenProgram, systemProgram, eventAuthority, program
args: params JSON string
ix-withdraw_collateral_for_borrows
accounts: owner, perpetuals, pool, custody, transferAuthority, borrowPosition, collateralTokenAccount, userTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-liquidate_borrow_position
accounts: signer, perpetuals, pool, custody, transferAuthority, borrowPosition, collateralTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-partial_liquidate_borrow_position
accounts: signer, perpetuals, pool, custody, transferAuthority, borrowPosition, collateralTokenAccount, lpTokenMint, tokenProgram, eventAuthority, program
args: params JSON string
ix-close_borrow_position
accounts: owner, borrowPosition, systemProgram, eventAuthority, program
args: params JSON string

Files are split at 2 GB: ix-<name>-tNN-SSSS.parquet. Large integers stay exact: u128 is a decimal string. All decoded types.

Get Jupiter Perpetuals data for your range.

Select an epoch range and get a firm price. You pay only when you send the job.

Get a price