This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
152 lines (137 loc) · 2.96 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
type SmartVault implements Authorizer @entity {
id: ID!
wrappedNativeToken: ERC20!
priceOracle: String!
swapConnector: String!
bridgeConnector: String!
strategies: [String!]!
feeCollector: String!
swapFee: FeeConfig
bridgeFee: FeeConfig
withdrawFee: FeeConfig
performanceFee: FeeConfig
totalValueManaged: BigInt!
totalFeesUsd: BigInt!
totalGasRefundsUsd: BigInt!
totalRelayedCostUsd: BigInt!
actions: [Action!] @derivedFrom(field: "smartVault")
fees: [Fee!] @derivedFrom(field: "smartVault")
balances: [Balance!] @derivedFrom(field: "smartVault")
transactions: [Transaction!] @derivedFrom(field: "smartVault")
primitiveExecutions: [PrimitiveExecution!] @derivedFrom(field: "smartVault")
priceFeeds: [PriceFeed!] @derivedFrom(field: "smartVault")
permissions: [Permission!] @derivedFrom(field: "target")
}
type Action implements Authorizer @entity {
id: ID!
smartVault: SmartVault!
permissions: [Permission!] @derivedFrom(field: "target")
}
type Transaction @entity {
id: ID!
smartVault: SmartVault!
hash: String!
sender: String!
target: Bytes
gasUsed: BigInt!
gasPrice: BigInt!
costNative: BigInt!
costUsd: BigInt!
relayer: String!
executedAt: BigInt!
fees: [Fee!] @derivedFrom(field: "transaction")
primitiveExecutions: [PrimitiveExecution!] @derivedFrom(field: "transaction")
}
type PrimitiveExecution @entity {
id: ID!
type: Primitive!
smartVault: SmartVault!
transaction: Transaction!
data: String!
fee: Fee @derivedFrom(field: "primitiveExecution")
movements: [Movement!] @derivedFrom(field: "primitiveExecution")
}
enum Primitive {
Call
Collect
Withdraw
Wrap
Unwrap
Claim
Join
Exit
Swap
Bridge
}
type Movement @entity {
id: ID!
smartVault: SmartVault!
transaction: Transaction!
primitiveExecution: PrimitiveExecution!
destinationChainId: BigInt!
type: MovementType!
token: ERC20!
amount: BigInt!
}
enum MovementType {
In
Out
}
type Fee @entity {
id: ID!
smartVault: SmartVault!
transaction: Transaction!
primitiveExecution: PrimitiveExecution!
pct: BigInt!
token: ERC20!
amount: BigInt!
feeCollector: String!
}
type PriceFeed @entity {
id: ID!
smartVault: SmartVault!
base: ERC20!
quote: ERC20!
feed: String!
}
type FeeConfig @entity {
id: ID!
smartVault: SmartVault!
pct: BigInt!
cap: BigInt!
token: ERC20!
period: BigInt!
}
type Balance @entity {
id: ID!
smartVault: SmartVault!
token: ERC20!
amount: BigInt!
}
type ERC20 @entity {
id: ID!
name: String!
symbol: String!
decimals: Int!
}
interface Authorizer {
id: ID!
permissions: [Permission!] @derivedFrom(field: "target")
}
type Permission @entity {
id: ID!
method: String!
target: Authorizer!
grantees: [Grantee!] @derivedFrom(field: "permissions")
}
type Grantee @entity {
id: ID!
permissions: [Permission!]!
}
type Stats @entity {
id: ID!
totalValueManaged: BigInt!
totalFeesUsd: BigInt!
totalGasRefundsUsd: BigInt!
totalRelayedCostUsd: BigInt!
}