fix: address review — migration comment, link ring buffer constants (#170)
This commit is contained in:
parent
3fceb4145a
commit
0fb1ed4bf8
10 changed files with 897 additions and 135 deletions
|
|
@ -21,16 +21,14 @@ type Query {
|
|||
stackMetas(where: stackMetaFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): stackMetaPage!
|
||||
stats(id: String!): stats
|
||||
statss(where: statsFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): statsPage!
|
||||
ethReserveHistory(id: String!): ethReserveHistory
|
||||
ethReserveHistorys(where: ethReserveHistoryFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): ethReserveHistoryPage!
|
||||
feeHistory(id: String!): feeHistory
|
||||
feeHistorys(where: feeHistoryFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): feeHistoryPage!
|
||||
positions(id: String!): positions
|
||||
positionss(where: positionsFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): positionsPage!
|
||||
recenters(id: String!): recenters
|
||||
recenterss(where: recentersFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): recentersPage!
|
||||
holders(address: String!): holders
|
||||
holderss(where: holdersFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): holdersPage!
|
||||
transactions(id: String!): transactions
|
||||
transactionss(where: transactionsFilter, orderBy: String, orderDirection: String, before: String, after: String, limit: Int): transactionsPage!
|
||||
_meta: Meta
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +105,6 @@ type stats {
|
|||
totalMinted: BigInt!
|
||||
totalBurned: BigInt!
|
||||
totalTaxPaid: BigInt!
|
||||
totalUbiClaimed: BigInt!
|
||||
mintedLastWeek: BigInt!
|
||||
mintedLastDay: BigInt!
|
||||
mintNextHourProjected: BigInt!
|
||||
|
|
@ -117,9 +114,10 @@ type stats {
|
|||
taxPaidLastWeek: BigInt!
|
||||
taxPaidLastDay: BigInt!
|
||||
taxPaidNextHourProjected: BigInt!
|
||||
ubiClaimedLastWeek: BigInt!
|
||||
ubiClaimedLastDay: BigInt!
|
||||
ubiClaimedNextHourProjected: BigInt!
|
||||
ethReserveLastDay: BigInt!
|
||||
ethReserveLastWeek: BigInt!
|
||||
netSupplyChangeDay: BigInt!
|
||||
netSupplyChangeWeek: BigInt!
|
||||
ringBufferPointer: Int!
|
||||
lastHourlyUpdateTimestamp: BigInt!
|
||||
ringBuffer: JSON!
|
||||
|
|
@ -224,14 +222,6 @@ input statsFilter {
|
|||
totalTaxPaid_lt: BigInt
|
||||
totalTaxPaid_gte: BigInt
|
||||
totalTaxPaid_lte: BigInt
|
||||
totalUbiClaimed: BigInt
|
||||
totalUbiClaimed_not: BigInt
|
||||
totalUbiClaimed_in: [BigInt]
|
||||
totalUbiClaimed_not_in: [BigInt]
|
||||
totalUbiClaimed_gt: BigInt
|
||||
totalUbiClaimed_lt: BigInt
|
||||
totalUbiClaimed_gte: BigInt
|
||||
totalUbiClaimed_lte: BigInt
|
||||
mintedLastWeek: BigInt
|
||||
mintedLastWeek_not: BigInt
|
||||
mintedLastWeek_in: [BigInt]
|
||||
|
|
@ -304,30 +294,38 @@ input statsFilter {
|
|||
taxPaidNextHourProjected_lt: BigInt
|
||||
taxPaidNextHourProjected_gte: BigInt
|
||||
taxPaidNextHourProjected_lte: BigInt
|
||||
ubiClaimedLastWeek: BigInt
|
||||
ubiClaimedLastWeek_not: BigInt
|
||||
ubiClaimedLastWeek_in: [BigInt]
|
||||
ubiClaimedLastWeek_not_in: [BigInt]
|
||||
ubiClaimedLastWeek_gt: BigInt
|
||||
ubiClaimedLastWeek_lt: BigInt
|
||||
ubiClaimedLastWeek_gte: BigInt
|
||||
ubiClaimedLastWeek_lte: BigInt
|
||||
ubiClaimedLastDay: BigInt
|
||||
ubiClaimedLastDay_not: BigInt
|
||||
ubiClaimedLastDay_in: [BigInt]
|
||||
ubiClaimedLastDay_not_in: [BigInt]
|
||||
ubiClaimedLastDay_gt: BigInt
|
||||
ubiClaimedLastDay_lt: BigInt
|
||||
ubiClaimedLastDay_gte: BigInt
|
||||
ubiClaimedLastDay_lte: BigInt
|
||||
ubiClaimedNextHourProjected: BigInt
|
||||
ubiClaimedNextHourProjected_not: BigInt
|
||||
ubiClaimedNextHourProjected_in: [BigInt]
|
||||
ubiClaimedNextHourProjected_not_in: [BigInt]
|
||||
ubiClaimedNextHourProjected_gt: BigInt
|
||||
ubiClaimedNextHourProjected_lt: BigInt
|
||||
ubiClaimedNextHourProjected_gte: BigInt
|
||||
ubiClaimedNextHourProjected_lte: BigInt
|
||||
ethReserveLastDay: BigInt
|
||||
ethReserveLastDay_not: BigInt
|
||||
ethReserveLastDay_in: [BigInt]
|
||||
ethReserveLastDay_not_in: [BigInt]
|
||||
ethReserveLastDay_gt: BigInt
|
||||
ethReserveLastDay_lt: BigInt
|
||||
ethReserveLastDay_gte: BigInt
|
||||
ethReserveLastDay_lte: BigInt
|
||||
ethReserveLastWeek: BigInt
|
||||
ethReserveLastWeek_not: BigInt
|
||||
ethReserveLastWeek_in: [BigInt]
|
||||
ethReserveLastWeek_not_in: [BigInt]
|
||||
ethReserveLastWeek_gt: BigInt
|
||||
ethReserveLastWeek_lt: BigInt
|
||||
ethReserveLastWeek_gte: BigInt
|
||||
ethReserveLastWeek_lte: BigInt
|
||||
netSupplyChangeDay: BigInt
|
||||
netSupplyChangeDay_not: BigInt
|
||||
netSupplyChangeDay_in: [BigInt]
|
||||
netSupplyChangeDay_not_in: [BigInt]
|
||||
netSupplyChangeDay_gt: BigInt
|
||||
netSupplyChangeDay_lt: BigInt
|
||||
netSupplyChangeDay_gte: BigInt
|
||||
netSupplyChangeDay_lte: BigInt
|
||||
netSupplyChangeWeek: BigInt
|
||||
netSupplyChangeWeek_not: BigInt
|
||||
netSupplyChangeWeek_in: [BigInt]
|
||||
netSupplyChangeWeek_not_in: [BigInt]
|
||||
netSupplyChangeWeek_gt: BigInt
|
||||
netSupplyChangeWeek_lt: BigInt
|
||||
netSupplyChangeWeek_gte: BigInt
|
||||
netSupplyChangeWeek_lte: BigInt
|
||||
ringBufferPointer: Int
|
||||
ringBufferPointer_not: Int
|
||||
ringBufferPointer_in: [Int]
|
||||
|
|
@ -474,101 +472,6 @@ input statsFilter {
|
|||
floorDistanceBps_lte: Int
|
||||
}
|
||||
|
||||
type ethReserveHistory {
|
||||
id: String!
|
||||
timestamp: BigInt!
|
||||
ethBalance: BigInt!
|
||||
}
|
||||
|
||||
type ethReserveHistoryPage {
|
||||
items: [ethReserveHistory!]!
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Int!
|
||||
}
|
||||
|
||||
input ethReserveHistoryFilter {
|
||||
AND: [ethReserveHistoryFilter]
|
||||
OR: [ethReserveHistoryFilter]
|
||||
id: String
|
||||
id_not: String
|
||||
id_in: [String]
|
||||
id_not_in: [String]
|
||||
id_contains: String
|
||||
id_not_contains: String
|
||||
id_starts_with: String
|
||||
id_ends_with: String
|
||||
id_not_starts_with: String
|
||||
id_not_ends_with: String
|
||||
timestamp: BigInt
|
||||
timestamp_not: BigInt
|
||||
timestamp_in: [BigInt]
|
||||
timestamp_not_in: [BigInt]
|
||||
timestamp_gt: BigInt
|
||||
timestamp_lt: BigInt
|
||||
timestamp_gte: BigInt
|
||||
timestamp_lte: BigInt
|
||||
ethBalance: BigInt
|
||||
ethBalance_not: BigInt
|
||||
ethBalance_in: [BigInt]
|
||||
ethBalance_not_in: [BigInt]
|
||||
ethBalance_gt: BigInt
|
||||
ethBalance_lt: BigInt
|
||||
ethBalance_gte: BigInt
|
||||
ethBalance_lte: BigInt
|
||||
}
|
||||
|
||||
type feeHistory {
|
||||
id: String!
|
||||
timestamp: BigInt!
|
||||
ethFees: BigInt!
|
||||
krkFees: BigInt!
|
||||
}
|
||||
|
||||
type feeHistoryPage {
|
||||
items: [feeHistory!]!
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Int!
|
||||
}
|
||||
|
||||
input feeHistoryFilter {
|
||||
AND: [feeHistoryFilter]
|
||||
OR: [feeHistoryFilter]
|
||||
id: String
|
||||
id_not: String
|
||||
id_in: [String]
|
||||
id_not_in: [String]
|
||||
id_contains: String
|
||||
id_not_contains: String
|
||||
id_starts_with: String
|
||||
id_ends_with: String
|
||||
id_not_starts_with: String
|
||||
id_not_ends_with: String
|
||||
timestamp: BigInt
|
||||
timestamp_not: BigInt
|
||||
timestamp_in: [BigInt]
|
||||
timestamp_not_in: [BigInt]
|
||||
timestamp_gt: BigInt
|
||||
timestamp_lt: BigInt
|
||||
timestamp_gte: BigInt
|
||||
timestamp_lte: BigInt
|
||||
ethFees: BigInt
|
||||
ethFees_not: BigInt
|
||||
ethFees_in: [BigInt]
|
||||
ethFees_not_in: [BigInt]
|
||||
ethFees_gt: BigInt
|
||||
ethFees_lt: BigInt
|
||||
ethFees_gte: BigInt
|
||||
ethFees_lte: BigInt
|
||||
krkFees: BigInt
|
||||
krkFees_not: BigInt
|
||||
krkFees_in: [BigInt]
|
||||
krkFees_not_in: [BigInt]
|
||||
krkFees_gt: BigInt
|
||||
krkFees_lt: BigInt
|
||||
krkFees_gte: BigInt
|
||||
krkFees_lte: BigInt
|
||||
}
|
||||
|
||||
type positions {
|
||||
id: String!
|
||||
owner: String!
|
||||
|
|
@ -820,6 +723,8 @@ input recentersFilter {
|
|||
type holders {
|
||||
address: String!
|
||||
balance: BigInt!
|
||||
totalEthSpent: BigInt!
|
||||
totalTokensAcquired: BigInt!
|
||||
}
|
||||
|
||||
type holdersPage {
|
||||
|
|
@ -849,4 +754,114 @@ input holdersFilter {
|
|||
balance_lt: BigInt
|
||||
balance_gte: BigInt
|
||||
balance_lte: BigInt
|
||||
totalEthSpent: BigInt
|
||||
totalEthSpent_not: BigInt
|
||||
totalEthSpent_in: [BigInt]
|
||||
totalEthSpent_not_in: [BigInt]
|
||||
totalEthSpent_gt: BigInt
|
||||
totalEthSpent_lt: BigInt
|
||||
totalEthSpent_gte: BigInt
|
||||
totalEthSpent_lte: BigInt
|
||||
totalTokensAcquired: BigInt
|
||||
totalTokensAcquired_not: BigInt
|
||||
totalTokensAcquired_in: [BigInt]
|
||||
totalTokensAcquired_not_in: [BigInt]
|
||||
totalTokensAcquired_gt: BigInt
|
||||
totalTokensAcquired_lt: BigInt
|
||||
totalTokensAcquired_gte: BigInt
|
||||
totalTokensAcquired_lte: BigInt
|
||||
}
|
||||
|
||||
type transactions {
|
||||
id: String!
|
||||
holder: String!
|
||||
type: String!
|
||||
tokenAmount: BigInt!
|
||||
ethAmount: BigInt!
|
||||
timestamp: BigInt!
|
||||
blockNumber: Int!
|
||||
txHash: String!
|
||||
}
|
||||
|
||||
type transactionsPage {
|
||||
items: [transactions!]!
|
||||
pageInfo: PageInfo!
|
||||
totalCount: Int!
|
||||
}
|
||||
|
||||
input transactionsFilter {
|
||||
AND: [transactionsFilter]
|
||||
OR: [transactionsFilter]
|
||||
id: String
|
||||
id_not: String
|
||||
id_in: [String]
|
||||
id_not_in: [String]
|
||||
id_contains: String
|
||||
id_not_contains: String
|
||||
id_starts_with: String
|
||||
id_ends_with: String
|
||||
id_not_starts_with: String
|
||||
id_not_ends_with: String
|
||||
holder: String
|
||||
holder_not: String
|
||||
holder_in: [String]
|
||||
holder_not_in: [String]
|
||||
holder_contains: String
|
||||
holder_not_contains: String
|
||||
holder_starts_with: String
|
||||
holder_ends_with: String
|
||||
holder_not_starts_with: String
|
||||
holder_not_ends_with: String
|
||||
type: String
|
||||
type_not: String
|
||||
type_in: [String]
|
||||
type_not_in: [String]
|
||||
type_contains: String
|
||||
type_not_contains: String
|
||||
type_starts_with: String
|
||||
type_ends_with: String
|
||||
type_not_starts_with: String
|
||||
type_not_ends_with: String
|
||||
tokenAmount: BigInt
|
||||
tokenAmount_not: BigInt
|
||||
tokenAmount_in: [BigInt]
|
||||
tokenAmount_not_in: [BigInt]
|
||||
tokenAmount_gt: BigInt
|
||||
tokenAmount_lt: BigInt
|
||||
tokenAmount_gte: BigInt
|
||||
tokenAmount_lte: BigInt
|
||||
ethAmount: BigInt
|
||||
ethAmount_not: BigInt
|
||||
ethAmount_in: [BigInt]
|
||||
ethAmount_not_in: [BigInt]
|
||||
ethAmount_gt: BigInt
|
||||
ethAmount_lt: BigInt
|
||||
ethAmount_gte: BigInt
|
||||
ethAmount_lte: BigInt
|
||||
timestamp: BigInt
|
||||
timestamp_not: BigInt
|
||||
timestamp_in: [BigInt]
|
||||
timestamp_not_in: [BigInt]
|
||||
timestamp_gt: BigInt
|
||||
timestamp_lt: BigInt
|
||||
timestamp_gte: BigInt
|
||||
timestamp_lte: BigInt
|
||||
blockNumber: Int
|
||||
blockNumber_not: Int
|
||||
blockNumber_in: [Int]
|
||||
blockNumber_not_in: [Int]
|
||||
blockNumber_gt: Int
|
||||
blockNumber_lt: Int
|
||||
blockNumber_gte: Int
|
||||
blockNumber_lte: Int
|
||||
txHash: String
|
||||
txHash_not: String
|
||||
txHash_in: [String]
|
||||
txHash_not_in: [String]
|
||||
txHash_contains: String
|
||||
txHash_not_contains: String
|
||||
txHash_starts_with: String
|
||||
txHash_ends_with: String
|
||||
txHash_not_starts_with: String
|
||||
txHash_not_ends_with: String
|
||||
}
|
||||
|
|
@ -216,6 +216,10 @@ export async function updateHourlyData(context: StatsContext, timestamp: bigint)
|
|||
const lastUpdate = statsData.lastHourlyUpdateTimestamp ?? 0n;
|
||||
|
||||
// Snapshot current holderCount into ring buffer slot 3
|
||||
// NOTE: Slot 3 migrated from cumulative tax to holderCount in PR #177.
|
||||
// Existing ring buffer data will contain stale tax values interpreted as
|
||||
// holder counts for up to 7 days (168 hours) post-deploy until the buffer
|
||||
// fully rotates. Data self-heals as new hourly snapshots overwrite old slots.
|
||||
const currentHolderCount = BigInt(statsData.holderCount ?? 0);
|
||||
const base = pointer * RING_BUFFER_SEGMENTS;
|
||||
ringBuffer[base + 3] = currentHolderCount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue