API Reference
Perpetuals GraphQL
GraphQL schema for the Paxeer Perpetuals indexer.
Perpetuals GraphQL Schema
GraphQL schema for the Perpetuals indexer — markets, positions, trades, orders, liquidations, funding rates, and vault operations.
Endpoint: https://perps.sidiora.xyz/api/subgraph
Schema
directive @oneOf on INPUT_OBJECT
scalar BigDecimal
scalar DateTime
type Market {
marketId: Int!
name: String!
symbol: String!
maxLeverage: BigDecimal!
enabled: Boolean!
createdAt: DateTime
latestPrice: LatestPrice
poolState: PoolState
fundingRate: FundingRate
}
type Position {
positionId: BigDecimal!
userAddress: String!
marketId: Int!
isLong: Boolean!
sizeUsd: BigDecimal!
leverage: BigDecimal!
entryPrice: BigDecimal!
collateralToken: String
collateralAmount: BigDecimal!
collateralUsd: BigDecimal!
status: String!
realizedPnl: BigDecimal
exitPrice: BigDecimal
openedAt: DateTime
closedAt: DateTime
openBlock: Int
closeBlock: Int
openTxHash: String
closeTxHash: String
market: Market
}
type Trade {
id: Int!
positionId: BigDecimal!
userAddress: String
marketId: Int
tradeType: String!
isLong: Boolean
sizeUsd: BigDecimal!
price: BigDecimal!
realizedPnl: BigDecimal
feeUsd: BigDecimal
blockNumber: Int!
txHash: String!
blockTimestamp: DateTime!
}
type Order {
orderId: BigDecimal!
userAddress: String!
marketId: Int!
orderType: Int!
isLong: Boolean!
triggerPrice: BigDecimal!
sizeUsd: BigDecimal!
status: String!
positionId: BigDecimal
executionPrice: BigDecimal
placedAt: DateTime
resolvedAt: DateTime
placedBlock: Int
resolvedBlock: Int
placedTxHash: String
resolvedTxHash: String
}
type Liquidation {
id: Int!
positionId: BigDecimal!
userAddress: String!
marketId: Int!
price: BigDecimal!
penalty: BigDecimal!
keeper: String!
blockNumber: Int!
txHash: String!
blockTimestamp: DateTime!
}
type PriceUpdate {
id: Int!
marketId: Int!
price: BigDecimal!
onchainTimestamp: Int!
blockNumber: Int!
txHash: String!
blockTimestamp: DateTime!
}
type LatestPrice {
marketId: Int!
price: BigDecimal!
onchainTimestamp: Int!
blockNumber: Int!
updatedAt: DateTime
}
type FundingRate {
id: Int!
marketId: Int!
ratePerSecond: BigDecimal!
rate24h: BigDecimal!
blockNumber: Int!
txHash: String!
blockTimestamp: DateTime!
}
type UserVault {
userAddress: String!
vaultAddress: String!
createdAt: DateTime
blockNumber: Int
txHash: String
}
type VaultEvent {
id: Int!
eventType: String!
userAddress: String
tokenAddress: String!
amount: BigDecimal!
blockNumber: Int!
txHash: String!
logIndex: Int!
blockTimestamp: DateTime!
}
type CollateralToken {
tokenAddress: String!
decimals: Int!
isActive: Boolean!
addedAt: DateTime
}
type PoolState {
marketId: Int!
baseReserve: BigDecimal!
quoteReserve: BigDecimal!
oraclePrice: BigDecimal
updatedAt: DateTime
blockNumber: Int
}
type FeeConfig {
takerFeeBps: Int!
makerFeeBps: Int!
liquidationFeeBps: Int!
insuranceFeeBps: Int!
updatedAt: DateTime
}
type ProtocolEvent {
id: Int!
eventName: String!
eventData: String!
blockNumber: Int!
txHash: String!
logIndex: Int!
blockTimestamp: DateTime!
}
type IndexerStatus {
lastIndexedBlock: Int!
chainHead: Int
blocksScanned: Int
eventsProcessed: Int
isSynced: Boolean
}
type UserStats {
userAddress: String!
totalPositions: Int!
openPositions: Int!
closedPositions: Int!
liquidatedPositions: Int!
totalTrades: Int!
totalRealizedPnl: BigDecimal!
totalOrders: Int!
activeOrders: Int!
}
type MarketStats {
marketId: Int!
symbol: String
totalPositions: Int!
openPositions: Int!
totalTrades: Int!
totalLiquidations: Int!
totalVolume: BigDecimal!
latestPrice: BigDecimal
latestFundingRate: BigDecimal
}
type GlobalStats {
totalMarkets: Int!
totalPositions: Int!
openPositions: Int!
totalTrades: Int!
totalLiquidations: Int!
totalVolume: BigDecimal!
totalUsers: Int!
indexerBlock: Int!
}
type Query {
position(positionId: String!): Position
positions(userAddress: String, marketId: Int, status: String, limit: Int, offset: Int): [Position!]!
trades(userAddress: String, marketId: Int, positionId: String, tradeType: String, limit: Int, offset: Int): [Trade!]!
order(orderId: String!): Order
orders(userAddress: String, marketId: Int, status: String, limit: Int, offset: Int): [Order!]!
liquidations(userAddress: String, marketId: Int, limit: Int, offset: Int): [Liquidation!]!
market(marketId: Int!): Market
markets: [Market!]!
latestPrices: [LatestPrice!]!
priceHistory(marketId: Int!, limit: Int, offset: Int): [PriceUpdate!]!
fundingRates(marketId: Int!, limit: Int, offset: Int): [FundingRate!]!
userVault(userAddress: String!): UserVault
vaultEvents(userAddress: String, eventType: String, limit: Int, offset: Int): [VaultEvent!]!
collateralTokens: [CollateralToken!]!
poolStates: [PoolState!]!
poolState(marketId: Int!): PoolState
feeConfig: FeeConfig
protocolEvents(eventName: String, limit: Int, offset: Int): [ProtocolEvent!]!
userStats(userAddress: String!): UserStats
marketStats(marketId: Int!): MarketStats
globalStats: GlobalStats
indexerStatus: IndexerStatus
}How is this guide?