Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/graphql-extended-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"lens": minor
---

Add GraphQL query extensions for market screener, volumes, bid/ask spreads, oracle price comparisons, and historical range filtering:
- Add `from` and `to` ISO 8601 range arguments and boundary validation to `getPriceHistory` (closes #370).
- Add `oracle(asset: String!, network: String)` query with typed source status distinguishing available, unreachable, empty, and not configured sources (closes #369).
- Add `volumes(asset: String!, window: String, network: String)` and `spreads(asset: String!, window: String, network: String)` queries with typed `VenueVolume` and `VenueQuote` lists shared with REST routes (closes #368).
- Add `screener(filter, sort, pagination, network)` query supporting filters, sorting, cursor pagination, and explicit `market_cap` rejection matching REST (closes #367).
92 changes: 92 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enum OracleSourceStatus {
type OracleSource {
name: String!
price: Float
value: Float
timestamp: String
deviationPct: Float

Expand All @@ -71,6 +72,7 @@ type OracleSource {
"""
status: OracleSourceStatus!
ageSeconds: Int
age: Int
}

type OracleComparison {
Expand All @@ -82,6 +84,83 @@ type OracleComparison {
status: String!
fetchedAt: String!
oracles: [OracleSource!]!
sources: [OracleSource!]!
}

type VenueVolume {
venue: String!
volume: Float!
tradeCount: Int!
}

type VolumeReport {
asset: String!
network: String!
window: String!
startTime: String!
endTime: String!
totalVolume: Float!
tradeCount: Int!
venues: [VenueVolume!]!
}

type VenueQuote {
venue: String!
pairKey: String!
bid: Float!
ask: Float!
mid: Float!
spreadBps: Float!
spreadPct: Float!
observations: Int!
lastSeen: String!
}

type SpreadReport {
asset: String!
network: String!
window: String!
startTime: String!
endTime: String!
venues: [VenueQuote!]!
tightest: VenueQuote
}

input ScreenerFilterInput {
volume: Float
change24hMin: Float
change24hMax: Float
priceMin: Float
priceMax: Float
liquidity: Float
marketCap: Float
}

input ScreenerSortInput {
field: String
order: String
}

input ScreenerPaginationInput {
cursor: String
limit: Int
}

type ScreenerItem {
pairKey: String!
pair_key: String!
volume: Float!
price: Float!
change24h: Float!
change_24h: Float!
liquidity: Float!
}

type ScreenerResult {
data: [ScreenerItem!]!
nextCursor: String
hasMore: Boolean!
total: Int
}

type Query {
Expand Down Expand Up @@ -116,6 +195,19 @@ type Query {
The network argument defaults to the active network.
"""
oracle(asset: String!, network: String): OracleComparison

"""Volume report for an asset across all trading venues."""
volumes(asset: String!, window: String, network: String): VolumeReport

"""
Bid/ask spread and price dispersion report for an asset across venues and pairs.
"""
spreads(asset: String!, window: String, network: String): SpreadReport

"""
Market screener filtering, sorting, and cursor pagination across tracked pairs.
"""
screener(filter: ScreenerFilterInput, sort: ScreenerSortInput, pagination: ScreenerPaginationInput, network: String): ScreenerResult
}

type Subscription {
Expand Down
Loading