Skip to content

Commit b8f5e00

Browse files
committed
reduce size
1 parent 33d3b4c commit b8f5e00

File tree

3 files changed

+318
-319
lines changed

3 files changed

+318
-319
lines changed

schema.graphql

Lines changed: 86 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
enum TransferType {
2-
TRANSFER
3-
MINT
4-
BURN
5-
}
6-
7-
type Transfer @index(fields: ["token", ["blockTimestamp", "DESC"]]) {
8-
id: ID! # ${chainId}_${token}_${blockNumber}_${logIndex}
9-
chainId: Int!
10-
token: String!
11-
blockNumber: Int!
12-
blockTimestamp: Int!
13-
logIndex: Int!
14-
txHash: String! @index
15-
from: String!
16-
to: String!
17-
value: BigInt!
18-
transferType: TransferType!
19-
}
1+
# --- COMMENTED OUT: Transfer entity (largest table, ~25-35% of DB)
2+
# --- Raw transfer logs available from block explorers/RPC. Frontend uses AccountBalanceSnapshot instead.
3+
# enum TransferType {
4+
# TRANSFER
5+
# MINT
6+
# BURN
7+
# }
8+
#
9+
# type Transfer @index(fields: ["token", ["blockTimestamp", "DESC"]]) {
10+
# id: ID! # ${chainId}_${token}_${blockNumber}_${logIndex}
11+
# chainId: Int!
12+
# token: String!
13+
# blockNumber: Int!
14+
# blockTimestamp: Int!
15+
# logIndex: Int!
16+
# txHash: String! @index
17+
# from: String!
18+
# to: String!
19+
# value: BigInt!
20+
# transferType: TransferType!
21+
# }
2022

