Skip to main content

Tables

ClearingHouse_PositionChanged_event

Position change events from Perpetual Protocol V2 ClearingHouse contract on Optimism, capturing perpetual futures trades with trader addresses, base tokens, position sizes, notional values, fees, and realized profit/loss. Used for analyzing trading activity, fee generation, and individual trader position movements across different perpetual markets.
ColumnTypeDescription
block_timestampTIMESTAMPTimestamp when the block was produced. UTC timezone, millisecond precision.
block_numberINT64Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block’s position in the blockchain.
transaction_hashSTRINGUnique identifier for the transaction. 66-character hex string including 0x prefix.
log_indexINT64Position of the event within the block’s transaction logs. Zero-indexed integer representing the sequential order of log emission.
addressSTRINGContract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string.
removedBOOLBoolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization.
in_traderSTRINGAddress that initiated or executed the trade transaction. Hex-encoded, 0x-prefixed, 42-character string.
in_baseTokenSTRINGContract address of the base token in a trading pair. Hex-encoded, 0x-prefixed, 42-character string.
in_exchangedPositionSizeSTRINGSigned change in the trader’s position size denominated in the base token, where negative values indicate short positions or position decreases. Values are in wei (smallest unit), representing the actual token amount traded in this position change event.
in_exchangedPositionNotionalSTRINGNotional value in USD of the perpetual position that was exchanged in this trade, denominated in the protocol’s base unit (wei). Represents the dollar-equivalent size of the position change before fees.
in_feeSTRINGFee amount charged for the transaction or operation. String-encoded integer value representing the fee in the smallest unit of the relevant token or currency.
in_openNotionalSTRINGCumulative notional value of the trader’s open position after this position change event. Denominated in the quote currency (typically USD) with 18 decimal precision.
in_realizedPnlSTRINGRealized profit or loss from the position or transaction. String-encoded integer value representing the net financial result in the smallest unit of the relevant token or currency, where negative values indicate losses and positive values indicate profits.
in_sqrtPriceAfterX96STRINGSquare root of the price after the position change in Q96 fixed-point format (price multiplied by 2^96). Used in Uniswap v3-style pricing for Perpetual Protocol’s virtual AMM calculations.
in_feeaddressremovedin_traderlog_indexblock_numberin_baseTokenin_realizedPnlblock_timestampin_openNotionaltransaction_hashin_sqrtPriceAfterX96in_exchangedPositionSizein_exchangedPositionNotional
2823635035537826810x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x0136e94a86328c4a4108e51cf078b54314b6fbb01901140067920xb6599bd362120dc70d48409b8a0888880705070002023-12-26T17:39:21.000Z173848864006727432617780x39df4914acbe9b79bb3b372ca603d0f07f9b88517cce4858b8fb9a058c0e71371354597618486914800600763164272-964167419708029771282363503553782680896
2295675054678493020x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x0136e94a86328c4a4108e51cf078b54314b6fbb02681140067980xb6599bd362120dc70d48409b8a0888880705070002023-12-26T17:39:33.000Z176142243386351247135790x22be85314f1b66fd6c559612c958b51d2000e8ccc79b134a1185521fb895a0761349071070678868901284003759307-790589594948674970229567505467849301103
1291030813673693130x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x0136e94a86328c4a4108e51cf078b54314b6fbb01811139850800xb6599bd362120dc70d48409b8a0888880705070002023-12-26T05:35:37.000Z140035540189604482577490x933b3a46e108a1cb033a95c4cd01bc438fc708a6953351c46c263fcd272f42c31293625357480351129297575720338-483727340615237483129103081367369312172
Query with partition filter
SELECT *
FROM `tt-contracts.perpetualprotocol_v2_optimism.ClearingHouse_PositionChanged_event`
WHERE block_timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
LIMIT 100

ClearingHouse_PositionLiquidated_event

