// Auto-generated from schema/domain.graphql — do not edit directly. // Enriched with field documentation from docs/schema-field-reference.md. // Run `node scripts/copy-schema.js` to regenerate. export enum DepositStatus { ACTIVE = 'ACTIVE', CLOSED = 'CLOSED', } export enum IntentStatus { SIGNALED = 'SIGNALED', FULFILLED = 'FULFILLED', PRUNED = 'PRUNED', MANUALLY_RELEASED = 'MANUALLY_RELEASED', } export enum PriceSnapshotStatus { LIVE = 'LIVE', BACKFILL = 'BACKFILL', } export enum ProfitStatus { COMPUTED = 'COMPUTED', PENDING = 'PENDING', } export enum DisputeProtectionIntentStatus { PENDING = 'PENDING', CANCELLED = 'CANCELLED', SETTLED = 'SETTLED', RELEASED = 'RELEASED', DISPUTED = 'DISPUTED', } export enum EscrowIntentPeriodSource { FUNDS_LOCKED = 'FUNDS_LOCKED', CONFIG_UPDATE = 'CONFIG_UPDATE', } export enum StakeLockStatus { ACTIVE = 'ACTIVE', UNLOCKED = 'UNLOCKED', RESOLVED = 'RESOLVED', } export enum StakeActivityKind { DEPOSITED = 'DEPOSITED', WITHDRAWN = 'WITHDRAWN', TAKER_AUTHORIZATION_UPDATED = 'TAKER_AUTHORIZATION_UPDATED', STAKE_OWNER_SELECTED = 'STAKE_OWNER_SELECTED', LOCK_FUNDED = 'LOCK_FUNDED', STAKE_LOCKED = 'STAKE_LOCKED', STAKE_LOCK_INCREASED = 'STAKE_LOCK_INCREASED', STAKE_LOCK_RESIZED = 'STAKE_LOCK_RESIZED', STAKE_UNLOCKED = 'STAKE_UNLOCKED', STAKE_LOCK_RESOLVED = 'STAKE_LOCK_RESOLVED', CLAIM_CREATED = 'CLAIM_CREATED', CLAIM_WITHDRAWN = 'CLAIM_WITHDRAWN', } /** * * @id escrowAddress_depositId */ export interface Deposit { /** escrowAddress_depositId */ id: string; chainId: number; escrowAddress: string; /** Static Deposit details */ depositId: string; depositor: string; token: string; /** Lowercase intent guardian configured when the deposit was created */ intentGuardian: string; /** Deposit details (can be updated) */ delegate: string; intentAmountMin: string; intentAmountMax: string; acceptingIntents: boolean; status: DepositStatus; /** * Deposit amounts used for quote calculations * Notes/identities: * - balance = remainingDeposits + outstandingIntentAmount * - grossDeposited (all-time) = remainingDeposits + outstandingIntentAmount + totalAmountTaken + totalWithdrawn * Total USDC immediately available to be taken / withdrawn */ remainingDeposits: string; /** Total USDC locked in pending intents */ outstandingIntentAmount: string; /** Total USDC taken by intents (incl. manual release) */ totalAmountTaken: string; /** Total USDC withdrawn via DepositWithdrawn events */ totalWithdrawn: string; /** * Per-deposit realized profit, used for APR computation * Lifetime sum of MakerProfitSnapshot.realizedProfitUsdCents on this deposit */ realizedProfitUsdCents: string; /** Lifetime gross realized APR in basis points. avgTvlUsdCents = current grossDeposited; days = (now - deposit.timestamp) / 86400, clamped to >= 1. */ aprBps?: number; /** Intent counters */ totalIntents: number; signaledIntents: number; fulfilledIntents: number; prunedIntents: number; /** Quality signal (basis points 0–10000; new deposits start at 10000) */ successRateBps: number; /** Metadata */ blockNumber: string; timestamp: string; txHash: string; /** Up to 5 ordered ERC-8021 codes from direct or matched account-abstraction calldata */ attributionCodes: string[]; /** First code other than the ZKP2P Base builder code */ attributionSource?: string; updatedAt: string; /** V2.2 delegated rate manager assignment (optional) */ rateManagerId?: string; rateManagerAddress?: string; delegatedAt?: string; /** * Whitelist hook address (optional) * Address of the active whitelist pre-intent hook (optional) */ whitelistHookAddress?: string; } /** * * @id escrowAddress_depositId_paymentMethodHash */ export interface DepositPaymentMethod { /** escrowAddress_depositId_paymentMethodHash */ id: string; chainId: number; /** * Corresponding Deposit details * escrowAddress_depositId (foreign key) */ depositId: string; depositIdOnContract: string; /** Payment method details */ paymentMethodHash: string; intentGatingService: string; payeeDetailsHash: string; active: boolean; } /** * * @id escrowAddress_depositId_paymentMethodHash_currencyCode */ export interface MethodCurrency { /** escrowAddress_depositId_paymentMethodHash_currencyCode */ id: string; /** Chain where the deposit lives */ chainId: number; /** * Corresponding Deposit details * Foreign key to Deposit.id (escrowAddress_depositId) */ depositId: string; /** Raw on-chain deposit id */ depositIdOnContract: string; /** * Payment method details * Payment method bytes32 hash for this tuple */ paymentMethodHash: string; /** Fiat currency bytes32 hash for this tuple */ currencyCode: string; /** * Rate state * Depositor-set fixed floor only; not oracle-adjusted and not fee-adjusted */ minConversionRate: string; /** Delegated manager quote before floor enforcement and before fee */ managerRate?: string; /** 1e18 manager fee rate charged separately by OrchestratorV2 on token release */ managerFee?: string; /** Final gross resolved rate; contract-aligned and used for intent validation */ conversionRate?: string; /** Final taker-facing all-in rate derived from conversionRate */ takerConversionRate?: string; /** Binding source/reason for conversionRate: MANAGER | ORACLE | ESCROW_FLOOR | MANAGER_DISABLED | ORACLE_HALTED | NO_FLOOR */ rateSource?: string; /** Delegated rate manager id when this tuple is manager-controlled */ rateManagerId?: string; /** * Oracle rate config and state * Oracle adapter contract address */ adapter?: string; /** Encoded adapter configuration bytes */ adapterConfig?: string; /** Resolved oracle feed address or feed id */ feed?: string; /** Feed decimals used to scale oracle answers */ feedDecimals?: number; /** Depositor-configured spread markup in basis points */ spreadBps?: number; /** Maximum accepted oracle age in seconds */ maxStaleness?: string; /** Whether the oracle answer must be inverted before scaling */ invert?: boolean; /** Raw oracle rate before spread is applied */ oracleRate?: string; /** Oracle rate after spread is applied */ effectiveOracleRate?: string; /** Timestamp of the last accepted oracle snapshot */ lastOracleUpdatedAt?: string; /** Oracle kind: oracle_chainlink | oracle_pyth | oracle_unknown */ kind?: string; } /** * * @id chainId_intentHash */ export interface Intent { /** chainId_intentHash */ id: string; intentHash: string; orchestratorAddress: string; /** * Corresponding Deposit details * escrowAddress_depositId (foreign key) */ depositId: string; /** Verifier details */ verifier: string; /** Association to payment method */ paymentMethodHash?: string; /** Recipient details */ owner: string; toAddress: string; /** Payment details */ amount: string; fiatCurrency: string; conversionRate: string; /** SIGNALED | FULFILLED | PRUNED | MANUALLY_RELEASED (on-chain states only) */ status: IntentStatus; /** Set by off-chain reconciler when expiryTime has passed */ isExpired: boolean; /** Tx hashes and timestamps */ signalTxHash: string; signalTimestamp: string; /** Up to 5 ordered ERC-8021 codes from direct or matched account-abstraction calldata */ attributionCodes: string[]; /** First code other than the ZKP2P Base builder code */ attributionSource?: string; fulfillTxHash?: string; fulfillTimestamp?: string; pruneTxHash?: string; pruneTimestamp?: string; expiryTime: string; fillLatencySeconds?: number; updatedAt: string; /** * Verified payment details (from UnifiedVerifier_V21_PaymentVerified) * These capture the "real" fiat payment details which may differ from signaled values * for partial payments or wrong currency scenarios * Actual fiat amount paid (may be partial) */ paymentAmount?: string; /** Actual currency paid (may differ from fiatCurrency) */ paymentCurrency?: string; /** When payment was made (from proof) */ paymentTimestamp?: string; /** External payment ID (platform-specific) */ paymentId?: string; /** * Released USDC amount (from Escrow_V21_FundsUnlockedAndTransferred) * May differ from signaled `amount` for partial payments * Actual USDC released (gross, before protocol fees) */ releasedAmount?: string; /** Net executable amount after fees. */ takerAmountNetFees?: string; /** * V2.2 manager fee snapshot (set via IntentManagerFeeSnapshotted) * Snapshotted delegated manager id for this intent */ rateManagerId?: string; /** Snapshotted manager fee rate in 1e18 precision */ managerFee?: string; /** Recipient that receives the manager fee on release */ managerFeeRecipient?: string; /** Signal-time estimate: intent.amount * managerFee / 1e18 */ managerFeeAmount?: string; /** Release-time realized fee: releasedAmount * managerFee / 1e18 */ realizedManagerFeeAmount?: string; /** * Referral fee distribution (set via IntentReferralFeeDistributed at fulfill time) * Sum of all referral fee USDC amounts distributed at fulfill */ totalReferralFeeAmount?: string; } /** * * @id chainId_intentHash_feeRecipient */ export interface ReferralFeeDistribution { /** chainId_intentHash_feeRecipient */ id: string; chainId: number; intentHash: string; /** FK -> Intent.id (chainId_intentHash) */ intentId: string; feeRecipient: string; /** Actual USDC amount distributed to this recipient */ feeAmount: string; txHash: string; timestamp: string; } /** * Per-(recipient, depositor) lifetime aggregate of referral fee distributions. * * @id chainId_feeRecipient_depositor (lowercased) */ export interface ReferralRecipientDepositorStats { /** chainId_feeRecipient_depositor (lowercased) */ id: string; chainId: number; feeRecipient: string; /** maker whose intent generated the fee */ depositor: string; /** cumulative USDC base units (6 decimals) */ totalFeeAmount: string; distributionCount: number; /** max block timestamp seen (unix seconds) */ lastDistributedAt: string; } /** * Per-owner operational aggregates used by Curator (v0: stats only) * * @id chainId_owner (owner lowercased) */ export interface TakerStats { /** chainId_owner (owner lowercased) */ id: string; chainId: number; owner: string; /** Lifetime counters */ lifetimeSignaledCount: number; lifetimeFulfilledCount: number; lifetimeManualReleaseCount: number; lifetimePruneCount: number; totalCancelledVolume: string; totalFulfilledVolume: string; /** Current state */ lastIntentAt?: string; lastFulfilledAt?: string; firstSeenAt?: string; /** Metadata */ updatedAt: string; } /** * * @id chainId_taker_paymentMethodHash */ export interface TakerPlatformStats { /** chainId_taker_paymentMethodHash */ id: string; chainId: number; taker: string; paymentMethodHash: string; totalAmountTaken: string; fulfilledIntents: number; prunedIntents: number; manualReleaseCount: number; updatedAt: string; } /** * * @id chainId_maker (maker lowercased) */ export interface MakerStats { /** chainId_maker (maker lowercased) */ id: string; chainId: number; maker: string; totalAmountTaken: string; grossDeposited: string; totalWithdrawn: string; outstandingIntentAmount: string; activeDepositCount: number; totalDepositCount: number; fulfilledIntents: number; prunedIntents: number; signaledIntents: number; totalIntents: number; manualReleaseCount: number; successRateBps: number; realizedProfitUsdCents: string; spreadBpsVolumeWeightedSum: string; spreadWeightedVolumeUsdc: string; /** Lifetime gross realized APR in basis points. Approximation: avgTvlUsdCents = current grossDeposited; days = (now - firstSeenAt) / 86400, clamped to >= 1. */ aprBps?: number; firstSeenAt?: string; updatedAt: string; } /** * * @id "{chainId}_{payeeDetailsHash}_{paymentPlatform}_{dayTimestamp}" */ export interface DailyPlatformVolume { /** "{chainId}_{payeeDetailsHash}_{paymentPlatform}_{dayTimestamp}" */ id: string; chainId: number; payeeDetailsHash: string; /** current owner of payeeDetailsHash at time of write */ maker: string; paymentPlatform: string; /** UTC day start timestamp */ dayTimestamp: string; fillCount: number; volumeUsdc: string; cumulativeFillCount: number; cumulativeVolumeUsdc: string; /** monotonic, incremented on every update */ updateSequence: string; updatedAt: string; } /** * * @id "{chainId}_{payeeDetailsHash}_{paymentPlatform}" */ export interface DailyPlatformVolumeCursor { /** "{chainId}_{payeeDetailsHash}_{paymentPlatform}" */ id: string; chainId: number; payeeDetailsHash: string; paymentPlatform: string; /** current owner of payeeDetailsHash at time of latest write */ maker: string; lastDayTimestamp: string; cumulativeFillCount: number; cumulativeVolumeUsdc: string; updatedAt: string; } /** * * @id "{chainId}_{dayTimestamp}" */ export interface GlobalDailyStats { /** "{chainId}_{dayTimestamp}" */ id: string; chainId: number; /** UTC day start timestamp */ dayTimestamp: string; fulfilledVolumeUsdCents: string; realizedPnlUsdCents: string; fulfilledIntentCount: number; vaultFulfilledVolumeUsdCents: string; vaultFulfilledIntentCount: number; activeMakersCount: number; cumulativeFulfilledVolumeUsdCents: string; cumulativeRealizedPnlUsdCents: string; cumulativeFulfilledIntentCount: number; cumulativeVaultFulfilledVolumeUsdCents: string; cumulativeVaultFulfilledIntentCount: number; updatedAt: string; } /** * * @id "{chainId}" */ export interface GlobalDailyCursor { /** "{chainId}" */ id: string; chainId: number; lastDayTimestamp: string; cumulativeFulfilledVolumeUsdCents: string; cumulativeRealizedPnlUsdCents: string; cumulativeFulfilledIntentCount: number; cumulativeVaultFulfilledVolumeUsdCents: string; cumulativeVaultFulfilledIntentCount: number; updatedAt: string; } /** * * @id "{chainId}_{dayTimestamp}_{maker}" */ export interface GlobalDailyActiveMaker { /** "{chainId}_{dayTimestamp}_{maker}" */ id: string; chainId: number; /** UTC day start timestamp */ dayTimestamp: string; maker: string; updatedAt: string; } /** * * @id "{chainId}_{paymentPlatform}_{dayTimestamp}" */ export interface PlatformDailyStats { /** "{chainId}_{paymentPlatform}_{dayTimestamp}" */ id: string; chainId: number; /** active payment method name used by DailyPlatformVolume */ paymentPlatform: string; /** UTC day start timestamp */ dayTimestamp: string; fillCount: number; /** USDC micros taken via fulfillments that day (same basis as DailyPlatformVolume: gross released/transferred amount) */ volumeUsdc: string; /** realized maker profit attributed to this platform that day */ realizedPnlUsdCents: string; /** time-weighted capital listed on this platform that day */ capitalUsdCentsDays: string; cumulativeFillCount: number; cumulativeVolumeUsdc: string; cumulativeRealizedPnlUsdCents: string; cumulativeCapitalUsdCentsDays: string; updatedAt: string; } /** * * @id "{chainId}_{paymentPlatform}" */ export interface PlatformDailyCursor { /** "{chainId}_{paymentPlatform}" */ id: string; chainId: number; paymentPlatform: string; lastDayTimestamp: string; cumulativeFillCount: number; cumulativeVolumeUsdc: string; cumulativeRealizedPnlUsdCents: string; cumulativeCapitalUsdCentsDays: string; updatedAt: string; } /** * * @id "{chainId}_{maker}_{dayTimestamp}" */ export interface MakerDailySnapshot { /** "{chainId}_{maker}_{dayTimestamp}" */ id: string; chainId: number; maker: string; /** UTC day start timestamp */ dayTimestamp: string; fillsToday: number; earnedTodayUsdCents: string; fulfilledVolumeUsdc?: string; spreadBpsVolumeWeightedSum?: string; spreadWeightedVolumeUsdc?: string; capitalUsdCentsDay?: string; cumulativePnlUsdCents: string; cumulativeVolumeUsdc: string; cumulativeFulfilledIntents: number; cumulativeSpreadBpsVolumeWeightedSum: string; cumulativeSpreadWeightedVolumeUsdc: string; cumulativeCapitalUsdCentsDay: string; activeDeposits: number; averageLivePct: number; updateSequence: string; updatedAt: string; } /** * * @id "{chainId}_{maker}" */ export interface MakerDailyCursor { /** "{chainId}_{maker}" */ id: string; chainId: number; maker: string; lastDayTimestamp: string; cumulativePnlUsdCents: string; cumulativeVolumeUsdc: string; cumulativeFulfilledIntents: number; cumulativeSpreadBpsVolumeWeightedSum: string; cumulativeSpreadWeightedVolumeUsdc: string; cumulativeCapitalUsdCentsDay: string; updatedAt: string; } /** * * @id "{chainId}_{maker}" */ export interface MakerRolling90DayStats { /** "{chainId}_{maker}" */ id: string; chainId: number; maker: string; /** UTC day bucket at the start of the 90-day window */ windowStartDayTimestamp: string; /** UTC day bucket at the end of the 90-day window */ windowEndDayTimestamp: string; /** Fulfilled/manual-release USDC base units across the window */ totalAmountTaken: string; /** Fulfilled/manual-release intent count across the window */ fulfilledIntents: number; /** True once dormant maker's trailing window is provably empty */ isSettledToZero?: boolean; /** UTC day when the live sweep should next revisit this row */ nextSweepDayTimestamp?: string; updatedAt: string; } /** * * @id chainId_maker_paymentMethodHash */ export interface MakerPlatformStats { /** chainId_maker_paymentMethodHash */ id: string; chainId: number; maker: string; paymentMethodHash: string; totalAmountTaken: string; /** Fulfilled volume excluding manual releases */ nonManualReleaseVolume: string; /** Fulfilled volume from manual releases */ manualReleaseVolume: string; fulfilledIntents: number; prunedIntents: number; manualReleaseCount: number; realizedProfitUsdCents: string; computedProfitSnapshots: number; updatedAt: string; } /** * * @id chainId_maker_currencyCode */ export interface MakerCurrencyStats { /** chainId_maker_currencyCode */ id: string; chainId: number; maker: string; currencyCode: string; totalAmountTaken: string; fulfilledIntents: number; prunedIntents: number; manualReleaseCount: number; updatedAt: string; } /** * * @id currencyCode_timestampHour */ export interface PriceSnapshot { /** currencyCode_timestampHour */ id: string; currencyCode: string; timestampDay: string; rateUsd: string; ratePrecision: number; provider: string; source: string; status: PriceSnapshotStatus; effectiveAt: string; retrievedAt: string; createdAt: string; updatedAt: string; } /** * * @id intentId */ export interface MakerProfitSnapshot { /** intentId */ id: string; chainId: number; maker: string; intentId: string; depositId: string; fiatCurrency: string; quoteConversionRate: string; oracleRate?: string; spreadBps?: number; amount: string; notionalFiatUsdCents?: string; feeUsd?: string; realizedProfitUsdCents?: string; priceSnapshotId?: string; status: ProfitStatus; paymentMethodHash: string; paymentPlatform: string; createdAt: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId */ export interface RateManager { /** chainId_rateManagerAddress_rateManagerId */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; manager: string; feeRecipient: string; maxFee: string; fee: string; minLiquidity: string; name?: string; uri?: string; createdAt: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId_paymentMethodHash_currencyCode */ export interface RateManagerRate { /** chainId_rateManagerAddress_rateManagerId_paymentMethodHash_currencyCode */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; paymentMethodHash: string; currencyCode: string; managerRate: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId */ export interface ManagerAggregateStats { /** chainId_rateManagerAddress_rateManagerId */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; manager: string; totalFilledVolume: string; totalFeeAmount: string; totalPnlUsdCents: string; fulfilledIntents: number; currentDelegatedBalance: string; currentDelegatedDeposits: number; firstSeenAt?: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId_dayTimestamp */ export interface ManagerDailySnapshot { /** chainId_rateManagerAddress_rateManagerId_dayTimestamp */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; dayTimestamp: string; tvl: string; delegatedDeposits: number; delegatedCapitalUsdCentsDays: string; activeDepositorsCount: number; dailyVolume: string; dailyFees: string; dailyPnlUsdCents: string; dailyFulfilledIntents: number; cumulativeVolume: string; cumulativeFees: string; cumulativePnlUsdCents: string; cumulativeFulfilledIntents: number; cumulativeDelegatedCapitalUsdCentsDays: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId */ export interface ManagerDailyCursor { /** chainId_rateManagerAddress_rateManagerId */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; lastDayTimestamp: string; lastCapitalAccruedAt: string; cumulativeVolume: string; cumulativeFees: string; cumulativePnlUsdCents: string; cumulativeFulfilledIntents: number; cumulativeDelegatedCapitalUsdCentsDays: string; updatedAt: string; } /** * * @id "{chainId}" */ export interface DailyCapitalSweepCursor { /** "{chainId}" */ id: string; chainId: number; /** latest completed UTC day start swept */ lastSweptDayTimestamp: string; updatedAt: string; } /** * * @id txHash_logIndex */ export interface DepositFundActivity { /** txHash_logIndex */ id: string; chainId: number; /** FK -> Deposit.id */ depositId: string; depositor: string; /** DEPOSIT_RECEIVED | FUNDS_ADDED | WITHDRAWN | CLOSED */ activityType: string; amount: string; blockNumber: string; timestamp: string; txHash: string; } /** * * @id depositId_dayTimestamp */ export interface DepositDailySnapshot { /** depositId_dayTimestamp */ id: string; chainId: number; /** FK -> Deposit.id */ depositId: string; depositor: string; dayTimestamp: string; remainingDeposits: string; outstandingIntentAmount: string; totalAmountTaken: string; totalWithdrawn: string; signaledIntents: number; fulfilledIntents: number; prunedIntents: number; successRateBps: number; /** USDC taken via fulfillments that day */ dailyVolume: string; /** Realized profit that day */ dailyPnlUsdCents: string; /** Time-weighted live balance denominator for APR */ capitalUsdCentsDay?: string; cumulativeVolume: string; cumulativePnlUsdCents: string; cumulativeCapitalUsdCentsDay: string; updatedAt: string; } /** * * @id depositId */ export interface DepositDailyCursor { /** depositId */ id: string; chainId: number; depositId: string; depositor: string; lastDayTimestamp: string; lastCapitalAccruedAt: string; cumulativeVolume: string; cumulativePnlUsdCents: string; cumulativeCapitalUsdCentsDay: string; updatedAt: string; } /** * * @id chainId_rateManagerAddress_rateManagerId_depositId */ export interface ManagerStats { /** chainId_rateManagerAddress_rateManagerId_depositId */ id: string; chainId: number; rateManagerAddress: string; rateManagerId: string; depositId: string; depositor: string; currentDelegatedBalance: string; totalAmountTaken: string; totalWithdrawn: string; fulfilledIntents: number; prunedIntents: number; successRateBps: number; updatedAt: string; } /** * Current liquidity for one fiat currency across all active deposits on a chain. * * @id chainId_currencyCode */ export interface CurrencyLiquidity { /** `chainId_currencyCode`. */ id: string; /** Chain containing the active deposits. Indexed. */ chainId: number; /** Fiat currency bytes32 hash selected by the active quotes. Indexed. */ currencyCode: string; /** Immediately available liquidity, in the deposited token's native units. */ availableTokenAmount: string; /** Latest aggregate refresh timestamp. */ updatedAt: string; } /** * Deduplicated contribution from one deposit to `CurrencyLiquidity`. Multiple active payment methods for the same deposit/currency count once. * * @id depositId_currencyCode */ export interface DepositCurrencyLiquidity { /** `depositId_currencyCode`. */ id: string; /** Chain containing the deposit. Indexed. */ chainId: number; /** Foreign key to `Deposit.id`, formatted `escrowAddress_depositIdOnContract` with the escrow address lowercase-normalized. Indexed. */ depositId: string; /** Fiat currency bytes32 hash for this contribution. Indexed. */ currencyCode: string; /** Deposit contribution, in the deposited token's native units. */ availableTokenAmount: string; /** Latest contribution refresh timestamp. */ updatedAt: string; } /** * Current liquidity for one deposited token across all active deposits on a chain. * * @id chainId_token */ export interface TokenLiquidity { /** `chainId_token`. */ id: string; /** Chain containing the active deposits. Indexed. */ chainId: number; /** Deposited token address. Indexed. */ token: string; /** Immediately available liquidity, in the token's native units. */ availableTokenAmount: string; /** Latest aggregate refresh timestamp. */ updatedAt: string; } /** * Deduplicated contribution from one deposit to `TokenLiquidity`. A deposit contributes once when it has at least one active quote. * * @id depositId */ export interface DepositTokenLiquidity { /** Bare `depositId` with no suffix; exactly `Deposit.id`. */ id: string; /** Chain containing the deposit. Indexed. */ chainId: number; /** Foreign key to `Deposit.id`, formatted `escrowAddress_depositIdOnContract` with the escrow address lowercase-normalized. Indexed. */ depositId: string; /** Deposited token address. Indexed. */ token: string; /** Deposit contribution, in the token's native units. */ availableTokenAmount: string; /** Latest contribution refresh timestamp. */ updatedAt: string; } /** * Current liquidity for one fiat currency and payment-platform pair across all active deposits on a chain. * * @id chainId_currencyCode_paymentMethodHash */ export interface CurrencyPlatformLiquidity { /** `chainId_currencyCode_paymentMethodHash`. */ id: string; /** Chain containing the active deposits. Indexed. */ chainId: number; /** Fiat currency bytes32 hash selected by the active quotes. Indexed. */ currencyCode: string; /** Payment method identifying the platform. Indexed. */ paymentMethodHash: string; /** Immediately available liquidity, in the deposited token's native units. */ availableTokenAmount: string; /** Latest aggregate refresh timestamp. */ updatedAt: string; } /** * Deduplicated contribution from one deposit to `CurrencyPlatformLiquidity`. * * @id depositId_currencyCode_paymentMethodHash */ export interface DepositCurrencyPlatformLiquidity { /** `depositId_currencyCode_paymentMethodHash`. */ id: string; /** Chain containing the deposit. Indexed. */ chainId: number; /** Foreign key to `Deposit.id`, formatted `escrowAddress_depositIdOnContract` with the escrow address lowercase-normalized. Indexed. */ depositId: string; /** Fiat currency bytes32 hash for this contribution. Indexed. */ currencyCode: string; /** Payment method identifying the platform. Indexed. */ paymentMethodHash: string; /** Deposit contribution, in the deposited token's native units. */ availableTokenAmount: string; /** Latest contribution refresh timestamp. */ updatedAt: string; } /** * Read-optimized join of `Deposit`, `DepositPaymentMethod`, and `MethodCurrency`. * * @id escrowAddress_depositId_paymentMethodHash_currencyCode */ export interface QuoteCandidate { /** Same tuple identity as the backing `MethodCurrency`. */ id: string; /** Chain where the quoteable deposit lives */ chainId: number; /** Raw on-chain deposit id */ depositIdOnContract: string; /** Foreign key to `Deposit.id`. */ depositId: string; /** Escrow address holding the deposit */ escrowAddress: string; /** Maker address that owns the deposit */ depositor: string; /** ERC20 token address being sold */ token: string; /** Payment method bytes32 hash */ paymentMethodHash: string; /** Fiat currency bytes32 hash */ currencyCode: string; /** Gross resolved conversion rate. */ conversionRate?: string; /** Raw oracle rate before spread, copied from MethodCurrency */ oracleRate?: string; /** All-in taker-facing rate. */ takerConversionRate?: string; /** 1e18 manager fee rate applied separately at fulfillment */ managerFee?: string; /** Delegated rate manager id, copied from MethodCurrency */ rateManagerId?: string; /** Current immediately available liquidity. */ availableTokenAmount: string; /** min(availableTokenAmount, intentAmountMax) for nearby token quote ordering */ maxTokenAvailablePerIntent: string; /** maxTokenAvailablePerIntent converted using takerConversionRate */ maxFiatAvailablePerIntent: string; /** availableTokenAmount converted using takerConversionRate */ maxQuoteableFiat: string; /** Minimum token amount the maker will accept per intent */ intentAmountMin: string; /** Maximum token amount the maker will accept per intent */ intentAmountMax: string; /** Maker success rate for deposit-level filtering */ successRateBps: number; /** Hashed payee details required for verification */ payeeDetailsHash: string; /** Optional gating service that must authorize takers */ intentGatingService?: string; /** Lowercase guardian configured on the source deposit; legacy V2 deposits use the zero address sentinel. Indexed for exact `_eq` and `_in` filtering. */ intentGuardian: string; /** OrchestratorV2 per-deposit whitelist hook; null under OrchestratorV3 */ whitelistHookAddress?: string; /** Whether the V3 whitelist policy is enabled. */ whitelistEnabled: boolean; /** Whether the depositor explicitly opted this deposit/payment-method tuple out on the active policy. Missing config and `enabled: true` are not opted out. */ disputeProtectionOptedOut: boolean; /** Whether the active policy routes this non-opted-out tuple through stake-backed admission because the payment method has a nonzero risk window. */ disputeProtectionRequiresStake: boolean; /** Allowed V3 address-group identifiers. */ allowedGroupIds: string[]; /** Payment method active, deposit accepting intents, and non-zero taker rate. */ isActive: boolean; /** Whether availableTokenAmount is at least intentAmountMin */ hasMinLiquidity: boolean; /** intentAmountMin converted using takerConversionRate */ minFiatSupported: string; /** intentAmountMax converted using takerConversionRate */ maxFiatSupported: string; /** availableTokenAmount converted using takerConversionRate */ maxFiatAvail: string; /** Latest projection refresh timestamp. */ updatedAt: string; } /** * Consumer-facing projection materialized from an active supported `QuoteCandidate`. `disputeProtectionOptedOut`, `disputeProtectionRequiresStake`, `whitelistEnabled`, and `allowedGroupIds` are copied without reinterpretation. `intentGatingService` is projected from `QuoteCandidate` and is non-null, with the zero address as the ungated sentinel; unlike its source, it is lowercase-normalized so consumers can compare addresses with exact equality. These projections report token amounts immediately available for new intents through active quote rows. Amounts use the deposited token's native units; USDC amounts therefore have 6 decimals. The `Deposit*` rows are deduplicated per-deposit contributions used to maintain the chain-level aggregates, which are updated by applying deltas against the stored contribution. `currencyCode` is the fiat currency bytes32 hash; `currencyCode`, `paymentMethodHash`, and `token` are lowercase-normalized in both entity IDs and stored fields, so consumers can use exact equality with lowercase values. A computed negative aggregate is refused and logged instead of written, so aggregates never go negative. * * @id deposit/payment-platform/currency tuple identity */ export interface OrderbookEntry { /** deposit/payment-platform/currency tuple identity */ id: string; chainId: number; depositIdOnContract: string; depositId: string; escrowAddress: string; depositor: string; token: string; paymentMethodHash: string; paymentPlatform: string; currencyCode: string; currency: string; /** Taker-facing all-in conversion rate */ price: string; /** Raw oracle rate before spread, copied from QuoteCandidate */ oracleRate?: string; /** Final gross resolved rate copied from QuoteCandidate */ conversionRate?: string; /** Delegated rate manager id, copied from QuoteCandidate */ rateManagerId?: string; availableTokenAmount: string; availableFiatAmount: string; intentAmountMin: string; intentAmountMax: string; minFiatSupported: string; maxFiatSupported: string; hasMinLiquidity: boolean; successRateBps: number; payeeDetailsHash: string; /** Non-null admission gate; zero address is ungated; lowercase-normalized for exact equality */ intentGatingService: string; /** OrchestratorV2 per-deposit whitelist hook; null under OrchestratorV3 */ whitelistHookAddress?: string; /** OrchestratorV3 deposit/payment-method policy gate; false means fail-open */ whitelistEnabled: boolean; /** Depositor explicitly opted this deposit/payment-method tuple out of default-on dispute protection on the active policy */ disputeProtectionOptedOut: boolean; /** Active policy routes non-whitelisted takers through stake-backed admission (not opted out and nonzero risk window) */ disputeProtectionRequiresStake: boolean; /** OrchestratorV3 deposit/payment-method policy group ids */ allowedGroupIds: string[]; isActive: boolean; updatedAt: string; } /** * Per-deposit taker whitelist entry. Created when a taker is whitelisted for a specific deposit via a WhitelistPreIntentHook contract. Deleted when the taker is removed or the hook is rotated. * * @id escrowAddress_depositId_taker */ export interface WhitelistEntry { /** escrowAddress_depositId_taker */ id: string; chainId: number; hookAddress: string; escrowAddress: string; depositId: string; depositIdOnContract: string; taker: string; createdAt: string; updatedAt: string; } /** * Curator-managed address group in an AddressGroupRegistry. Groups are only unique per * (chainId, registryAddress, groupId); attaching a group to a deposit delegates admission * policy to the group's curator and optional resolver contract. * * @id chainId_registryAddress_groupId */ export interface AddressGroup { /** chainId_registryAddress_groupId */ id: string; chainId: number; registryAddress: string; groupId: string; /** Human-readable label from GroupCreated (event-only, not stored on-chain) */ name: string; /** Curator responsible for group admission policy */ curator: string; /** Nonzero pending curator during a 2-step transfer */ pendingCurator?: string; /** Optional external membership resolver contract; null = curated members only */ resolver?: string; isPublic: boolean; /** Count of curated membership rows (resolver-side members excluded) */ memberCount: number; createdAt: string; updatedAt: string; } /** * Curated membership row for an AddressGroup. Deleted when the member is removed; * resolver-based (external contract) membership is not representable on-chain as events * and is therefore not indexed. * * @id chainId_registryAddress_groupId_member */ export interface AddressGroupMember { /** chainId_registryAddress_groupId_member */ id: string; chainId: number; registryAddress: string; groupId: string; /** Foreign key to AddressGroup.id */ groupEntityId: string; member: string; createdAt: string; updatedAt: string; } /** * Whitelist-group configuration keyed by `chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash`. * * @id chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash */ export interface DepositWhitelistPolicy { /** chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash */ id: string; chainId: number; policyAddress: string; escrowAddress: string; /** Foreign key to `Deposit.id`. */ depositId: string; depositIdOnContract: string; /** Payment method whose group gate is configured. */ paymentMethodHash: string; /** Whether the tuple enforces direct-address or curated-group membership. */ enabled: boolean; /** Count of `DepositAllowedGroup` rows for this tuple. */ allowedGroupCount: number; /** Deposit-wide direct-address count repeated on each method policy. */ whitelistedAddressCount: number; createdAt: string; updatedAt: string; } /** * Deposit-wide direct taker admission keyed by `chainId_policyAddress_escrowAddress_depositIdOnContract_taker`. These rows intentionally have no payment-method or `DepositWhitelistPolicy` foreign key. * * @id chainId_policyAddress_escrowAddress_depositIdOnContract_taker */ export interface DepositWhitelistedAddress { /** chainId_policyAddress_escrowAddress_depositIdOnContract_taker */ id: string; chainId: number; policyAddress: string; escrowAddress: string; /** Foreign key to Deposit.id */ depositId: string; depositIdOnContract: string; taker: string; createdAt: string; updatedAt: string; } /** * One curated group admitted for a deposit/payment-method tuple. Its ID appends `groupId` to the corresponding `DepositWhitelistPolicy.id`. * * @id chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash_groupId */ export interface DepositAllowedGroup { /** chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash_groupId */ id: string; chainId: number; policyAddress: string; escrowAddress: string; /** Foreign key to Deposit.id */ depositId: string; depositIdOnContract: string; paymentMethodHash: string; /** Foreign key to DepositWhitelistPolicy.id */ policyEntityId: string; /** bytes32 AddressGroupRegistry group id */ groupId: string; createdAt: string; updatedAt: string; } /** * Current lifecycle hook configured for one OrchestratorV3 deployment. * * @id chainId_orchestratorAddress */ export interface OrchestratorLifecycleHook { /** chainId_orchestratorAddress */ id: string; chainId: number; orchestratorAddress: string; /** null when cleared / zero address */ lifecycleHook?: string; updatedAt: string; } /** * Current admission governance keyed by `chainId_policyAddress`. `admissionsPaused` is the latest pause state. `authorizedLifecycleHooks` is a lowercase, sorted, duplicate-free set. Either governance event can initialize the row while preserving the other field's safe default/current value. * * @id chainId_policyAddress */ export interface DisputeProtectionPolicyState { /** chainId_policyAddress */ id: string; chainId: number; policyAddress: string; admissionsPaused: boolean; authorizedLifecycleHooks: string[]; updatedAtBlockNumber: string; updatedAt: string; } /** * Current registry membership keyed by `chainId_registryAddress_orchestratorAddress`. Add events set `registered: true`; removal overwrites the same row with `registered: false`, including when removal is the first indexed event. * * @id chainId_registryAddress_orchestratorAddress */ export interface OrchestratorRegistrationState { /** chainId_registryAddress_orchestratorAddress */ id: string; chainId: number; registryAddress: string; orchestratorAddress: string; registered: boolean; updatedAtBlockNumber: string; updatedAt: string; } /** * Group attached to a deposit on a WhitelistPreIntentHookV2. Faithful mirror of hook * storage: rows persist across whitelist-hook rotation on the deposit (hook config is * point-in-time admission policy that resumes if the hook is reattached). Consumers derive * the effective policy by joining Deposit.whitelistHookAddress == hookAddress. * * @id chainId_hookAddress_escrowAddress_depositIdOnContract_groupId */ export interface DepositGroupAttachment { /** chainId_hookAddress_escrowAddress_depositIdOnContract_groupId */ id: string; chainId: number; hookAddress: string; escrowAddress: string; /** Foreign key to Deposit.id (escrowAddress_depositId) */ depositId: string; depositIdOnContract: string; groupId: string; createdAt: string; updatedAt: string; } /** * `selectedStakeOwner` preserves the raw emitted preference. `selectionAuthorized` reflects the matching `TakerStakeAuthorization`, and `stakeOwner` is the effective owner: the selected owner only while authorized, otherwise the taker. Authorization and revocation recompute effective state; unrelated owner updates do not rewrite it. An absent selection means self-backed operation. * * @id chainId_vaultAddress_taker */ export interface TakerStakeState { /** chainId_vaultAddress_taker */ id: string; chainId: number; vaultAddress: string; taker: string; /** Effective owner: selectedStakeOwner when valid, otherwise taker */ stakeOwner: string; selectedStakeOwner?: string; selectionAuthorized: boolean; updatedAtBlockNumber: string; updatedAt: string; } /** * Authoritative total, locked, and free stake for one owner. `freeStake = max(totalStake - lockedStake, 0)`. * * @id chainId_vaultAddress_stakeOwner */ export interface StakeAccountState { /** chainId_vaultAddress_stakeOwner */ id: string; chainId: number; vaultAddress: string; stakeOwner: string; totalStake: string; lockedStake: string; freeStake: string; updatedAtBlockNumber: string; updatedAt: string; } /** * Immediately withdrawable beneficiary claim balance, separate from stake principal. * * @id chainId_vaultAddress_beneficiary */ export interface ClaimAccountState { /** chainId_vaultAddress_beneficiary */ id: string; chainId: number; vaultAddress: string; beneficiary: string; claimableAmount: string; updatedAtBlockNumber: string; updatedAt: string; } /** * One stake owner's authorization for one taker. Multiple owners may authorize the same taker. * * @id chainId_vaultAddress_stakeOwner_taker */ export interface TakerStakeAuthorization { /** chainId_vaultAddress_stakeOwner_taker */ id: string; chainId: number; vaultAddress: string; taker: string; stakeOwner: string; authorized: boolean; updatedAtBlockNumber: string; updatedAt: string; } /** * Generic opaque lock lifecycle. Current status is `ACTIVE`, `UNLOCKED`, or `RESOLVED`. * * @id chainId_vaultAddress_lockId */ export interface StakeLock { /** Immutable opaque pagination cursor, keyed by `chainId_vaultAddress_lockId`. */ id: string; /** Exact chain filter. */ chainId: number; /** Exact StakeVault filter. */ vaultAddress: string; lockId: string; /** Exact merchant stake-owner filter. */ stakeOwner: string; initialAmount: string; currentAmount: string; /** Current maturity surfaced to the UI. This value is mutable and is not the cursor. */ maturesAt: string; /** Optional lifecycle filter. */ status: StakeLockStatus; unlockedAmount: string; claimedAmount: string; createdAt: string; updatedAtBlockNumber: string; updatedAt: string; } /** * Append-only stake, authorization, selection, lock, resolution, and claim history. Current balances come from state entities, not activity sums. * * @id chainId_blockNumber_logIndex */ export interface StakeActivity { /** Immutable final tie-breaker in `chainId_blockNumber_logIndex` form. */ id: string; /** Exact chain filter. */ chainId: number; /** Exact StakeVault filter. */ vaultAddress: string; /** Optional owner side of merchant relevance. */ stakeOwner?: string; /** Optional taker side of merchant relevance. */ taker?: string; beneficiary?: string; /** Optional activity-kind filter. */ kind: StakeActivityKind; lockId?: string; counterparty?: string; amount: string; previousAmount?: string; stakeBalanceAfter?: string; lockedStakeAfter?: string; freeStakeAfter?: string; claimableAfter?: string; maturesAt?: string; /** First ascending event cursor component. */ blockNumber: string; /** Second ascending event cursor component. */ logIndex: string; timestamp: string; } /** * Immutable binding keyed by `chainId_registryAddress_nullifier`. * * @id chainId_registryAddress_nullifier */ export interface PaymentIntentBinding { /** chainId_registryAddress_nullifier */ id: string; chainId: number; registryAddress: string; nullifier: string; /** Intent permanently bound to the nullifier. */ intentHash: string; /** Authorized verifier that created the binding. */ writer: string; transactionHash: string; logIndex: string; blockNumber: string; blockTimestamp: string; } /** * Current Escrow base intent period used before paid extensions begin. * * @id chainId_escrowAddress */ export interface EscrowIntentPeriodState { /** chainId_escrowAddress */ id: string; chainId: number; escrowAddress: string; intentExpirationPeriod: string; observedFrom: EscrowIntentPeriodSource; updatedAt: string; } /** * Current controller plus pending delayed-controller handoff. The current Policy/registry entities, split dispute-projection facts, and dispute cursor fields require a clean staging and production reindex. An older database cannot distinguish an absent field from an explicit opt-out. * * @id chainId_vaultAddress */ export interface StakeVaultConfig { /** chainId_vaultAddress */ id: string; chainId: number; vaultAddress: string; controller?: string; pendingController?: string; pendingControllerValidAt?: string; updatedAtBlockNumber: string; updatedAt: string; } /** * Current dispute protection intent keyed by `chainId_intentHash`. * * @id chainId_intentHash */ export interface DisputeProtectionIntent { /** chainId_intentHash */ id: string; chainId: number; /** DisputeProtectionPolicy that emitted the lifecycle. */ policyAddress: string; intentHash: string; /** `PENDING`, `CANCELLED`, `SETTLED`, `RELEASED`, or `DISPUTED`. */ status: DisputeProtectionIntentStatus; /** Owner whose StakeVault collateral backs the intent. */ stakeOwner: string; /** Deposit owner and dispute compensation beneficiary. */ depositor: string; /** Intent taker. */ taker: string; /** Payment-method hash used to select the risk window. */ paymentMethod: string; /** Full intent amount locked as collateral at open; settlement resizes collateral to `releaseAmount`. */ amount: string; /** Window snapshotted at admission. */ riskWindow: string; /** Earliest collateral-release time. Disputes remain valid until release executes. */ releaseEligibleAt?: string; /** Amount released from Escrow before fees and collateralized after settlement. */ releaseAmount?: string; /** Whether the underlying settlement was manual. */ isManualRelease?: boolean; /** Amount awarded by `DisputeResolved`. */ compensatedAmount?: string; /** Consumed dispute identifier. */ disputeId?: string; openedAt: string; openedTxHash: string; cancelledAt?: string; cancelledTxHash?: string; settledAt?: string; settledTxHash?: string; releasedAt?: string; releasedTxHash?: string; disputedAt?: string; disputedTxHash?: string; /** Block number of `DisputeResolved`; null before a dispute. */ disputedAtBlockNumber?: string; /** Log index of `DisputeResolved`; null before a dispute. */ disputedAtLogIndex?: string; updatedAt: string; } /** * Deposit/payment-method-scoped configuration keyed by `chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash`. * * @id chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash */ export interface DepositDisputeProtectionConfig { /** chainId_policyAddress_escrowAddress_depositIdOnContract_paymentMethodHash */ id: string; chainId: number; policyAddress: string; escrowAddress: string; /** Foreign key to `Deposit.id`. */ depositId: string; depositIdOnContract: string; /** Payment method whose future intents use this default-on, per-tuple opt-out setting. */ paymentMethodHash: string; /** Raw event value: `false` records a depositor opt-out, `true` undoes it, and absence is the default (on for windowed methods). */ enabled: boolean; /** Latest `DisputeProtectionEnabledUpdated` timestamp. */ updatedAt: string; } /** * Future-admission minimum hold keyed by `chainId_policyAddress_paymentMethod`. Existing intents retain their snapshotted `DisputeProtectionIntent.riskWindow`. * * @id chainId_policyAddress_paymentMethod */ export interface DisputeProtectionRiskWindow { /** chainId_policyAddress_paymentMethod */ id: string; chainId: number; policyAddress: string; paymentMethod: string; riskWindow: string; updatedAt: string; } /** * Per-intent OrchestratorV3 lifecycle-hook snapshot keyed by `chainId_intentHash`. A zero-address hook is stored as null. * * @id chainId_intentHash */ export interface IntentLifecycleHookState { /** chainId_intentHash */ id: string; chainId: number; intentHash: string; orchestratorAddress: string; lifecycleHook?: string; updatedAt: string; }