Entities

This page provides details of the entities in the Predy subgraph GraphQL schema.

Asset

Field
Type
Description

id

ID!

PerpetualMarket address

metrics

[MetricsEntity!]! @derivedFrom(field: "asset")

VaultEntity

Field
Type
Description

id

ID!

Vault ID

asset

Asset!

vaultId

BigInt! (uint256)

Vault ID

account

Bytes! (address)

Vault owner address

positionSquaredPerpetual

BigInt! (int256)

Vault ETH² perpetual position size

positionPerpetualFuture

BigInt! (int256)

Vault ETH perpetual position size

positionUsdc

BigInt! (int256)

Vault USDC collateral

subVaults

[SubVaultEntity!]! @derivedFrom(field: "vault")

history

[TradeHistoryEntity!]! @derivedFrom(field: "vault")

SubVaultEntity

Field
Type
Description

id

ID!

PerpetualMarket address - Vault ID - Subvault ID

vault

VaultEntity! (uint256)

Vault that the subvault belongs to

subVaultId

BigInt! (uint256)

Subvault ID

metadata

Bytes! (bytes)

Metadata set by trader

TradeHistoryEntity

Field
Type
Description

id

ID!

Transaction hash - Transaction Log Index

asset

Asset!

txid

String!

Transaction hash

action

Action! (enum)

Action completed: TRADE, DEPOSIT_MARGIN, WITHDRAW_MARGIN, LIQUIDATE

trader

Bytes! (address)

Trader address

vault

VaultEntity! (uint256)

subVaultIndex

BigInt! (uint256)

productId

BigInt! (uint256)

Product traded 0: ETH 1: ETH²

tradeAmount

BigInt! (int256)

Amount of trade

tradePrice

BigInt! (uint256)

Price that trade was executed at

fundingFeePerPosition

BigInt! (uint256)

Funding fee paid per contract

marginAmount

BigInt! (int256)

Change in margin in the vault

timestamp

BigInt! (uint256)

Timestamp of block

PoolDepositedEntity

Field
Type
Description

id

ID!

Transaction hash

asset

Asset!

account

Bytes! (address)

Trader address

mintAmount

BigInt! (uint256)

Amount of LP token minted

depositAmount

BigInt! (uint256)

Amount of USDC deposited

timestamp

BigInt! (uint256)

Timestamp of block

PoolWithdrawnEntity

Field
Type
Description

id

ID!

Transaction hash

asset

Asset!

account

Bytes! (address)

Trader address

burnAmount

BigInt! (uint256)

Amount of LP token burned

withdrawAmount

BigInt! (uint256)

Amount of USDC withdrawn

timestamp

BigInt! (uint256)

Timestamp of block

HedgedEntity

Field
Type
Description

id

ID!

Transaction hash

asset

Asset!

hedger

Bytes! (address)

Hedger address

isBuyingUnderlying

Boolean! (bool)

True if the pool is buying ETH, false if the pool is selling ETH

usdcAmount

BigInt! (uint256)

USDC amount bought/sold

underlyingAmount

BigInt! (uint256)

ETH amount bought/sold

timestamp

BigInt! (uint256)

Timestamp of block

FundingPaymentEntity

Field
Type
Description

id

ID!

Transaction hash

asset

Asset!

productId

BigInt! (uint256)

Product traded 0: ETH 1: ETH²

fundingRate

BigInt! (uint256)

Funding rate for specified product

totalFundingPaidPerPosition

BigInt! (uint256)

Cumulative funding paid per position of specified product

fundingPaidPerPosition

BigInt! (uint256)

Funding paid per position of specified product since last contract interaction

poolReceived

BigInt! (uint256)

Amount of funding payment received by the pool

timestamp

BigInt! (uint256)

Timestamp of block

VarianceUpdatedEntity

Field
Type
Description

id

ID!

Transaction hash

variance

BigInt! (uint256)

ETH variance

price

BigInt! (uint256)

ETH spot price

timestamp

BigInt! (uint256)

Timestamp of block

MetricsEntity

Field
Type
Description

id

ID!

PerpetualMarket address - Product (0: ETH, 1: ETH²)

asset

Asset!

volume

BigInt!

Total cumulative volume of the specified product, denominated in the underlying asset (ETH² or ETH)

notionalVolume

