forked from reflexer-labs/geb-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
1571 lines (1074 loc) · 37.8 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# --- Safes & Users ---
type Safe @entity {
" Equal to: <SafeHandler>-<CollateralType> "
id: ID!
" Safe ID if this Safe was created through the Safe Manager (GebSafeManager) "
safeId: BigInt
" Collateral type associated with this Safe "
collateralType: CollateralType!
" Amount of collateral locked in the Safe "
collateral: BigDecimal!
" Outstanding Safe debt "
debt: BigDecimal!
" The address of the Safe handler (ownership at the SAFEEngine level if the Safe was created using GebSafeManager) "
safeHandler: Bytes!
" Address of the Safe owner (top level ownership)"
owner: User!
" Optional proxy address (if the owner used a proxy to create the Safe) "
proxy: UserProxy
" Timestamp of the block at which this Safe was opened [seconds] "
createdAt: BigInt!
" Block number at which this Safe was opened "
createdAtBlock: BigInt!
" Hash of the transaction that opened the Safe "
createdAtTransaction: Bytes!
" Collateral balance of the safeHandler "
internalCollateralBalance: InternalCollateralBalance
" Coin balance of the safe handler "
internalCoinBalance: InternalCoinBalance
" Timestamp of the block at which this Safe was last modified [seconds] "
modifiedAt: BigInt
" Block number at which this Safe was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified the Safe "
modifiedAtTransaction: Bytes
" List of CRatio changes "
modifySAFECollateralization: [ModifySAFECollateralization!] @derivedFrom(field: "safe")
" List of discount auctions associated with this Safe "
liquidationDiscount: [DiscountAuction!] @derivedFrom(field: "safe")
" List of English auctions associated with this Safe "
liquidationEnglish: [EnglishAuction!] @derivedFrom(field: "safe")
" Saviour contract helping to prevent liquidation"
saviour: SafeSaviour
}
type User @entity {
" Account ID "
id: ID!
" Account address "
address: Bytes!
" List of proxies associated with the user's address (for now limited to maximum one) "
proxies: [UserProxy!] @derivedFrom(field: "owner")
" List of Safes owned by this user "
safes: [Safe!] @derivedFrom(field: "owner")
" List of collateral balances "
collateralBalance: [InternalCollateralBalance!] @derivedFrom(field: "owner")
" List of system coin balances "
coinBalance: [InternalCoinBalance!] @derivedFrom(field: "owner")
" List of debt balances "
debtBalance: [InternalDebtBalance!] @derivedFrom(field: "owner")
" List of collateral deposits made into the system "
collateralJoinTransactions: CollateralJoinTransaction @derivedFrom(field: "owner")
" List of collateral withdrawals made out of the system "
collateralExitTransactions: CollateralExitTransaction @derivedFrom(field: "owner")
" List of system coin deposits made into the system "
coinJoinTransactions: CoinJoinTransaction @derivedFrom(field: "owner")
" List of system coin withdrawals made out of the system "
coinExitTransactions: CoinExitTransaction @derivedFrom(field: "owner")
}
type UserProxy @entity {
" Proxy address "
id: ID!
" Proxy contract address "
address: Bytes!
" Cache contract address "
cache: Bytes!
" Allowance of the proxy to spend its owner RAIs (Useful when we need to repay debt)"
coinAllowance: ERC20Allowance
" Allowance of the proxy to spend its owner prot tokens (Useful when we need to repay debt)"
protAllowance: ERC20Allowance
" Allowance of the proxy to spend its owner uni LP shares (Useful when we need to repay debt)"
uniCoinLpAllowance: ERC20Allowance
" Owner address "
owner: User!
}
type SafeHandlerOwner @entity {
# Used to look up the owner of a safeHandler. Only for Safes managed through the GebSafeManager
" safeHandler address "
id: ID!
" Owner of the safeHandler address (if the Safe is owner by a proxy this will be the proxy's owner) "
owner: User!
}
type ModifySAFECollateralization @entity {
" Equal to: <TX hash>-<Log index> "
id: ID!
" Safe modified "
safe: Safe!
" safeHandler address (ownership at the SAFEEngine level) "
safeHandler: Bytes!
" Collateral type of the modification "
collateralType: CollateralType!
" Change in collateral "
deltaCollateral: BigDecimal!
" Change in debt "
deltaDebt: BigDecimal!
" Accumulated rate at the time of the transaction "
accumulatedRate: BigDecimal!
" Timestamp of the modification [seconds] "
createdAt: BigInt!
" Block number at which the modification happened "
createdAtBlock: BigInt!
" Hash of the transaction that made the modification "
createdAtTransaction: Bytes!
}
type ConfiscateSAFECollateralAndDebt @entity {
" Equal to: <TX hash>-<Log index> "
id: ID!
" Safe modified "
safe: Safe!
" safeHandler address (ownership at the SAFEEngine level) "
safeHandler: Bytes!
" Collateral type of the confisaction "
collateralType: CollateralType!
" Change in collateral "
deltaCollateral: BigDecimal!
" Change in debt "
deltaDebt: BigDecimal!
" Who to give/take the debt to "
debtCounterparty: Bytes!
" Who to give/take the collateral to "
collateralCounterparty: Bytes!
" Total amount of unbacked debt "
globalUnbackedDebt: BigDecimal!
" Timestamp of the confiscation [seconds] "
createdAt: BigInt!
" Block number at which the confiscation happened "
createdAtBlock: BigInt!
" Hash of the transaction that made the confiscation "
createdAtTransaction: Bytes!
}
type TransferSAFECollateralAndDebt @entity {
" Equal to: <TX hash>-<Log index> "
id: ID!
" Collateral type of the transfer "
collateralType: CollateralType!
" Destination safe "
dstSafe: Safe!
" Source safe "
srcSafe: Safe!
" Change in collateral "
deltaCollateral: BigDecimal!
" Change in debt "
deltaDebt: BigDecimal!
" Source safe handler "
srcHandler: Bytes!
" Destionation safe handler "
dstHandler: Bytes!
" Timestamp of the transfer [seconds] "
createdAt: BigInt!
" Block number at which the transfer happened "
createdAtBlock: BigInt!
" Hash of the transaction that made the transfer "
createdAtTransaction: Bytes!
}
type SafeSaviour @entity {
" Contract address "
id: ID!
" List of safe protected by the saviour "
safes: [Safe!] @derivedFrom(field: "saviour")
" If the saviour is currently allowed in the liquidation engine "
allowed: Boolean!
" Counter of successful save "
successSaveCount: BigInt!
" Counter of failed save "
failSaveCount: BigInt!
}
type UpdateAccumulatedRate @entity {
" Equal to: <TX hash>-<Log index> "
id: ID!
" Collateral type of the modification "
collateralType: CollateralType!
" Rate multiplier applied to globalDebt "
rateMultiplier: BigDecimal!
" Total accumulated rate "
accumulatedRate: BigDecimal!
" Global debt "
globalDebt: BigDecimal!
" Timestamp of the event [seconds] "
createdAt: BigInt!
" Block number at which the event happened "
createdAtBlock: BigInt!
" Hash of the transaction that made the event "
createdAtTransaction: Bytes!
}
# --- System state --
type CollateralType @entity {
" Collateral type name "
id: ID!
# == Safe stats ==
" Total debt backed by this collateral type "
debtAmount: BigDecimal!
" Total collateral deposited in the system (deposited in this collateral's specific adapter) "
totalCollateral: BigDecimal!
" Total collateral deposited in the system and locked in Safes "
totalCollateralLockedInSafes: BigDecimal!
" Total interest accrued on this collateral type "
accumulatedRate: BigDecimal!
" Number of Safes backed by this collateral type and NOT opened through the manager (GebSafeManager) "
unmanagedSafeCount: BigInt!
" Number of Safes backed by this collateral type that were opened through the manager (GebSafeManager) "
safeCount: BigInt!
# == Prices ==
" Current market price "
currentPrice: CollateralPrice
" Latest Coin FSM update "
currentFsmUpdate: FsmUpdate
# == Constants ==
" Address of the FSM contract used for this collateral type "
fsmAddress: Bytes
" Per second stability fee "
stabilityFee: BigDecimal!
" Total annualized stability calculated with solidity. It takes into account the global SF. Equals to (global SF + collateral SF)^(second per year)"
totalAnnualizedStabilityFee: BigDecimal!
" Debt ceiling/upper limit "
debtCeiling: BigDecimal!
" Minimum permitted debt per Safe/lower limit "
debtFloor: BigDecimal!
" Collateral price with safety margin. Used to limit the amount of debt that can be generated per one unit of collateral "
safetyCRatio: BigDecimal!
" Collateral price with liquidation margin. Used only in LiquidationEngine when a Safe is liquidated "
liquidationCRatio: BigDecimal!
# == Auction/Liquidations ==
" Penalty applied to every liquidation involving this collateral type "
liquidationPenalty: BigDecimal!
" Address of the auction smart contract handling this collateral type "
collateralAuctionHouseAddress: Bytes!
" Type of collateral auction "
auctionType: AuctionType
" Max amount of system coins to sell in one auction "
liquidationQuantity: BigDecimal
" Number of liquidations started "
liquidationsStarted: BigInt!
" Number of active liquidations "
activeLiquidations: BigInt!
" Auction configuration (English only) "
englishAuctionConfiguration: EnglishAuctionConfiguration
# == Time ==
" Time of the last stability fee update "
stabilityFeeLastUpdatedAt: BigInt!
" Timestamp of the block at which this collateral type was added [seconds] "
createdAt: BigInt!
" Block number at which this collateral type was added "
createdAtBlock: BigInt!
" Hash of the transaction that added this collateral type "
createdAtTransaction: Bytes!
" Timestamp of the block at which this collateral type was last modified [seconds] "
modifiedAt: BigInt
" Block number at which this collateral type was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified this collateral type "
modifiedAtTransaction: Bytes
}
type SystemState @entity {
" Singleton entity. Always set to 'current' "
id: ID!
" Number of Safes opened through the manager (GebSafeManager) "
safeCount: BigInt!
" Number of Safes NOT opened through the manager (GebSafeManager) "
unmanagedSafeCount: BigInt!
" Total number of Safes with debt > 0 and/or collateral > 0"
totalActiveSafeCount: BigInt!
" Number of user proxies created "
proxyCount: BigInt!
" Total debt issued across all collateral types "
globalDebt: BigDecimal!
" Global debt from 24h ago to calculate 24h TVL % change "
globalDebt24hAgo: BigDecimal!
" Total unbacked debt across all collateral types "
globalUnbackedDebt: BigDecimal!
" Global debt ceiling "
globalDebtCeiling: BigDecimal!
" Individual safe debt limit "
perSafeDebtCeiling: BigDecimal!
" Number of collateral types registered "
collateralCount: BigInt!
" Base per second stability fee applied to all collateral types "
globalStabilityFee: BigDecimal!
" Savings rate "
savingsRate: BigDecimal!
" Number of collateral auctions started "
collateralAuctionCount: BigInt!
" Latest redemption rate"
currentRedemptionRate: RedemptionRate
" Latest redemption price "
currentRedemptionPrice: RedemptionPrice
" Latest Coin medianizer update "
currentCoinMedianizerUpdate: MedianizerUpdate
" Total supply of COIN outside of the system, equals to ERC20.totalSupply() of Coin "
erc20CoinTotalSupply: BigDecimal!
" Last time the periodic update function was called"
lastPeriodicUpdate: BigInt!
" Timestamp of the block at which the system was created [seconds] "
createdAt: BigInt!
" Coin contract address "
coinAddress: Bytes!
" WETH collateral address "
wethAddress: Bytes!
" Coin uniswap pair address "
coinUniswapPair: UniswapPair
" System surplus in the accounting engine "
systemSurplus: BigDecimal!
" Debt available to settle in the accounting engine "
debtAvailableToSettle: BigDecimal!
" Block number at which the system was created "
createdAtBlock: BigInt!
" Hash of the transaction that started to create the system "
createdAtTransaction: Bytes!
" Timestamp of the block at which the system was last modified [seconds] "
modifiedAt: BigInt
" Block number at which the system was last modified "
modifiedAtBlock: BigInt
" Transaction hash at which the system was last modified "
modifiedAtTransaction: Bytes
}
type AccountingEngine @entity {
" Always set th 'current' "
id: ID!
" Total debt in the queue (that the system tries to cover with collateral auctions) "
totalQueuedDebt: BigDecimal!
" Total debt being auctioned in DebtAuctionHouse "
totalOnAuctionDebt: BigDecimal!
" When the last surplus auction was triggered "
lastSurplusAuctionTime: BigInt
" Delay between surplus auctions "
surplusAuctionDelay: BigInt!
" Delay after which debt can be popped from the debtQueue (from the moment it's added) "
popDebtDelay: BigInt!
" Amount of protocol tokens to be minted after a debt auction "
initialDebtAuctionMintedTokens: BigDecimal!
" Amount of debt sold in one debt auction "
debtAuctionBidSize: BigDecimal!
" Amount of surplus stability fees sold in one surplus auction "
surplusAuctionAmountToSell: BigDecimal!
" Amount of stability fees that need to accrue in the engine before any surplus auction can start "
surplusBuffer: BigDecimal!
" Time to wait (post settlement) until any remaining surplus can be transferred to the settlement surplus auctioneer "
disableCooldown: BigInt!
" When the contract was disabled "
disableTimestamp: BigInt
" Whether this contract is enabled or not "
contractEnabled: Boolean!
" Safe database "
safeEngine: Bytes!
" Contract that handles auctions for surplus stability fees "
surplusAuctionHouse: Bytes!
" Number debt auctions since the beginning "
debtAuctionCount: BigInt!
" Number debt auctions since the beginning "
surplusAuctionCount: BigInt!
" Currently ongoing debt auction "
activeDebtAuctions: BigInt!
" Currently ongoing surplus auction "
activeSurplusAuctions: BigInt!
" Contract that handles auctions for debt that couldn't be covered by collateral auctions "
debtAuctionHouse: Bytes!
" Permissions registry dictating who can burn and mint protocol tokens "
protocolTokenAuthority: Bytes!
" Addredd of the contract that auctions extra surplus after settlement is triggered "
postSettlementSurplusDrain: Bytes!
" Timestamp of the block at which the Accounting engine was last modified [seconds] "
modifiedAt: BigInt
" Block number at which the Accounting engine was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified the accounting engine "
modifiedAtTransaction: Bytes
}
# --- Balances & Deposits/Withdrawals ---
type InternalCollateralBalance @entity {
" Equal to: <accountHandler>-<CollateralType> "
id: ID!
" Account ownership at the SafeEngine level "
accountHandler: Bytes!
" Ultimate owner of the balance "
owner: User!
" Collateral type "
collateralType: CollateralType!
" Proxy address (if the balance belongs to a proxy) "
proxy: UserProxy
" Actual balance "
balance: BigDecimal!
" Timestamp of the block at which this balance was created [seconds] "
createdAt: BigInt!
" Block number at which this balance was created "
createdAtBlock: BigInt!
" Hash of the transaction that created this balance "
createdAtTransaction: Bytes!
" Timestamp of the block at which this balance was last modified [seconds] "
modifiedAt: BigInt
" Block number at which this balance was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified this transaction "
modifiedAtTransaction: Bytes
}
type InternalCoinBalance @entity {
" Equals to: <accountHandler> "
id: ID!
" Account ownership at the SafeEngine level "
accountHandler: Bytes!
" Ultimate owner of the balance (the accountHandler or the proxy)"
owner: User!
" Proxy address (if the balance belongs to a proxy) "
proxy: UserProxy
" Actual balance "
balance: BigDecimal!
" Timestamp of the block at which this balance was first created [seconds] "
createdAt: BigInt!
" Block number at which this balance was first created "
createdAtBlock: BigInt!
" Hash of the transaction that first created this balance "
createdAtTransaction: Bytes!
" Timestamp of the block at which this balance was last modified [seconds] "
modifiedAt: BigInt
" Block number at which this balance was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified this balance "
modifiedAtTransaction: Bytes
}
type InternalDebtBalance @entity {
" Equal to: <accountHandler> "
id: ID!
" Account ownership at the SafeEngine level "
accountHandler: Bytes!
" Ultimate owner of the balance (the accountHandler or the proxy)"
owner: User!
" Actual balance "
balance: BigDecimal!
" Timestamp of the block at which this balance was created [seconds] "
createdAt: BigInt!
" Block number at which this balance was created "
createdAtBlock: BigInt!
" Hash of the transaction that first created this balance "
createdAtTransaction: Bytes!
" Timestamp of the block at which this balance was last modified [seconds] "
modifiedAt: BigInt
" Block number in which this balance was last modified "
modifiedAtBlock: BigInt
" Hash of the transaction that last modified this balance "
modifiedAtTransaction: Bytes
}
type CollateralJoinTransaction @entity {
"Equal to: <TX hash>-<Log index>"
id: ID!
" Joined amount "
amount: BigDecimal!
" Safe handler being credited "
safeHandler: Bytes!
" Owner of the safeHandler "
owner: User!
" Source of the collateral"
source: Bytes!
" Collateral type handled by the CollateralJoin contract "
collateralType: CollateralType!
" Timestamp of the block at which this join action happened [seconds] "
createdAt: BigInt!
" Block number at which this join action happened "
createdAtBlock: BigInt!
" Hash of the join transaction "
createdAtTransaction: Bytes!
}
type CollateralExitTransaction @entity {
"<TX hash>-<Log index>"
id: ID!
" Exited amount "
amount: BigDecimal!
" Safe handler being debited "
safeHandler: Bytes
" Owner of the safeHandler "
owner: User!
" Account receiving the exited collateral "
recipient: Bytes!
" Collateral type exited "
collateralType: CollateralType!
" Timestamp of the block at which this exit was executed [seconds] "
createdAt: BigInt!
" Block number at which this exit was executed "
createdAtBlock: BigInt!
" Transaction hash at which this exit was executed "
createdAtTransaction: Bytes!
}
type CoinJoinTransaction @entity {
"Equal to: <TX hash>-<Log index>"
id: ID!
" Joined amount "
amount: BigDecimal!
" Safe handler being credited "
safeHandler: Bytes!
" Owner of the safeHandler "
owner: User!
" Source address of the coins "
source: Bytes!
" Timestamp of the block at which this transaction was executed [seconds] "
createdAt: BigInt!
" Block number at which this transaction was executed "
createdAtBlock: BigInt!
" Hash of the transaction that executed the join "
createdAtTransaction: Bytes!
}
type CoinExitTransaction @entity {
"<TX hash>-<Log index>"
id: ID!
" Exited amount "
amount: BigDecimal!
" Safe handler owning the balance at the SAFEEngine level "
safeHandler: Bytes!
" Owner of the safeHandler "
owner: User!
" Account that received the coins "
recipient: Bytes!
" Timestamp of the block at which this transaction was executed [seconds] "
createdAt: BigInt!
" Block number at which this transaction was executed "
createdAtBlock: BigInt!
" Hash of the transaction that executed this exit "
createdAtTransaction: Bytes!
}
# --- Prices ---
type CollateralPrice @entity {
" Equal to: <tx hash>-<log index>"
id: ID!
" Block number "
block: BigInt!
" Timestamp in seconds "
timestamp: BigInt!
" Collateral type "
collateral: CollateralType!
" Price of the collateral divided by the redemptionPrice and then divided again by the safetyCRatio "
safetyPrice: BigDecimal!
" Price of the collateral divided by the redemptionPrice and then divided again by the liquidationCRatio "
liquidationPrice: BigDecimal!
" Collateral price in denomination currency "
value: BigDecimal!
}
type RedemptionPrice @entity {
" Equals to: <tx hash>-<log index>"
id: ID!
" Block number "
block: BigInt!
" Timestamp in seconds "
timestamp: BigInt!
" The rate of change of the redemption price "
redemptionRate: BigDecimal!
" Redemption price value "
value: BigDecimal!
}
type RedemptionRate @entity {
" Equal to: <tx hash>-<log index>"
id: ID!
" The rate of change of the redemption price "
perSecondRate: BigDecimal!
" 8 hour redemption rate "
eightHourlyRate: BigDecimal!
" 24 hour redemption rate "
twentyFourHourlyRate: BigDecimal!
" One hour redemption rate "
hourlyRate: BigDecimal!
" Annualized redemption rate "
annualizedRate: BigDecimal!
" Timestamp of the block at which this rate was created [seconds] "
createdAt: BigInt!
" Block number at which this rate was created "
createdAtBlock: BigInt!
" Hash of the transaction that created this rate "
createdAtTransaction: Bytes!
}
# --- Oracles ---
type FsmUpdate @entity {
" Equal to: <tx hash>-<log index>"
id: ID!
" FSM address "
fsmAddress: Bytes!
" Price of the update "
value: BigDecimal!
" Next price update "
nextValue: BigDecimal!
" Next update timestamp "
nextUpdateMinTimestamp: BigInt!
" Timestamp of the block at which this transaction was executed [seconds] "
createdAt: BigInt!
" Block number at which this transaction was executed "
createdAtBlock: BigInt!
" Hash of the transaction that executed this exit "
createdAtTransaction: Bytes!
}
type MedianizerUpdate @entity {
" Equal to: <tx hash>-<log index>"
id: ID!
" FSM address "
medianizerAddress: Bytes!
" Price pair symbol"
symbol: String!
" The rate of change of the redemption price "
value: BigDecimal!
" Timestamp of the block at which this transaction was executed [seconds] "
createdAt: BigInt!
" Block number at which this transaction was executed "
createdAtBlock: BigInt!
" Hash of the transaction that executed this exit "
createdAtTransaction: Bytes!
}
# --- Auctions ---
enum AuctionType {
ENGLISH
FIXED_DISCOUNT
INCREASING_DISCOUNT
}
type EnglishAuctionConfiguration @entity {
" Collateral type name, 'DEBT' or 'SURPLUS' "
id: ID!
" Collateral type "
LIQUIDATION_collateralType: CollateralType
" Minimum bid increase (e.g 1.05 means a minimum 5% increase for the next bid compared to the current one) "
bidIncrease: BigDecimal!
" How long the auction lasts after a new bid is submitted "
bidDuration: BigInt
" Maximum auction length "
totalAuctionLength: BigInt!
" Increase in amount sold upon auction restart (used only for DEBT auctions) "
DEBT_amountSoldIncrease: BigDecimal
}
type EnglishAuctionBid @entity {
" Collateral type name or 'DEBT', 'SURPLUS_PRE' or 'SURPLUS_POST'. Equal to: <collateral type>-<auction id>-<bid number> "
id: ID!
" Incremental bid id "
bidNumber: BigInt!
" Bid type, either increase buy or decrease sell "
type: EnglishBidType!
" Auction to which the bid belongs (if it's a bid on a collateral auction) "
auction: EnglishAuction
" How many tokens/coins are sold in the auction "
sellAmount: BigDecimal!
" How many tokens are being bought from the auction "
buyAmount: BigDecimal!
" Price of the asset being sold (sellAmount / buyAmount) "
price: BigDecimal!
" Bidder address "
bidder: Bytes
" Timestamp of the block at which the liquidation started "
createdAt: BigInt!
" Block number at which the liquidation started "
createdAtBlock: BigInt!
" Hash of the transaction that started the liquidation "
createdAtTransaction: Bytes!
}
# --- English Auction ---
enum EnglishAuctionType {
LIQUIDATION
DEBT
SURPLUS
STAKED_TOKEN
}
enum AuctionToken {
COIN
COLLATERAL
PROTOCOL_TOKEN
PROTOCOL_TOKEN_LP
}
enum EnglishBidType {
INCREASE_BUY
DECREASE_SOLD
}
type EnglishAuction @entity {
" Collateral type name or 'DEBT', 'SURPLUS_PRE' or 'SURPLUS_POST'. Equal toL <collateral type>-<auction id> "
id: ID!
" Incremental auction id "
auctionId: BigInt!
" Whether the auction handles collateral, surplus or debt "
englishAuctionType: EnglishAuctionType!
" Token/coin being sold "
sellToken: AuctionToken!
" Token/coin being bought "
buyToken: AuctionToken!
" Amount of tokens that the system is selling at the start of the auction "
sellInitialAmount: BigDecimal!
" Amount of tokens that the system is buying at the start of the auction "
buyInitialAmount: BigDecimal!
" Amount of tokens that the system is currently selling in the auction "
sellAmount: BigDecimal!