Liquidation events from Perpetual Protocol v2 on Optimism, recording forced position closures with trader and liquidator addresses, position size, notional value, and liquidation fees. Used for analyzing undercollateralized positions, liquidation profitability, and protocol risk management effectiveness.
ColumnTypeDescription
block_timestampTIMESTAMPTimestamp when the block was produced. UTC timezone, millisecond precision.
block_numberINT64Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block’s position in the blockchain.
transaction_hashSTRINGUnique identifier for the transaction. 66-character hex string including 0x prefix.
log_indexINT64Position of the event within the block’s transaction logs. Zero-indexed integer representing the sequential order of log emission.
addressSTRINGContract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string.
removedBOOLBoolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization.
in_traderSTRINGAddress that initiated or executed the trade transaction. Hex-encoded, 0x-prefixed, 42-character string.
in_baseTokenSTRINGContract address of the base token in a trading pair. Hex-encoded, 0x-prefixed, 42-character string.
in_positionNotionalSTRINGNotional value of the liquidated position in USD terms at the time of liquidation, represented as a wei-denominated integer (divide by 1e18 for decimal value). Values typically range from tens to thousands of dollars based on position size and asset price.
in_positionSizeSTRINGTotal size of the trading position after the event. String-encoded integer value representing the position magnitude in the smallest unit of the relevant asset or USD-denominated value.
in_liquidationFeeSTRINGFee paid to the liquidator for executing the position liquidation, denominated in the protocol’s quote token. Value is in wei (18 decimal precision), typically representing a percentage of the liquidated position’s notional value.
in_liquidatorSTRINGAddress of the account executing the liquidation operation. Hex-encoded, 0x-prefixed, 42-character string.
addressremovedin_traderlog_indexblock_numberin_baseTokenin_liquidatorblock_timestampin_positionSizetransaction_hashin_liquidationFeein_positionNotional
0x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x2ccde611a35aa395c8aeb2babb4e25c835ca176011926168480x9482aafdced6b899626f465e1fa0cf1b1418d7970x179b2b7f339b3c1234ebac752eb8017441af90db2023-04-20T16:59:04.000Z2845633412104824154060x82225d99d3ddbcb4b8021f3d576838267b891993f49e3d603832a36d3657fdcb5416049057588661530216641962303546461209
0x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x6c2f2ea95392f22d138be349061bd55e18e0d94611926067540x5a7ed3ce6096228a9fe1b673830e6a78c9cfb71b0x179b2b7f339b3c1234ebac752eb8017441af90db2023-04-20T16:08:00.000Z7090842520835908736490x58c543816361560091133393db0d567a67fb38b9b4b124c050193a9a008f3260435205962317742168471740823849270968673890
0x82ac2ce43e33683c58be4cdc40975e73aa50f459false0x2ca0f9dba9780ddceb4921a2d895d32b6855f3a811926046360xbe5de48197fc974600929196239e264ecb703ee80x179b2b7f339b3c1234ebac752eb8017441af90db2023-04-20T16:02:59.000Z1117744583013859694160xd89e6aa16fa18c416379b51ec9102108cd849714f591c013f2c8308b174224d62956152074682252875118246082987290115012
Query with partition filter
SELECT *
FROM `tt-contracts.perpetualprotocol_v2_optimism.ClearingHouse_PositionLiquidated_event`
WHERE block_timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
LIMIT 100

PerpLiquidityMining_Claimed_event

Liquidity mining reward claim events from Perpetual Protocol V2 on Optimism, recording when liquidity providers withdraw their earned incentives. Tracks claimant addresses and claimed token balances (in wei) for analyzing LP reward distribution and participant behavior.
ColumnTypeDescription
block_timestampTIMESTAMPTimestamp when the block was produced. UTC timezone, millisecond precision.
block_numberINT64Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block’s position in the blockchain.
transaction_hashSTRINGUnique identifier for the transaction. 66-character hex string including 0x prefix.
log_indexINT64Position of the event within the block’s transaction logs. Zero-indexed integer representing the sequential order of log emission.
addressSTRINGContract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string.
removedBOOLBoolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization.
in__claimantSTRINGAddress of the account claiming the tokens or rewards. Hex-encoded, 0x-prefixed, 42-character string.
in__balanceSTRINGToken amount represented in smallest denomination. String-encoded integer value without decimal places.
addressremovedlog_indexin__balanceblock_numberin__claimantblock_timestamptransaction_hash
0x3230cbb08c64d0804be5b7f4ce43834291490a91false01898679706040190000032286720x432fcd67815d5cc72808a7815a02373fdee7d7402022-02-05T07:39:45.000Z0x28fa2503d7b7d58e03d7f501f3512403bf81449334889d205ff73d3ca1794769
0x3230cbb08c64d0804be5b7f4ce43834291490a91false0829655136245994420000264154590x571e41f85369574c6232439de6434b30dccf22092022-09-30T07:29:17.000Z0x41be8fbc2395081f5b80b125d84a1fcf813ba9b6d2128e165819673adcbc6057
0x3230cbb08c64d0804be5b7f4ce43834291490a91false021881044493590009000263751080xbe29499bc8dc2b426853642bae13e5f91d0fcc5a2022-09-30T02:57:47.000Z0x3874247e0a7b18e958d0faa7ef4622fe44915f9062e07ef1f553b60fdff76202
Query with partition filter
SELECT *
FROM `tt-contracts.perpetualprotocol_v2_optimism.PerpLiquidityMining_Claimed_event`
WHERE block_timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
LIMIT 100