BigInt!

Total cumulative volume of the specified product, denominated in USDC

openLong

BigInt!

Current open long positions of the specified product on entire protocol

openShort

BigInt!

Current open long positions of the specified product on entire protocol

AggregatedVolume

Field
Type
Description

id

ID!

PerpetualMarket address / Product (0: ETH, 1: ETH²) / Interval (HOURLY, DAILY, WEEKLY) / Opening timestamp

asset

Asset!

productId

BigInt! (uint256)

Product ID (0: ETH, 1: ETH²)

interval

Interval! (enum)

Interval for aggregation (HOURLY, DAILY, WEEKLY)

openTimestamp

BigInt!

Timestamp for the start of the aggregation period

closeTimestamp

BigInt!

Timestamp for the end of the aggregation period

volume

BigInt!

Aggregated volume of the specified product, denominated in the underlying asset (ETH or ETH²)

notionalVolume

BigInt!

Aggregated volume of the specified product, denominated in the USDC

AggregatedFundingPayment

Field
Type
Description

id

ID!

PerpetualMarketCore address / Product (0: ETH, 1: ETH²) / Interval (HOURLY, DAILY, WEEKLY) / Opening timestamp

asset

Asset!

productId

BigInt! (uint256)

Product ID (0: ETH, 1: ETH²)

interval

Interval!

Interval for aggregation (HOURLY, DAILY, WEEKLY)

openTimestamp

BigInt!

Timestamp for the start of the aggregation period

closeTimestamp

BigInt!

Timestamp for the end of the aggregation period

openFundingRate

BigInt!

First calculated funding rate of the aggregation period

closeFundingRate

BigInt!

Last calculated funding rate of the aggregation period

totalFundingPaidPerPosition

BigInt! (uint256)

Amount of funding paid per position in the aggregation period

poolReceived

BigInt! (uint256)

Amount of funding payments that the pool has received in the aggregation period

LPTokenPriceEntity

Field
Type
Description

id

ID!

Block number

timestamp

BigInt!

Timestamp of block

price

BigInt!

LP token price

AggregatedLPTokenPriceEntity

Field
Type
Description

id

ID!

Block number

interval

Interval!

Interval for aggregation (HOURLY, DAILY, WEEKLY)

openTimestamp

BigInt!

Timestamp for the start of the aggregation period

closeTimestamp

BigInt!

Timestamp for the end of the aggregation period

open

BigInt!

Opening price for aggregation period

close

BigInt!

Closing price for aggregation period

high

BigInt!

Highest price for aggregation period

low

BigInt!

Lowest price for aggregation period

openTradeTimestamp

BigInt!

Timestamp of block where opening price was recorded

closeTradeTimestamp

BigInt!

Timestamp of block where closing price was recorded

highTradeTimestamp

BigInt!

Timestamp of block where highest price was recorded

lowTradeTimestamp

BigInt!

Timestamp of block where lowest price was recorded

OpenInterestEntity

Field
Type
Description

id

ID!

Block number

productId

BigInt!

Product ID (0: ETH, 1: ETH²)

timestamp

BigInt!

Timestamp of block

openLong

BigInt!

Amount of long positions open on the specified product.

openShort

BigInt!

Amount of long positions open on the specified product.

AggregatedOpenInterestEntity

Field
Type
Description

id

ID!

Block number

productId

BigInt!

Product ID (0: ETH, 1: ETH²)

direction

Direction!

Direction of open interest aggregated (LONG, SHORT)

interval

Interval!

Interval for aggregation (HOURLY, DAILY, WEEKLY)

openTimestamp

BigInt!

Timestamp for the start of the aggregation period

closeTimestamp

BigInt!

Timestamp for the end of the aggregation period

open

BigInt!

Opening open interest for aggregation period

close

BigInt!

Closing open interest for aggregation period

high

BigInt!

Highest open interest for aggregation period

low

BigInt!

Lowest open interest for aggregation period

openTradeTimestamp

BigInt!

Timestamp of block where opening open interest was recorded

closeTradeTimestamp

BigInt!

Timestamp of block where closing open interest was recorded

highTradeTimestamp

BigInt!

Timestamp of block where highest open interest was recorded

lowTradeTimestamp

BigInt!

Timestamp of block where lowest open interest was recorded

Last updated