2123
type Account @index(fields: ["token", ["balance", "DESC"]]) {
2224
id: ID! # ${chainId}-${token}-${address}
@@ -28,9 +30,9 @@ type Account @index(fields: ["token", ["balance", "DESC"]]) {
2830
totalVolumeOut: BigInt!
2931
transfersIn: Int!
3032
transfersOut: Int!
31-
firstSeenBlock: Int!
33+
# firstSeenBlock: Int! # COMMENTED OUT: frontend only uses timestamp
3234
firstSeenTimestamp: Int!
33-
lastActiveBlock: Int!
35+
# lastActiveBlock: Int! # COMMENTED OUT: frontend only uses timestamp
3436
lastActiveTimestamp: Int!
3537
}
3638

@@ -50,23 +52,24 @@ type TokenSupply @index(fields: ["chainId", "token"]) {
5052
lastUpdatedTimestamp: Int!
5153
}
5254

53-
type HourlySnapshot @index(fields: ["token", ["hourId", "DESC"]]) {
54-
id: ID! # ${chainId}-${token}-${hourId}
55-
chainId: Int!
56-
token: String!
57-
hourId: Int!
58-
hourStartTimestamp: Int!
59-
volume: BigInt!
60-
transferCount: Int!
61-
mintVolume: BigInt!
62-
burnVolume: BigInt!
63-
netMintBurnFlow: BigInt!
64-
mintCount: Int!
65-
burnCount: Int!
66-
endOfHourSupply: BigInt!
67-
firstBlockOfHour: Int!
68-
lastBlockOfHour: Int!
69-
}
55+
# --- COMMENTED OUT: HourlySnapshot (not used by frontend, saves 1 read + 1 write/event)
56+
# type HourlySnapshot @index(fields: ["token", ["hourId", "DESC"]]) {
57+
# id: ID! # ${chainId}-${token}-${hourId}
58+
# chainId: Int!
59+
# token: String!
60+
# hourId: Int!
61+
# hourStartTimestamp: Int!
62+
# volume: BigInt!
63+
# transferCount: Int!
64+
# mintVolume: BigInt!
65+
# burnVolume: BigInt!
66+
# netMintBurnFlow: BigInt!
67+
# mintCount: Int!
68+
# burnCount: Int!
69+
# endOfHourSupply: BigInt!
70+
# firstBlockOfHour: Int!
71+
# lastBlockOfHour: Int!
72+
# }
7073

7174
type DailySnapshot @index(fields: ["token", ["dayId", "DESC"]]) {
7275
id: ID! # ${chainId}-${token}-${dayId}
@@ -76,50 +79,52 @@ type DailySnapshot @index(fields: ["token", ["dayId", "DESC"]]) {
7679
dayStartTimestamp: Int!
7780
dailyVolume: BigInt!
7881
dailyTransferCount: Int!
79-
dailyMintVolume: BigInt!
80-
dailyBurnVolume: BigInt!
81-
netMintBurnFlow: BigInt!
82-
dailyMintCount: Int!
83-
dailyBurnCount: Int!
82+
# dailyMintVolume: BigInt! # COMMENTED OUT: not queried by frontend
83+
# dailyBurnVolume: BigInt! # COMMENTED OUT: not queried by frontend
84+
# netMintBurnFlow: BigInt! # COMMENTED OUT: not queried by frontend
85+
# dailyMintCount: Int! # COMMENTED OUT: not queried by frontend
86+
# dailyBurnCount: Int! # COMMENTED OUT: not queried by frontend
8487
uniqueActiveAddresses: Int!
85-
newAddressCount: Int!
88+
# newAddressCount: Int! # COMMENTED OUT: not queried by frontend
8689
endOfDaySupply: BigInt!
8790
velocity: BigDecimal! @config(precision: 30, scale: 15)
88-
firstBlockOfDay: Int!
89-
lastBlockOfDay: Int!
91+
# firstBlockOfDay: Int! # COMMENTED OUT: not queried by frontend
92+
# lastBlockOfDay: Int! # COMMENTED OUT: not queried by frontend
9093
}
9194

92-
type WeeklySnapshot @index(fields: ["token", ["weekId", "DESC"]]) {
93-
id: ID! # ${chainId}-${token}-${weekId}
94-
chainId: Int!
95-
token: String!
96-
weekId: Int!
97-
weekStartTimestamp: Int!
98-
weeklyVolume: BigInt!
99-
weeklyTransferCount: Int!
100-
weeklyMintVolume: BigInt!
101-
weeklyBurnVolume: BigInt!
102-
netMintBurnFlow: BigInt!
103-
weeklyMintCount: Int!
104-
weeklyBurnCount: Int!
105-
uniqueActiveAddresses: Int!
106-
endOfWeekSupply: BigInt!
107-
velocity: BigDecimal! @config(precision: 30, scale: 15)
108-
firstBlockOfWeek: Int!
109-
lastBlockOfWeek: Int!
110-
}
95+
# --- COMMENTED OUT: WeeklySnapshot (not used by frontend, saves 1 read + 1 write + 1 BigDecimal/event)
96+
# type WeeklySnapshot @index(fields: ["token", ["weekId", "DESC"]]) {
97+
# id: ID! # ${chainId}-${token}-${weekId}
98+
# chainId: Int!
99+
# token: String!
100+
# weekId: Int!
101+
# weekStartTimestamp: Int!
102+
# weeklyVolume: BigInt!
103+
# weeklyTransferCount: Int!
104+
# weeklyMintVolume: BigInt!
105+
# weeklyBurnVolume: BigInt!
106+
# netMintBurnFlow: BigInt!
107+
# weeklyMintCount: Int!
108+
# weeklyBurnCount: Int!
109+
# uniqueActiveAddresses: Int!
110+
# endOfWeekSupply: BigInt!
111+
# velocity: BigDecimal! @config(precision: 30, scale: 15)
112+
# firstBlockOfWeek: Int!
113+
# lastBlockOfWeek: Int!
114+
# }
111115

112-
type CrossTokenDailySnapshot @index(fields: ["chainId", ["dayId", "DESC"]]) {
113-
id: ID! # ${chainId}-${dayId}
114-
chainId: Int!
115-
dayId: Int!
116-
dayStartTimestamp: Int!
117-
totalVolume: BigInt!
118-
totalTransferCount: Int!
119-
totalMintVolume: BigInt!
120-
totalBurnVolume: BigInt!
121-
netMintBurnFlow: BigInt!
122-
}
116+
# --- COMMENTED OUT: CrossTokenDailySnapshot (not used by frontend, computable from DailySnapshot)
117+
# type CrossTokenDailySnapshot @index(fields: ["chainId", ["dayId", "DESC"]]) {
118+
# id: ID! # ${chainId}-${dayId}
119+
# chainId: Int!
120+
# dayId: Int!
121+
# dayStartTimestamp: Int!
122+
# totalVolume: BigInt!
123+
# totalTransferCount: Int!
124+
# totalMintVolume: BigInt!
125+
# totalBurnVolume: BigInt!
126+
# netMintBurnFlow: BigInt!
127+
# }
123128

124129
type AccountBalanceSnapshot @index(fields: ["account", "token", ["blockTimestamp", "DESC"]]) {
125130
id: ID! # ${chainId}-${token}-${address}-${blockNumber}-${logIndex}
@@ -144,11 +149,12 @@ type AccountDailyActivity @index(fields: ["account", "token", ["dayId", "DESC"]]
144149
volumeOut: BigInt!
145150
}
146151

147-
# Marker entities for unique address deduplication per period
152+
# Marker entity for unique address deduplication per day
148153
type DailyActiveAddress {
149154
id: ID! # ${chainId}-${token}-${dayId}-${address}
150155
}
151156

152-
type WeeklyActiveAddress {
153-
id: ID! # ${chainId}-${token}-${weekId}-${address}
154-
}
157+
# --- COMMENTED OUT: WeeklyActiveAddress (only needed by WeeklySnapshot which is removed)
158+
# type WeeklyActiveAddress {
159+
# id: ID! # ${chainId}-${token}-${weekId}-${address}
160+
# }

0 commit comments

Comments
 (0)