Tables
ClearingHouse_PositionChanged_event
Position change events from Perpetual Protocol v1 ClearingHouse contract on Gnosis Chain, capturing trader activity including margin, position size changes, realized/unrealized PnL, fees, funding payments, and liquidation data. Used for analyzing trader behavior, market dynamics, and protocol liquidation mechanics across automated market maker (AMM) pairs.Columns
Columns
| Column | Type | Description |
|---|---|---|
block_timestamp | TIMESTAMP | Timestamp when the block was produced. UTC timezone, millisecond precision. |
block_number | INT64 | Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block’s position in the blockchain. |
transaction_hash | STRING | Unique identifier for the transaction. 66-character hex string including 0x prefix. |
log_index | INT64 | Position of the event within the block’s transaction logs. Zero-indexed integer representing the sequential order of log emission. |
address | STRING | Contract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string. |
removed | BOOL | Boolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization. |
in_trader | STRING | Address that initiated or executed the trade transaction. Hex-encoded, 0x-prefixed, 42-character string. |
in_amm | STRING | Contract address of the automated market maker (AMM). Hex-encoded, 0x-prefixed, 42-character string. |
in_margin | STRING | Margin amount posted or held for the trading position. String-encoded integer value representing collateral in the smallest unit of the relevant token or currency. |
in_positionNotional | STRING | Notional value of the position after the trade, denominated in the margin asset (typically USD). Represented as a wei-formatted integer (18 decimals) showing the dollar value of the perpetual position. |
in_exchangedPositionSize | STRING | Change in position size (delta) resulting from this trade action, denominated in the perpetual contract’s base units. Positive values indicate longs, negative values indicate shorts or position closures. |
in_fee | STRING | Fee 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_positionSizeAfter | STRING | Position size held by the trader after this change is applied, denominated in the AMM’s base asset units. Positive values indicate long positions, negative values indicate short positions. |
in_realizedPnl | STRING | Realized 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_unrealizedPnlAfter | STRING | Trader’s unrealized profit or loss (PnL) for the position after this trade executed, denominated in the margin currency (wei). Positive values indicate unrealized gains, negative values indicate unrealized losses. |
in_badDebt | STRING | Bad debt amount resulting from the position change, measured in wei. Typically zero unless the position was liquidated with insufficient collateral to cover losses. |
in_liquidationPenalty | STRING | Fee charged when a position is forcibly closed due to insufficient margin. Denominated in wei (10^-18 tokens), typically zero for voluntary position changes and non-zero during liquidation events. |
in_spotPrice | STRING | Current spot price of the asset or position. String-encoded integer value representing the price in the smallest unit of the relevant token or currency. |
in_fundingPayment | STRING | Funding payment amount charged or credited to the position holder. String-encoded integer value representing the periodic fee in the smallest unit of the relevant token or currency, where negative values indicate payments owed by the trader and positive values indicate payments received. |
Sample Data
Sample Data
| in_amm | in_fee | address | removed | in_margin | in_trader | log_index | in_badDebt | block_number | in_spotPrice | in_realizedPnl | block_timestamp | transaction_hash | in_fundingPayment | in_positionNotional | in_positionSizeAfter | in_liquidationPenalty | in_unrealizedPnlAfter | in_exchangedPositionSize |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x0f346e19f01471c02485df1758cfd3d624e399b4 | 596400000000000000 | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 99400000000000000000 | 0xf15a780336068b58997bfd4640f008349c27636c | 32 | 0 | 13568228 | 22818066030391423292271 | 0 | 2020-12-17T18:24:00.000Z | 0xb5cd0b4c78474e230fc01fbafb989840d9cb74eb04164e181f2dd1374bc383c4 | 0 | 596400000000000000000 | 26138679705256658 | 0 | 0 | 26138679705256658 |
| 0x0f346e19f01471c02485df1758cfd3d624e399b4 | 3593734943142940472 | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 359373494314294047265 | 0xe8913568dd98e1967c1063d04657a79a13964665 | 19 | 0 | 13561432 | 22455658804754045701142 | 0 | 2020-12-17T07:59:40.000Z | 0xcbc70528eb865845e76d55bb58876455fa3600b361276ae974aac32898e24a8c | 0 | 3593734943142940472650 | 160092569295413146 | 0 | 0 | 160092569295413146 |
| 0x0f346e19f01471c02485df1758cfd3d624e399b4 | 4478880365808700308 | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 107644783609366957257 | 0xe8913568dd98e1967c1063d04657a79a13964665 | 25 | 0 | 13556346 | 21378877039368160014768 | -4985219874952791391 | 2020-12-17T00:21:45.000Z | 0x228e80689e81404f08974d7eab83396f36885afa879a812630bf067a43b1e07e | 0 | 4478880365808700308840 | 50356371430470141 | 0 | 0 | 209593287342010062 |
Example Query
Example Query
Query with partition filter
ClearingHouse_PositionLiquidated_event
Liquidation events from Perpetual Protocol v1 on Gnosis Chain, recording forced position closures when traders’ margin falls below maintenance requirements. Contains liquidator addresses, position sizes, notional values, liquidation fees, and bad debt for analyzing undercollateralized positions and liquidator profitability.Columns
Columns
| Column | Type | Description |
|---|---|---|
block_timestamp | TIMESTAMP | Timestamp when the block was produced. UTC timezone, millisecond precision. |
block_number | INT64 | Sequential identifier for the block in which the event or transaction was recorded. Integer value indicating the block’s position in the blockchain. |
transaction_hash | STRING | Unique identifier for the transaction. 66-character hex string including 0x prefix. |
log_index | INT64 | Position of the event within the block’s transaction logs. Zero-indexed integer representing the sequential order of log emission. |
address | STRING | Contract address that emitted the event. Hex-encoded, 0x-prefixed, 42-character string. |
removed | BOOL | Boolean flag indicating whether the event log was removed from the blockchain due to a chain reorganization. |
in_trader | STRING | Address that initiated or executed the trade transaction. Hex-encoded, 0x-prefixed, 42-character string. |
in_amm | STRING | Contract address of the automated market maker (AMM). Hex-encoded, 0x-prefixed, 42-character string. |
in_positionNotional | STRING | Notional value of the liquidated perpetual position at the time of liquidation, denominated in the quote currency (typically a stablecoin). Represented as a raw integer value that requires decimal adjustment (typically 18 decimals for Perpetual Protocol v1). |
in_positionSize | STRING | Total 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_liquidationFee | STRING | Liquidation fee collected from the liquidated position, paid to the liquidator for executing the liquidation. Denominated in the protocol’s base unit (wei-equivalent 18 decimals), typically representing a percentage of position notional value. |
in_liquidator | STRING | Address of the account executing the liquidation operation. Hex-encoded, 0x-prefixed, 42-character string. |
in_badDebt | STRING | Bad debt amount in wei resulting from the liquidation when the trader’s collateral is insufficient to cover losses. Typically zero when liquidations are profitable, non-zero when position losses exceed available margin. |
Sample Data
Sample Data
| in_amm | address | removed | in_trader | log_index | in_badDebt | block_number | in_liquidator | block_timestamp | in_positionSize | transaction_hash | in_liquidationFee | in_positionNotional |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0xab08ff2c726f2f333802630ee19f4146385cc343 | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 0x28fc94298bc9a20d6b5673d745bec57e69c6e368 | 6 | 0 | 18774928 | 0x07cf2d1ba50f015571a6f1a5493b69781fdcd4ec | 2021-10-27T07:51:20.000Z | 6181647706673219645377 | 0x7568ff0370407f5c7017e3353089c2f421b55f0bf4c0f1c60dc8c80795014f5c | 167786752048880921338 | 26845880327820947414110 |
| 0xb48f7accc03a3c64114170291f352b37eea26c0b | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 0x45a1b2157f9a1b464f949efcbeaf40309d7b07e0 | 31 | 0 | 18782098 | 0x07cf2d1ba50f015571a6f1a5493b69781fdcd4ec | 2021-10-27T19:24:17.000Z | 14078378677368164 | 0xb0e6f0e660072efc37cbe1eec156e1377d0a44c36f27b8833cfeb530af11217d | 195727604244237757 | 31316416679078041278 |
| 0x187c938543f2bde09fe39034fe3ff797a3d35ca0 | 0x5d9593586b4b5edbd23e7eba8d88fd8f09d83ebd | false | 0x6c2f2ea95392f22d138be349061bd55e18e0d946 | 6 | 0 | 18777871 | 0x07cf2d1ba50f015571a6f1a5493b69781fdcd4ec | 2021-10-27T12:37:00.000Z | 82852164596994742764 | 0x4ec67114384507ba956e9362b5eff29d701725371f708f0a5de7e2dbb186aafb | 494629050535834711 | 79140648085733553779 |
Example Query
Example Query
Query with partition filter