@zkp2p/indexer-schema 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types.d.ts +476 -0
- package/dist/types.ts +477 -0
- package/docs/schema-field-reference.md +1391 -0
- package/llms.txt +660 -0
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,379 +1,855 @@
|
|
|
1
1
|
// Auto-generated from schema/domain.graphql
|
|
2
2
|
|
|
3
3
|
export enum DepositStatus {
|
|
4
|
+
/** Deposit can still participate in the maker lifecycle. Whether it is currently quoteable also depends on `acceptingIntents`, remaining liquidity, payment-method activity, and a non-zero resolved rate. */
|
|
4
5
|
ACTIVE = 'ACTIVE',
|
|
6
|
+
/** Deposit has been explicitly closed on-chain. Quote candidates for closed deposits are deleted. */
|
|
5
7
|
CLOSED = 'CLOSED',
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export enum IntentStatus {
|
|
11
|
+
/** Intent exists and funds may be locked, but settlement is not final yet. */
|
|
9
12
|
SIGNALED = 'SIGNALED',
|
|
13
|
+
/** Intent completed normally. */
|
|
10
14
|
FULFILLED = 'FULFILLED',
|
|
15
|
+
/** Intent was cancelled/unlocked on-chain. */
|
|
11
16
|
PRUNED = 'PRUNED',
|
|
17
|
+
/** Funds were released through the manual-release path rather than the normal verifier path. */
|
|
12
18
|
MANUALLY_RELEASED = 'MANUALLY_RELEASED',
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
export enum PriceSnapshotStatus {
|
|
22
|
+
/** Snapshot was fetched during normal live indexing. */
|
|
16
23
|
LIVE = 'LIVE',
|
|
24
|
+
/** Snapshot was created during historical catch-up or another non-live backfill flow. */
|
|
17
25
|
BACKFILL = 'BACKFILL',
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
export enum ProfitStatus {
|
|
29
|
+
/** Profit could be computed because a usable FX snapshot existed. */
|
|
21
30
|
COMPUTED = 'COMPUTED',
|
|
31
|
+
/** Profit row exists, but the oracle side of the comparison was unavailable at write time. */
|
|
22
32
|
PENDING = 'PENDING',
|
|
23
33
|
}
|
|
24
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Canonical maker-owned escrow position. This is the root entity for most business queries. Deposit rows are created from deposit-received events and then mutated by funding, withdrawal, closing, intent lock/unlock, delegated-rate-manager, and oracle-resolution flows.
|
|
37
|
+
*
|
|
38
|
+
* @id escrowAddress_depositId
|
|
39
|
+
*
|
|
40
|
+
* **Relationships:**
|
|
41
|
+
* - Parent of `Intent`, `DepositPaymentMethod`, `MethodCurrency`, `DepositFundActivity`, and `DepositDailySnapshot`
|
|
42
|
+
* - Indirect source for `QuoteCandidate`
|
|
43
|
+
* - Optional many-to-one relationship to `RateManager`
|
|
44
|
+
* - Source record for `MakerStats`, `ManagerStats`, and manager aggregate balances
|
|
45
|
+
*/
|
|
25
46
|
export interface Deposit {
|
|
47
|
+
/** Canonical deposit key `escrowAddress_depositId`. This exists because raw on-chain `depositId` is not globally unique across escrows. */
|
|
26
48
|
id: string;
|
|
49
|
+
/** Chain where the escrow contract lives. */
|
|
27
50
|
chainId: number;
|
|
51
|
+
/** Escrow contract address that owns the deposit funds and scopes the deposit namespace. */
|
|
28
52
|
escrowAddress: string;
|
|
53
|
+
/** Raw on-chain deposit identifier emitted by the escrow contract. */
|
|
29
54
|
depositId: string;
|
|
55
|
+
/** Maker address that created and owns the deposit. */
|
|
30
56
|
depositor: string;
|
|
57
|
+
/** ERC20 token being sold. In practice the indexer only materializes supported USDC addresses. */
|
|
31
58
|
token: string;
|
|
59
|
+
/** Address currently allowed to manage deposit settings on behalf of the maker. */
|
|
32
60
|
delegate: string;
|
|
61
|
+
/** Smallest token amount the maker will accept for a single intent. */
|
|
33
62
|
intentAmountMin: string;
|
|
63
|
+
/** Largest token amount the maker will accept for a single intent. */
|
|
34
64
|
intentAmountMax: string;
|
|
65
|
+
/** Explicit maker toggle. Quotes should be suppressed when this is `false` even if liquidity still exists. */
|
|
35
66
|
acceptingIntents: boolean;
|
|
67
|
+
/** Coarse lifecycle state. `CLOSED` means the deposit was explicitly closed; it is stronger than merely having no liquidity. */
|
|
36
68
|
status: DepositStatus;
|
|
69
|
+
/** Immediately available maker liquidity that can still be locked into new intents or withdrawn. */
|
|
37
70
|
remainingDeposits: string;
|
|
71
|
+
/** Liquidity currently reserved by signaled intents that have not been fully resolved yet. */
|
|
38
72
|
outstandingIntentAmount: string;
|
|
73
|
+
/** All-time amount that actually left the deposit to takers through fulfillment or manual release. */
|
|
39
74
|
totalAmountTaken: string;
|
|
75
|
+
/** All-time amount withdrawn back to the maker through withdrawal events. */
|
|
40
76
|
totalWithdrawn: string;
|
|
77
|
+
/** Total number of intents ever locked against the deposit. */
|
|
41
78
|
totalIntents: number;
|
|
79
|
+
/** Count of intent-lock events seen for this deposit. */
|
|
42
80
|
signaledIntents: number;
|
|
81
|
+
/** Count of intents that finished successfully or via manual release. */
|
|
43
82
|
fulfilledIntents: number;
|
|
83
|
+
/** Count of intents that were unlocked/cancelled without fulfillment. */
|
|
44
84
|
prunedIntents: number;
|
|
85
|
+
/** Deposit-level quality score in basis points. New deposits start at `10000`; later it tracks `fulfilled / total` in basis points. */
|
|
45
86
|
successRateBps: number;
|
|
87
|
+
/** Block in which the deposit was first seen. */
|
|
46
88
|
blockNumber: string;
|
|
89
|
+
/** Creation timestamp from the deposit-received event. */
|
|
47
90
|
timestamp: string;
|
|
91
|
+
/** Transaction that created the deposit row. */
|
|
48
92
|
txHash: string;
|
|
93
|
+
/** Timestamp of the most recent mutation to this deposit row. */
|
|
49
94
|
updatedAt: string;
|
|
95
|
+
/** Optional delegated rate-manager identifier currently assigned to the deposit. */
|
|
50
96
|
rateManagerId?: string;
|
|
97
|
+
/** Optional rate-manager contract address paired with `rateManagerId`. */
|
|
51
98
|
rateManagerAddress?: string;
|
|
99
|
+
/** Timestamp when the current delegated manager assignment was applied. */
|
|
52
100
|
delegatedAt?: string;
|
|
53
101
|
}
|
|
54
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Deposit-scoped payment platform configuration. Each row says "this deposit accepts this payment-method hash, with these payee details and optional gating requirements."
|
|
105
|
+
*
|
|
106
|
+
* @id escrowAddress_depositId_paymentMethodHash
|
|
107
|
+
*
|
|
108
|
+
* **Relationships:**
|
|
109
|
+
* - Many-to-one to `Deposit` through `depositId`
|
|
110
|
+
* - Logical sibling of `MethodCurrency` on `(depositId, paymentMethodHash)`
|
|
111
|
+
* - One of the three source entities used to materialize `QuoteCandidate`
|
|
112
|
+
*/
|
|
55
113
|
export interface DepositPaymentMethod {
|
|
114
|
+
/** Composite key `escrowAddress_depositId_paymentMethodHash`. */
|
|
56
115
|
id: string;
|
|
116
|
+
/** Chain where the parent deposit lives. */
|
|
57
117
|
chainId: number;
|
|
118
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
58
119
|
depositId: string;
|
|
120
|
+
/** Raw on-chain deposit id copied for convenience and external correlation. */
|
|
59
121
|
depositIdOnContract: string;
|
|
122
|
+
/** Canonical bytes32-like payment-method identifier used by contracts and quoting. */
|
|
60
123
|
paymentMethodHash: string;
|
|
124
|
+
/** Optional external service address/string that must authorize or gate takers before they can use this method. */
|
|
61
125
|
intentGatingService: string;
|
|
126
|
+
/** Hash of the off-chain payee details that the taker must prove they paid. */
|
|
62
127
|
payeeDetailsHash: string;
|
|
128
|
+
/** Method-level on/off toggle. `QuoteCandidate.isActive` also depends on this value. */
|
|
63
129
|
active: boolean;
|
|
64
130
|
}
|
|
65
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Per `(deposit, payment method, fiat currency)` pricing configuration. This is the most important rate-resolution entity in the schema. It stores the depositor's fixed floor, delegated manager input, oracle configuration and snapshots, and the final resolved rate that quoting and validation use.
|
|
134
|
+
*
|
|
135
|
+
* @id escrowAddress_depositId_paymentMethodHash_currencyCode
|
|
136
|
+
*
|
|
137
|
+
* **Relationships:**
|
|
138
|
+
* - Many-to-one to `Deposit`
|
|
139
|
+
* - Logical many-to-one to `DepositPaymentMethod` by `(depositId, paymentMethodHash)`
|
|
140
|
+
* - Optional many-to-one to `RateManager` through `rateManagerId` plus the deposit's `rateManagerAddress`
|
|
141
|
+
* - Source record for `QuoteCandidate`; the quote row reuses this entity's identity
|
|
142
|
+
*/
|
|
66
143
|
export interface MethodCurrency {
|
|
144
|
+
/** Composite key `escrowAddress_depositId_paymentMethodHash_currencyCode`. */
|
|
67
145
|
id: string;
|
|
146
|
+
/** Chain where the parent deposit lives. */
|
|
68
147
|
chainId: number;
|
|
148
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
69
149
|
depositId: string;
|
|
150
|
+
/** Raw on-chain deposit id for cross-checking with contract logs. */
|
|
70
151
|
depositIdOnContract: string;
|
|
152
|
+
/** Payment-method component of the tuple. */
|
|
71
153
|
paymentMethodHash: string;
|
|
154
|
+
/** Fiat currency component of the tuple. */
|
|
72
155
|
currencyCode: string;
|
|
156
|
+
/** Maker-defined fixed floor for the tuple. In legacy flows this can also be the directly used static rate. */
|
|
73
157
|
minConversionRate: string;
|
|
158
|
+
/** Delegated manager quote before floor enforcement and before manager fee is applied. */
|
|
74
159
|
managerRate?: string;
|
|
160
|
+
/** Delegated manager fee rate in 1e18 precision. This does not lower `conversionRate`; it is turned into a taker-facing markup when computing `takerConversionRate`. */
|
|
75
161
|
managerFee?: string;
|
|
162
|
+
/** Final gross resolved rate used for intent validation and contract-aligned quote logic. */
|
|
76
163
|
conversionRate?: string;
|
|
164
|
+
/** Final all-in rate shown to takers. In delegated mode this incorporates manager fee on top of the gross rate. */
|
|
77
165
|
takerConversionRate?: string;
|
|
166
|
+
/** Resolution reason for `conversionRate`, such as `MANAGER`, `ORACLE`, `ESCROW_FLOOR`, `MANAGER_DISABLED`, `ORACLE_HALTED`, or `NO_FLOOR`. */
|
|
78
167
|
rateSource?: string;
|
|
168
|
+
/** Delegated manager id that supplied the current delegated rate, if any. */
|
|
79
169
|
rateManagerId?: string;
|
|
170
|
+
/** Oracle adapter contract address used to interpret `adapterConfig`. */
|
|
80
171
|
adapter?: string;
|
|
172
|
+
/** Encoded adapter config bytes stored exactly as emitted. */
|
|
81
173
|
adapterConfig?: string;
|
|
174
|
+
/** Resolved oracle feed address or feed id after decoding the adapter config. */
|
|
82
175
|
feed?: string;
|
|
176
|
+
/** Feed decimals used to normalize oracle answers into the shared 1e18 rate format. */
|
|
83
177
|
feedDecimals?: number;
|
|
178
|
+
/** Maker-configured markup applied to raw oracle output before final floor/manager resolution. */
|
|
84
179
|
spreadBps?: number;
|
|
180
|
+
/** Maximum acceptable oracle age in seconds before the tuple is considered stale. */
|
|
85
181
|
maxStaleness?: string;
|
|
182
|
+
/** Whether the oracle answer must be inverted before being converted into the shared rate representation. */
|
|
86
183
|
invert?: boolean;
|
|
184
|
+
/** Raw oracle-derived rate before spread markup. */
|
|
87
185
|
oracleRate?: string;
|
|
186
|
+
/** Oracle rate after applying `spreadBps`. */
|
|
88
187
|
effectiveOracleRate?: string;
|
|
188
|
+
/** Timestamp of the latest accepted oracle datapoint used by this row. */
|
|
89
189
|
lastOracleUpdatedAt?: string;
|
|
190
|
+
/** Decoded oracle kind, currently `oracle_chainlink`, `oracle_pyth`, or `oracle_unknown`. */
|
|
90
191
|
kind?: string;
|
|
91
192
|
}
|
|
92
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Canonical taker intent row. An `Intent` starts when the taker signals intent and ends in fulfillment or prune. This entity intentionally separates on-chain lifecycle (`status`) from off-chain expiry reconciliation (`isExpired`).
|
|
196
|
+
*
|
|
197
|
+
* @id chainId_intentHash
|
|
198
|
+
*
|
|
199
|
+
* **Relationships:**
|
|
200
|
+
* - Many-to-one to `Deposit`
|
|
201
|
+
* - Parent of `ReferralFeeDistribution`
|
|
202
|
+
* - Feeds `TakerStats`, maker stats rollups, profit snapshots, and manager aggregates
|
|
203
|
+
*/
|
|
93
204
|
export interface Intent {
|
|
205
|
+
/** Canonical key `chainId_intentHash`. */
|
|
94
206
|
id: string;
|
|
207
|
+
/** Raw on-chain intent hash. */
|
|
95
208
|
intentHash: string;
|
|
209
|
+
/** Contract address that coordinated the intent. In legacy v2 this is effectively the escrow address; in newer flows it is the orchestrator. */
|
|
96
210
|
orchestratorAddress: string;
|
|
211
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
97
212
|
depositId: string;
|
|
213
|
+
/** Verifier contract or address associated with the payment proof. In v21 it is updated again when payment verification arrives. */
|
|
98
214
|
verifier: string;
|
|
215
|
+
/** Payment-method hash associated with the intent. Optional because some legacy flows populate it indirectly. */
|
|
99
216
|
paymentMethodHash?: string;
|
|
217
|
+
/** Taker wallet that owns the intent. */
|
|
100
218
|
owner: string;
|
|
219
|
+
/** Recipient address for the released token payout. */
|
|
101
220
|
toAddress: string;
|
|
221
|
+
/** Token amount signaled for the intent. This is the nominal amount, not necessarily the realized release amount. */
|
|
102
222
|
amount: string;
|
|
223
|
+
/** Fiat currency signaled at quote time. */
|
|
103
224
|
fiatCurrency: string;
|
|
225
|
+
/** Quote-time rate captured on the intent. */
|
|
104
226
|
conversionRate: string;
|
|
227
|
+
/** On-chain lifecycle state only. This does not encode off-chain expiry reconciliation. */
|
|
105
228
|
status: IntentStatus;
|
|
229
|
+
/** Off-chain reconciler flag that says the lock has timed out and liquidity was already unlocked off-chain. An intent can be `status = SIGNALED` and `isExpired = true` at the same time. */
|
|
106
230
|
isExpired: boolean;
|
|
231
|
+
/** Transaction that created/signaled the intent. */
|
|
107
232
|
signalTxHash: string;
|
|
233
|
+
/** Signal timestamp taken from the emitted event/proof context. */
|
|
108
234
|
signalTimestamp: string;
|
|
235
|
+
/** Transaction that fulfilled or manually released the intent. */
|
|
109
236
|
fulfillTxHash?: string;
|
|
237
|
+
/** Timestamp of fulfillment/manual release. */
|
|
110
238
|
fulfillTimestamp?: string;
|
|
239
|
+
/** Transaction that pruned/unlocked the intent. */
|
|
111
240
|
pruneTxHash?: string;
|
|
241
|
+
/** Timestamp of prune/unlock. */
|
|
112
242
|
pruneTimestamp?: string;
|
|
243
|
+
/** Canonical expiry timestamp used by the block reconciler. It is refined by lock/extend events after the signal event. */
|
|
113
244
|
expiryTime: string;
|
|
245
|
+
/** Last mutation timestamp for this intent row. */
|
|
114
246
|
updatedAt: string;
|
|
247
|
+
/** Actual fiat amount proven by the verifier. This may differ from `amount` in partial-payment scenarios. */
|
|
115
248
|
paymentAmount?: string;
|
|
249
|
+
/** Actual fiat currency proven by the verifier. This may differ from `fiatCurrency`. */
|
|
116
250
|
paymentCurrency?: string;
|
|
251
|
+
/** Timestamp contained in the verified payment proof. */
|
|
117
252
|
paymentTimestamp?: string;
|
|
253
|
+
/** External payment identifier from the payment rail/provider. */
|
|
118
254
|
paymentId?: string;
|
|
255
|
+
/** Gross token amount released from escrow before protocol or referral fees. May differ from `amount`. */
|
|
119
256
|
releasedAmount?: string;
|
|
257
|
+
/** Net token amount actually received by the taker after protocol and referrer deductions. */
|
|
120
258
|
takerAmountNetFees?: string;
|
|
259
|
+
/** Snapshotted delegated manager id relevant to this intent, if a manager fee applied. */
|
|
121
260
|
rateManagerId?: string;
|
|
261
|
+
/** Snapshotted manager fee rate in 1e18 precision. */
|
|
122
262
|
managerFee?: string;
|
|
263
|
+
/** Address that receives the manager fee on settlement. */
|
|
123
264
|
managerFeeRecipient?: string;
|
|
265
|
+
/** Signal-time fee estimate based on the signaled intent amount. */
|
|
124
266
|
managerFeeAmount?: string;
|
|
267
|
+
/** Release-time manager fee based on the actual released amount. */
|
|
125
268
|
realizedManagerFeeAmount?: string;
|
|
269
|
+
/** Sum of all `ReferralFeeDistribution.feeAmount` rows written for this intent. */
|
|
126
270
|
totalReferralFeeAmount?: string;
|
|
127
271
|
}
|
|
128
272
|
|
|
273
|
+
/**
|
|
274
|
+
* Per-recipient referral-fee settlement rows for v2.2. The `Intent` stores the aggregate; this entity preserves recipient-level detail.
|
|
275
|
+
*
|
|
276
|
+
* @id chainId_intentHash_feeRecipient
|
|
277
|
+
*
|
|
278
|
+
* **Relationships:**
|
|
279
|
+
* - Many-to-one to `Intent` through `intentId`
|
|
280
|
+
*/
|
|
129
281
|
export interface ReferralFeeDistribution {
|
|
282
|
+
/** Composite key `chainId_intentHash_feeRecipient`. */
|
|
130
283
|
id: string;
|
|
284
|
+
/** Chain where the parent intent settled. */
|
|
131
285
|
chainId: number;
|
|
286
|
+
/** Raw on-chain intent hash. */
|
|
132
287
|
intentHash: string;
|
|
288
|
+
/** Foreign-key string to `Intent.id`. */
|
|
133
289
|
intentId: string;
|
|
290
|
+
/** Address that received this referral-fee slice. */
|
|
134
291
|
feeRecipient: string;
|
|
292
|
+
/** Actual token amount distributed to `feeRecipient`. */
|
|
135
293
|
feeAmount: string;
|
|
294
|
+
/** Transaction that emitted the distribution event. */
|
|
136
295
|
txHash: string;
|
|
296
|
+
/** Settlement timestamp for this distribution row. */
|
|
137
297
|
timestamp: string;
|
|
138
298
|
}
|
|
139
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Per-owner behavioral aggregate. This row is updated from signaled, fulfilled/manual-release, and prune flows. In v21 it also carries a `lockScore` penalty based on how long cancelled intents kept liquidity locked.
|
|
302
|
+
*
|
|
303
|
+
* @id chainId_owner (owner lowercased)
|
|
304
|
+
*
|
|
305
|
+
* **Relationships:**
|
|
306
|
+
* - Implicit many-to-one from all `Intent` rows whose `owner` matches `TakerStats.owner`
|
|
307
|
+
*/
|
|
140
308
|
export interface TakerStats {
|
|
309
|
+
/** Composite key `chainId_owner`, with the owner lowercased. */
|
|
141
310
|
id: string;
|
|
311
|
+
/** Chain on which the taker activity occurred. */
|
|
142
312
|
chainId: number;
|
|
313
|
+
/** Lowercased taker address used as the aggregation key. */
|
|
143
314
|
owner: string;
|
|
315
|
+
/** Number of intents ever signaled by this taker. */
|
|
144
316
|
lifetimeSignaledCount: number;
|
|
317
|
+
/** Number of non-manual intents that fulfilled successfully. */
|
|
145
318
|
lifetimeFulfilledCount: number;
|
|
319
|
+
/** Number of intents that ended via manual release. */
|
|
146
320
|
lifetimeManualReleaseCount: number;
|
|
321
|
+
/** Number of intents that were pruned/cancelled. Same-tx prune-then-fulfill cases are rolled back. */
|
|
147
322
|
lifetimePruneCount: number;
|
|
323
|
+
/** Sum of token amount from cancelled/pruned intents, with rollback if a same-tx prune later fulfills. */
|
|
148
324
|
totalCancelledVolume: string;
|
|
325
|
+
/** Sum of token amount from fulfilled/manual-release intents. */
|
|
149
326
|
totalFulfilledVolume: string;
|
|
327
|
+
/** Penalty-style score derived from cancelled intent lock duration. Currently meaningful only in the v21 path. */
|
|
150
328
|
lockScore: string;
|
|
329
|
+
/** Timestamp of the taker's most recent intent signal. */
|
|
151
330
|
lastIntentAt?: string;
|
|
331
|
+
/** Timestamp of the taker's most recent fulfillment/manual release. */
|
|
152
332
|
lastFulfilledAt?: string;
|
|
333
|
+
/** Timestamp of the taker's first observed intent. */
|
|
153
334
|
firstSeenAt?: string;
|
|
335
|
+
/** Last time this aggregate row changed. */
|
|
154
336
|
updatedAt: string;
|
|
155
337
|
}
|
|
156
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Per-maker aggregate across every deposit owned by the maker on a chain. This is deposit-derived state plus realized-profit rollups.
|
|
341
|
+
*
|
|
342
|
+
* @id chainId_maker (maker lowercased)
|
|
343
|
+
*
|
|
344
|
+
* **Relationships:**
|
|
345
|
+
* - Implicit aggregation over all `Deposit` rows where `Deposit.depositor = MakerStats.maker`
|
|
346
|
+
* - Parent summary for `MakerPlatformStats` and `MakerCurrencyStats`
|
|
347
|
+
*/
|
|
157
348
|
export interface MakerStats {
|
|
349
|
+
/** Composite key `chainId_maker`, with maker lowercased in the id. */
|
|
158
350
|
id: string;
|
|
351
|
+
/** Chain on which the maker operates. */
|
|
159
352
|
chainId: number;
|
|
353
|
+
/** Maker/depositor address used as the aggregation key. */
|
|
160
354
|
maker: string;
|
|
355
|
+
/** Sum of `Deposit.totalAmountTaken` across the maker's deposits. */
|
|
161
356
|
totalAmountTaken: string;
|
|
357
|
+
/** All-time gross capital committed by the maker, derived per deposit as `remaining + outstanding + taken + withdrawn`. */
|
|
162
358
|
grossDeposited: string;
|
|
359
|
+
/** Sum of maker withdrawals across all deposits. */
|
|
163
360
|
totalWithdrawn: string;
|
|
361
|
+
/** Sum of liquidity currently locked in active intents across all deposits. */
|
|
164
362
|
outstandingIntentAmount: string;
|
|
363
|
+
/** Number of deposits that are both `ACTIVE` and `acceptingIntents = true`. */
|
|
165
364
|
activeDepositCount: number;
|
|
365
|
+
/** Number of deposit rows ever created for the maker. */
|
|
166
366
|
totalDepositCount: number;
|
|
367
|
+
/** Sum of `Deposit.fulfilledIntents` across the maker's deposits. */
|
|
167
368
|
fulfilledIntents: number;
|
|
369
|
+
/** Sum of `Deposit.prunedIntents` across the maker's deposits. */
|
|
168
370
|
prunedIntents: number;
|
|
371
|
+
/** Sum of `Deposit.signaledIntents` across the maker's deposits. */
|
|
169
372
|
signaledIntents: number;
|
|
373
|
+
/** Sum of `Deposit.totalIntents` across the maker's deposits. */
|
|
170
374
|
totalIntents: number;
|
|
375
|
+
/** Number of maker fills that happened through manual release. */
|
|
171
376
|
manualReleaseCount: number;
|
|
377
|
+
/** Maker-level fulfillment rate in basis points, derived from aggregate `fulfilledIntents / totalIntents`. */
|
|
172
378
|
successRateBps: number;
|
|
379
|
+
/** Sum of computed realized profit across all maker profit snapshots. */
|
|
173
380
|
realizedProfitUsdCents: string;
|
|
381
|
+
/** Reserved APR-style metric. It is present in the schema but not currently maintained by handlers. */
|
|
174
382
|
aprBps?: number;
|
|
383
|
+
/** Timestamp of the maker's earliest observed deposit. */
|
|
175
384
|
firstSeenAt?: string;
|
|
385
|
+
/** Last time the aggregate changed. */
|
|
176
386
|
updatedAt: string;
|
|
177
387
|
}
|
|
178
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Per-maker, per-payment-method aggregate. This lets consumers break a maker's business down by payment rail or method hash.
|
|
391
|
+
*
|
|
392
|
+
* @id chainId_maker_paymentMethodHash
|
|
393
|
+
*
|
|
394
|
+
* **Relationships:**
|
|
395
|
+
* - Implicit aggregation over intents/fills for one maker and one `paymentMethodHash`
|
|
396
|
+
*/
|
|
179
397
|
export interface MakerPlatformStats {
|
|
398
|
+
/** Composite key `chainId_maker_paymentMethodHash`. */
|
|
180
399
|
id: string;
|
|
400
|
+
/** Chain on which the activity occurred. */
|
|
181
401
|
chainId: number;
|
|
402
|
+
/** Maker address. */
|
|
182
403
|
maker: string;
|
|
404
|
+
/** Payment-method aggregation dimension. */
|
|
183
405
|
paymentMethodHash: string;
|
|
406
|
+
/** Sum of fulfilled/manual-release volume for this maker-method pair. */
|
|
184
407
|
totalAmountTaken: string;
|
|
408
|
+
/** Count of fulfilled/manual-release intents for this pair. */
|
|
185
409
|
fulfilledIntents: number;
|
|
410
|
+
/** Count of pruned intents for this pair. */
|
|
186
411
|
prunedIntents: number;
|
|
412
|
+
/** Count of manual-release fills for this pair. */
|
|
187
413
|
manualReleaseCount: number;
|
|
414
|
+
/** Sum of realized profit allocated to this maker-method pair. */
|
|
188
415
|
realizedProfitUsdCents: string;
|
|
416
|
+
/** Number of profit snapshots that successfully contributed realized profit to this pair. */
|
|
189
417
|
computedProfitSnapshots: number;
|
|
418
|
+
/** Last time the row changed. */
|
|
190
419
|
updatedAt: string;
|
|
191
420
|
}
|
|
192
421
|
|
|
422
|
+
/**
|
|
423
|
+
* Per-maker, per-fiat-currency aggregate.
|
|
424
|
+
*
|
|
425
|
+
* @id chainId_maker_currencyCode
|
|
426
|
+
*
|
|
427
|
+
* **Relationships:**
|
|
428
|
+
* - Implicit aggregation over intents/fills for one maker and one fiat currency
|
|
429
|
+
*/
|
|
193
430
|
export interface MakerCurrencyStats {
|
|
431
|
+
/** Composite key `chainId_maker_currencyCode`. */
|
|
194
432
|
id: string;
|
|
433
|
+
/** Chain on which the activity occurred. */
|
|
195
434
|
chainId: number;
|
|
435
|
+
/** Maker address. */
|
|
196
436
|
maker: string;
|
|
437
|
+
/** Fiat-currency aggregation dimension. */
|
|
197
438
|
currencyCode: string;
|
|
439
|
+
/** Sum of fulfilled/manual-release volume for this maker-currency pair. */
|
|
198
440
|
totalAmountTaken: string;
|
|
441
|
+
/** Count of fulfilled/manual-release intents for this pair. */
|
|
199
442
|
fulfilledIntents: number;
|
|
443
|
+
/** Count of pruned intents for this pair. */
|
|
200
444
|
prunedIntents: number;
|
|
445
|
+
/** Count of manual releases for this pair. */
|
|
201
446
|
manualReleaseCount: number;
|
|
447
|
+
/** Last time the row changed. */
|
|
202
448
|
updatedAt: string;
|
|
203
449
|
}
|
|
204
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Daily FX snapshot used to translate local-fiat quote rates into a USD-denominated profitability view.
|
|
453
|
+
*
|
|
454
|
+
* @id currencyCode_timestampHour
|
|
455
|
+
*
|
|
456
|
+
* **Relationships:**
|
|
457
|
+
* - Referenced by `MakerProfitSnapshot.priceSnapshotId`
|
|
458
|
+
* - Used indirectly by manager aggregate PnL computation
|
|
459
|
+
*/
|
|
205
460
|
export interface PriceSnapshot {
|
|
461
|
+
/** Composite key `currencyCode_timestampDay`. */
|
|
206
462
|
id: string;
|
|
463
|
+
/** Normalized fiat currency code of the quote being converted to USD. */
|
|
207
464
|
currencyCode: string;
|
|
465
|
+
/** Start-of-day UTC bucket in seconds. */
|
|
208
466
|
timestampDay: string;
|
|
467
|
+
/** Provider-supplied fiat-to-USD conversion rate in provider precision. */
|
|
209
468
|
rateUsd: string;
|
|
469
|
+
/** Precision/scaling factor associated with `rateUsd`. */
|
|
210
470
|
ratePrecision: number;
|
|
471
|
+
/** Upstream provider name used to fetch the quote. */
|
|
211
472
|
provider: string;
|
|
473
|
+
/** Source string or provider endpoint label. */
|
|
212
474
|
source: string;
|
|
475
|
+
/** Whether this snapshot came from live indexing or backfill. */
|
|
213
476
|
status: PriceSnapshotStatus;
|
|
477
|
+
/** Timestamp at which the provider says the quote is valid/effective. */
|
|
214
478
|
effectiveAt: string;
|
|
479
|
+
/** Timestamp when the indexer fetched the quote. */
|
|
215
480
|
retrievedAt: string;
|
|
481
|
+
/** First time this snapshot row was written. */
|
|
216
482
|
createdAt: string;
|
|
483
|
+
/** Last time this snapshot row was written. Usually equal to `createdAt`. */
|
|
217
484
|
updatedAt: string;
|
|
218
485
|
}
|
|
219
486
|
|
|
487
|
+
/**
|
|
488
|
+
* Per-intent realized-profit record for makers. This is the bridge between intent settlement and USD-denominated reporting.
|
|
489
|
+
*
|
|
490
|
+
* @id intentId
|
|
491
|
+
*
|
|
492
|
+
* **Relationships:**
|
|
493
|
+
* - One row per settled `Intent` (`id = intentId`)
|
|
494
|
+
* - Many-to-one to `Deposit`
|
|
495
|
+
* - Optional many-to-one to `PriceSnapshot`
|
|
496
|
+
*/
|
|
220
497
|
export interface MakerProfitSnapshot {
|
|
498
|
+
/** Equal to `intentId`, enforcing one profit row per intent. */
|
|
221
499
|
id: string;
|
|
500
|
+
/** Chain where the intent settled. */
|
|
222
501
|
chainId: number;
|
|
502
|
+
/** Maker address that owned the deposit. */
|
|
223
503
|
maker: string;
|
|
504
|
+
/** Foreign-key string to `Intent.id`. */
|
|
224
505
|
intentId: string;
|
|
506
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
225
507
|
depositId: string;
|
|
508
|
+
/** Fiat currency used for the quote/profit comparison. */
|
|
226
509
|
fiatCurrency: string;
|
|
510
|
+
/** Quote-time rate captured from the intent. */
|
|
227
511
|
quoteConversionRate: string;
|
|
512
|
+
/** USD-derived market reference rate computed from the linked `PriceSnapshot`. */
|
|
228
513
|
oracleRate?: string;
|
|
514
|
+
/** Basis-point difference between `quoteConversionRate` and `oracleRate`. */
|
|
229
515
|
spreadBps?: number;
|
|
516
|
+
/** Token amount used for the profit calculation. */
|
|
230
517
|
amount: string;
|
|
518
|
+
/** USD-cent value of the local-fiat notional implied by the quote. */
|
|
231
519
|
notionalFiatUsdCents?: string;
|
|
520
|
+
/** Reserved fee field. It is currently written as zero. */
|
|
232
521
|
feeUsd?: string;
|
|
522
|
+
/** Realized profit in USD cents. Can be negative. */
|
|
233
523
|
realizedProfitUsdCents?: string;
|
|
524
|
+
/** Optional reference to the `PriceSnapshot` used to compute `oracleRate`. */
|
|
234
525
|
priceSnapshotId?: string;
|
|
526
|
+
/** `COMPUTED` when an FX reference existed, `PENDING` otherwise. */
|
|
235
527
|
status: ProfitStatus;
|
|
528
|
+
/** Timestamp when the profit row was created. */
|
|
236
529
|
createdAt: string;
|
|
530
|
+
/** Last update timestamp for the profit row. */
|
|
237
531
|
updatedAt: string;
|
|
238
532
|
}
|
|
239
533
|
|
|
534
|
+
/**
|
|
535
|
+
* Registry row for a delegated rate manager. A deposit can point at one of these via `(rateManagerAddress, rateManagerId)`.
|
|
536
|
+
*
|
|
537
|
+
* @id chainId_rateManagerAddress_rateManagerId
|
|
538
|
+
*
|
|
539
|
+
* **Relationships:**
|
|
540
|
+
* - Parent of `RateManagerRate`
|
|
541
|
+
* - Parent/source of `ManagerAggregateStats`, `ManagerDailySnapshot`, and `ManagerStats`
|
|
542
|
+
* - Optional target of deposit delegation
|
|
543
|
+
*/
|
|
240
544
|
export interface RateManager {
|
|
545
|
+
/** Composite key `chainId_rateManagerAddress_rateManagerId`. */
|
|
241
546
|
id: string;
|
|
547
|
+
/** Chain where the manager contract exists. */
|
|
242
548
|
chainId: number;
|
|
549
|
+
/** Rate-manager contract address. */
|
|
243
550
|
rateManagerAddress: string;
|
|
551
|
+
/** On-contract manager identifier. */
|
|
244
552
|
rateManagerId: string;
|
|
553
|
+
/** Account recognized as the logical manager/operator. */
|
|
245
554
|
manager: string;
|
|
555
|
+
/** Account that receives manager fees on settlement. */
|
|
246
556
|
feeRecipient: string;
|
|
557
|
+
/** Maximum allowed fee configured at manager creation. */
|
|
247
558
|
maxFee: string;
|
|
559
|
+
/** Current fee rate in 1e18 precision. */
|
|
248
560
|
fee: string;
|
|
561
|
+
/** Configured minimum liquidity threshold advertised by the manager contract. */
|
|
249
562
|
minLiquidity: string;
|
|
563
|
+
/** Optional human-readable name. */
|
|
250
564
|
name?: string;
|
|
565
|
+
/** Optional metadata URI. */
|
|
251
566
|
uri?: string;
|
|
567
|
+
/** First-seen timestamp. */
|
|
252
568
|
createdAt: string;
|
|
569
|
+
/** Last config update timestamp. */
|
|
253
570
|
updatedAt: string;
|
|
254
571
|
}
|
|
255
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Per-manager quote sheet. Each row is a manager-supplied rate for one payment-method/currency pair. Deposits delegated to that manager read these rows when resolving `MethodCurrency.conversionRate`.
|
|
575
|
+
*
|
|
576
|
+
* @id chainId_rateManagerAddress_rateManagerId_paymentMethodHash_currencyCode
|
|
577
|
+
*/
|
|
256
578
|
export interface RateManagerRate {
|
|
579
|
+
/** Composite key `chainId_rateManagerAddress_rateManagerId_paymentMethodHash_currencyCode`. */
|
|
257
580
|
id: string;
|
|
581
|
+
/** Chain where the manager contract exists. */
|
|
258
582
|
chainId: number;
|
|
583
|
+
/** Manager contract address. */
|
|
259
584
|
rateManagerAddress: string;
|
|
585
|
+
/** Manager identifier. */
|
|
260
586
|
rateManagerId: string;
|
|
587
|
+
/** Payment-method dimension for the manager quote. */
|
|
261
588
|
paymentMethodHash: string;
|
|
589
|
+
/** Fiat-currency dimension for the manager quote. */
|
|
262
590
|
currencyCode: string;
|
|
591
|
+
/** Gross manager-provided rate before floor enforcement. */
|
|
263
592
|
managerRate: string;
|
|
593
|
+
/** Timestamp of the last rate update event for this pair. */
|
|
264
594
|
updatedAt: string;
|
|
265
595
|
}
|
|
266
596
|
|
|
597
|
+
/**
|
|
598
|
+
* Portfolio-level aggregate for one delegated rate manager. This is the top-level manager reporting row.
|
|
599
|
+
*
|
|
600
|
+
* @id chainId_rateManagerAddress_rateManagerId
|
|
601
|
+
*
|
|
602
|
+
* **Relationships:**
|
|
603
|
+
* - One-to-one logical summary for one `RateManager`
|
|
604
|
+
* - Source for `ManagerDailySnapshot`
|
|
605
|
+
* - Updated from delegated deposit balance changes and fulfilled intents
|
|
606
|
+
*/
|
|
267
607
|
export interface ManagerAggregateStats {
|
|
608
|
+
/** Same identity as the corresponding `RateManager.id`. */
|
|
268
609
|
id: string;
|
|
610
|
+
/** Chain on which the manager operates. */
|
|
269
611
|
chainId: number;
|
|
612
|
+
/** Manager contract address. */
|
|
270
613
|
rateManagerAddress: string;
|
|
614
|
+
/** Manager identifier. */
|
|
271
615
|
rateManagerId: string;
|
|
616
|
+
/** Manager account/operator. */
|
|
272
617
|
manager: string;
|
|
618
|
+
/** Cumulative token volume filled across all delegated deposits. */
|
|
273
619
|
totalFilledVolume: string;
|
|
620
|
+
/** Cumulative manager fee amount actually earned across fills. */
|
|
274
621
|
totalFeeAmount: string;
|
|
622
|
+
/** Cumulative USD-cent PnL measured against daily FX snapshots. */
|
|
275
623
|
totalPnlUsdCents: string;
|
|
624
|
+
/** Number of fulfilled delegated intents. */
|
|
276
625
|
fulfilledIntents: number;
|
|
626
|
+
/** Current delegated TVL, computed as the sum of `remainingDeposits + outstandingIntentAmount` across delegated deposits. */
|
|
277
627
|
currentDelegatedBalance: string;
|
|
628
|
+
/** Number of deposits currently delegated to this manager. */
|
|
278
629
|
currentDelegatedDeposits: number;
|
|
630
|
+
/** First timestamp the manager aggregate was created. */
|
|
279
631
|
firstSeenAt?: string;
|
|
632
|
+
/** Last time the aggregate changed. */
|
|
280
633
|
updatedAt: string;
|
|
281
634
|
}
|
|
282
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Daily bucketed snapshot for `ManagerAggregateStats`.
|
|
638
|
+
*
|
|
639
|
+
* @id chainId_rateManagerAddress_rateManagerId_dayTimestamp
|
|
640
|
+
*/
|
|
283
641
|
export interface ManagerDailySnapshot {
|
|
642
|
+
/** Composite key `chainId_rateManagerAddress_rateManagerId_dayTimestamp`. */
|
|
284
643
|
id: string;
|
|
644
|
+
/** Chain on which the manager operates. */
|
|
285
645
|
chainId: number;
|
|
646
|
+
/** Manager contract address. */
|
|
286
647
|
rateManagerAddress: string;
|
|
648
|
+
/** Manager identifier. */
|
|
287
649
|
rateManagerId: string;
|
|
650
|
+
/** Start-of-day UTC bucket in seconds. */
|
|
288
651
|
dayTimestamp: string;
|
|
652
|
+
/** End-of-update delegated balance for that day. */
|
|
289
653
|
tvl: string;
|
|
654
|
+
/** Number of currently delegated deposits at snapshot time. */
|
|
290
655
|
delegatedDeposits: number;
|
|
656
|
+
/** Volume filled during that day. */
|
|
291
657
|
dailyVolume: string;
|
|
658
|
+
/** Manager fees earned during that day. */
|
|
292
659
|
dailyFees: string;
|
|
660
|
+
/** Daily PnL in USD cents. */
|
|
293
661
|
dailyPnlUsdCents: string;
|
|
662
|
+
/** Number of fulfilled intents on that day. */
|
|
294
663
|
dailyFulfilledIntents: number;
|
|
664
|
+
/** Cumulative filled volume up to this snapshot. */
|
|
295
665
|
cumulativeVolume: string;
|
|
666
|
+
/** Cumulative manager fees up to this snapshot. */
|
|
296
667
|
cumulativeFees: string;
|
|
668
|
+
/** Cumulative PnL up to this snapshot. */
|
|
297
669
|
cumulativePnlUsdCents: string;
|
|
670
|
+
/** Cumulative fulfilled-intent count up to this snapshot. */
|
|
298
671
|
cumulativeFulfilledIntents: number;
|
|
672
|
+
/** Last mutation time for the day's bucket. */
|
|
299
673
|
updatedAt: string;
|
|
300
674
|
}
|
|
301
675
|
|
|
676
|
+
/**
|
|
677
|
+
* Append-only normalized ledger of deposit funding activity. This is easier to query than replaying all raw event families.
|
|
678
|
+
*
|
|
679
|
+
* @id txHash_logIndex
|
|
680
|
+
*
|
|
681
|
+
* **Relationships:**
|
|
682
|
+
* - Many-to-one to `Deposit`
|
|
683
|
+
*/
|
|
302
684
|
export interface DepositFundActivity {
|
|
685
|
+
/** Composite key `txHash_logIndex`. */
|
|
303
686
|
id: string;
|
|
687
|
+
/** Chain where the activity happened. */
|
|
304
688
|
chainId: number;
|
|
689
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
305
690
|
depositId: string;
|
|
691
|
+
/** Maker address that owns the deposit. */
|
|
306
692
|
depositor: string;
|
|
693
|
+
/** Normalized activity class: `DEPOSIT_RECEIVED`, `FUNDS_ADDED`, `WITHDRAWN`, or `CLOSED`. */
|
|
307
694
|
activityType: string;
|
|
695
|
+
/** Token amount relevant to the activity. `CLOSED` can legitimately record zero amount. */
|
|
308
696
|
amount: string;
|
|
697
|
+
/** Block number for the activity. */
|
|
309
698
|
blockNumber: string;
|
|
699
|
+
/** Timestamp for the activity. */
|
|
310
700
|
timestamp: string;
|
|
701
|
+
/** Transaction hash for the activity. */
|
|
311
702
|
txHash: string;
|
|
312
703
|
}
|
|
313
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Daily bucketed snapshot of one deposit's state and realized profitability.
|
|
707
|
+
*
|
|
708
|
+
* @id depositId_dayTimestamp
|
|
709
|
+
*
|
|
710
|
+
* **Relationships:**
|
|
711
|
+
* - Many-to-one to `Deposit`
|
|
712
|
+
* - Receives daily-volume and daily-PnL deltas from fulfillment flows
|
|
713
|
+
*/
|
|
314
714
|
export interface DepositDailySnapshot {
|
|
715
|
+
/** Composite key `depositId_dayTimestamp`. */
|
|
315
716
|
id: string;
|
|
717
|
+
/** Chain where the deposit exists. */
|
|
316
718
|
chainId: number;
|
|
719
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
317
720
|
depositId: string;
|
|
721
|
+
/** Maker address that owns the deposit. */
|
|
318
722
|
depositor: string;
|
|
723
|
+
/** Start-of-day UTC bucket in seconds. */
|
|
319
724
|
dayTimestamp: string;
|
|
725
|
+
/** Deposit liquidity available at the time of the last update to that bucket. */
|
|
320
726
|
remainingDeposits: string;
|
|
727
|
+
/** Deposit liquidity currently locked in intents at the last update. */
|
|
321
728
|
outstandingIntentAmount: string;
|
|
729
|
+
/** Cumulative taken volume at the last update. */
|
|
322
730
|
totalAmountTaken: string;
|
|
731
|
+
/** Cumulative withdrawn volume at the last update. */
|
|
323
732
|
totalWithdrawn: string;
|
|
733
|
+
/** Cumulative signal count at the last update. */
|
|
324
734
|
signaledIntents: number;
|
|
735
|
+
/** Cumulative fulfillment count at the last update. */
|
|
325
736
|
fulfilledIntents: number;
|
|
737
|
+
/** Cumulative prune count at the last update. */
|
|
326
738
|
prunedIntents: number;
|
|
739
|
+
/** Deposit success rate at the last update. */
|
|
327
740
|
successRateBps: number;
|
|
741
|
+
/** Volume taken during that day only. */
|
|
328
742
|
dailyVolume: string;
|
|
743
|
+
/** Realized PnL accrued during that day only. */
|
|
329
744
|
dailyPnlUsdCents: string;
|
|
745
|
+
/** All-time volume through the deposit as of this bucket. */
|
|
330
746
|
cumulativeVolume: string;
|
|
747
|
+
/** All-time realized PnL through the deposit as of this bucket. */
|
|
331
748
|
cumulativePnlUsdCents: string;
|
|
749
|
+
/** Last mutation time for the day's bucket. */
|
|
332
750
|
updatedAt: string;
|
|
333
751
|
}
|
|
334
752
|
|
|
753
|
+
/**
|
|
754
|
+
* Per-deposit stats row for a delegated manager. Where `ManagerAggregateStats` is portfolio-level, `ManagerStats` is deposit-level attribution.
|
|
755
|
+
*
|
|
756
|
+
* @id chainId_rateManagerAddress_rateManagerId_depositId
|
|
757
|
+
*
|
|
758
|
+
* **Relationships:**
|
|
759
|
+
* - Many-to-one to `Deposit`
|
|
760
|
+
* - Many-to-one to `RateManager`
|
|
761
|
+
*/
|
|
335
762
|
export interface ManagerStats {
|
|
763
|
+
/** Composite key `chainId_rateManagerAddress_rateManagerId_depositId`. */
|
|
336
764
|
id: string;
|
|
765
|
+
/** Chain on which the delegation exists. */
|
|
337
766
|
chainId: number;
|
|
767
|
+
/** Manager contract address. */
|
|
338
768
|
rateManagerAddress: string;
|
|
769
|
+
/** Manager identifier. */
|
|
339
770
|
rateManagerId: string;
|
|
771
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
340
772
|
depositId: string;
|
|
773
|
+
/** Maker that owns the delegated deposit. */
|
|
341
774
|
depositor: string;
|
|
775
|
+
/** Current delegated balance for this one deposit: `remainingDeposits + outstandingIntentAmount`. */
|
|
342
776
|
currentDelegatedBalance: string;
|
|
777
|
+
/** Deposit's all-time taken amount while tracked under the manager. */
|
|
343
778
|
totalAmountTaken: string;
|
|
779
|
+
/** Deposit's all-time withdrawn amount while tracked under the manager. */
|
|
344
780
|
totalWithdrawn: string;
|
|
781
|
+
/** Deposit-level fulfillment count. */
|
|
345
782
|
fulfilledIntents: number;
|
|
783
|
+
/** Deposit-level prune count. */
|
|
346
784
|
prunedIntents: number;
|
|
785
|
+
/** Deposit-level success rate. */
|
|
347
786
|
successRateBps: number;
|
|
787
|
+
/** Last mutation time for the row. */
|
|
348
788
|
updatedAt: string;
|
|
349
789
|
}
|
|
350
790
|
|
|
791
|
+
/**
|
|
792
|
+
* Read-optimized quoting view. This is intentionally denormalized so curator/quote APIs do not need to join `Deposit`, `DepositPaymentMethod`, and `MethodCurrency` at request time.
|
|
793
|
+
*
|
|
794
|
+
* @id escrowAddress_depositId_paymentMethodHash_currencyCode
|
|
795
|
+
*
|
|
796
|
+
* **Relationships:**
|
|
797
|
+
* - Derived from exactly one `(Deposit, DepositPaymentMethod, MethodCurrency)` tuple
|
|
798
|
+
* - `id` intentionally equals the corresponding `MethodCurrency.id`
|
|
799
|
+
*/
|
|
351
800
|
export interface QuoteCandidate {
|
|
801
|
+
/** Same composite identity as the backing `MethodCurrency`: `escrowAddress_depositId_paymentMethodHash_currencyCode`. */
|
|
352
802
|
id: string;
|
|
803
|
+
/** Chain where the quoteable deposit lives. */
|
|
353
804
|
chainId: number;
|
|
805
|
+
/** Raw on-chain deposit id. */
|
|
354
806
|
depositIdOnContract: string;
|
|
807
|
+
/** Foreign-key string to `Deposit.id`. */
|
|
355
808
|
depositId: string;
|
|
809
|
+
/** Escrow contract address copied from `Deposit`. */
|
|
356
810
|
escrowAddress: string;
|
|
811
|
+
/** Maker address copied from `Deposit`. */
|
|
357
812
|
depositor: string;
|
|
813
|
+
/** Token address copied from `Deposit`. */
|
|
358
814
|
token: string;
|
|
815
|
+
/** Payment-method hash copied from the tuple. */
|
|
359
816
|
paymentMethodHash: string;
|
|
817
|
+
/** Fiat currency copied from the tuple. */
|
|
360
818
|
currencyCode: string;
|
|
819
|
+
/** Final gross resolved rate copied from `MethodCurrency`. */
|
|
361
820
|
conversionRate?: string;
|
|
821
|
+
/** Final all-in taker-facing rate copied from `MethodCurrency`. */
|
|
362
822
|
takerConversionRate?: string;
|
|
823
|
+
/** Manager fee rate copied from `MethodCurrency`, defaulting to zero if absent. */
|
|
363
824
|
managerFee?: string;
|
|
825
|
+
/** Current immediately available maker liquidity, copied from `Deposit.remainingDeposits`. */
|
|
364
826
|
availableTokenAmount: string;
|
|
827
|
+
/** `min(availableTokenAmount, intentAmountMax)`, used for quote ordering and max-per-intent checks. */
|
|
365
828
|
maxTokenAvailablePerIntent: string;
|
|
829
|
+
/** Fiat value of `maxTokenAvailablePerIntent` using the taker-facing rate. */
|
|
366
830
|
maxFiatAvailablePerIntent: string;
|
|
831
|
+
/** Fiat value of the full currently available liquidity using the taker-facing rate. */
|
|
367
832
|
maxQuoteableFiat: string;
|
|
833
|
+
/** Minimum quoteable token amount copied from `Deposit`. */
|
|
368
834
|
intentAmountMin: string;
|
|
835
|
+
/** Maximum quoteable token amount copied from `Deposit`. */
|
|
369
836
|
intentAmountMax: string;
|
|
837
|
+
/** Deposit-level success signal copied from `Deposit`. */
|
|
370
838
|
successRateBps: number;
|
|
839
|
+
/** Hashed payee details copied from `DepositPaymentMethod`. */
|
|
371
840
|
payeeDetailsHash: string;
|
|
841
|
+
/** Optional gating service copied from `DepositPaymentMethod`. */
|
|
372
842
|
intentGatingService?: string;
|
|
843
|
+
/** Final quoteability flag. It is `true` only when the payment method is active, the deposit is accepting intents, and the taker-facing rate is non-zero. */
|
|
373
844
|
isActive: boolean;
|
|
845
|
+
/** Whether `availableTokenAmount >= intentAmountMin`. */
|
|
374
846
|
hasMinLiquidity: boolean;
|
|
847
|
+
/** Fiat value of `intentAmountMin` using the taker-facing rate. */
|
|
375
848
|
minFiatSupported: string;
|
|
849
|
+
/** Fiat value of `intentAmountMax` using the taker-facing rate. */
|
|
376
850
|
maxFiatSupported: string;
|
|
851
|
+
/** Fiat value of `availableTokenAmount` using the taker-facing rate. */
|
|
377
852
|
maxFiatAvail: string;
|
|
853
|
+
/** Last time the denormalized row was recomputed. */
|
|
378
854
|
updatedAt: string;
|
|
379
855
|
}
|