From b0e13011d638f0e49faa136a4825d4d127ea2df9 Mon Sep 17 00:00:00 2001 From: Piotr Witek <739075+piotrwitek@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:15:39 +0100 Subject: [PATCH] Updated Armada protocol entities --- .../src/generated/client.ts | 274 ++++++++++++++++-- pnpm-lock.yaml | 9 +- sdk/armada-protocol-common/package.json | 1 + .../src/common/interfaces/IArmadaManager.ts | 2 +- .../src/common/interfaces/index.ts | 5 - sdk/armada-protocol-common/src/index.ts | 2 + .../common/implementation/ArmadaManager.ts | 3 +- .../common/implementation/RebalanceData.ts | 35 --- .../src/common/implementation/index.ts | 1 - sdk/contracts-provider-common/package.json | 1 - .../contracts/IFleetCommanderContract.ts | 9 +- .../interfaces/types/FleetCommander/index.ts | 1 - ...DataSolidity.ts => FleetCommanderTypes.ts} | 0 .../src/interfaces/types/IFleetConfig.ts | 18 ++ .../src/interfaces/types}/IRebalanceData.ts | 6 - .../src/interfaces/types/index.ts | 4 +- .../FleetCommanderContract.ts | 26 +- .../governance/forceRebalance.ts | 8 +- .../keepers/adjustBuffer.ts | 8 +- .../keepers/rebalance.ts | 8 +- .../src/generated/client.ts | 274 ++++++++++++++++-- 21 files changed, 551 insertions(+), 144 deletions(-) delete mode 100644 sdk/armada-protocol-service/src/common/implementation/RebalanceData.ts delete mode 100644 sdk/contracts-provider-common/src/interfaces/types/FleetCommander/index.ts rename sdk/contracts-provider-common/src/interfaces/types/{FleetCommander/RebalanceDataSolidity.ts => FleetCommanderTypes.ts} (100%) create mode 100644 sdk/contracts-provider-common/src/interfaces/types/IFleetConfig.ts rename sdk/{armada-protocol-common/src/common/interfaces => contracts-provider-common/src/interfaces/types}/IRebalanceData.ts (88%) diff --git a/packages/summer-earn-protocol-subgraph/src/generated/client.ts b/packages/summer-earn-protocol-subgraph/src/generated/client.ts index 2c958c5568..afb0216ba8 100644 --- a/packages/summer-earn-protocol-subgraph/src/generated/client.ts +++ b/packages/summer-earn-protocol-subgraph/src/generated/client.ts @@ -396,7 +396,8 @@ export enum ArkDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -410,6 +411,11 @@ export enum ArkDailySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -596,7 +602,8 @@ export enum ArkHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -610,6 +617,11 @@ export enum ArkHourlySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -878,6 +890,11 @@ export enum Ark_OrderBy { RewardTokens = 'rewardTokens', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1172,7 +1189,8 @@ export enum Board_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1186,6 +1204,11 @@ export enum Board_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1432,7 +1455,8 @@ export enum Deposit_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1446,6 +1470,11 @@ export enum Deposit_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1730,7 +1759,8 @@ export enum Disembark_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1744,6 +1774,11 @@ export enum Disembark_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1923,7 +1958,8 @@ export enum Event_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2098,7 +2134,8 @@ export enum FinancialsDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2282,6 +2319,11 @@ export enum Position_OrderBy { OutputTokenBalanceNormalized = 'outputTokenBalanceNormalized', OutputTokenBalanceNormalizedInUsd = 'outputTokenBalanceNormalizedInUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -2309,6 +2351,8 @@ export type PostActionArkSnapshot = { ark: Ark; /** Block number of this snapshot */ blockNumber: Scalars['BigInt']['output']; + /** Deposit limit of the ark */ + depositLimit: Scalars['BigInt']['output']; /** { Smart contract address of the vault }-{ # of hours since Unix epoch time } */ id: Scalars['ID']['output']; /** Amount of input token in the pool */ @@ -2364,6 +2408,14 @@ export type PostActionArkSnapshot_Filter = { blockNumber_lte?: InputMaybe; blockNumber_not?: InputMaybe; blockNumber_not_in?: InputMaybe>; + depositLimit?: InputMaybe; + depositLimit_gt?: InputMaybe; + depositLimit_gte?: InputMaybe; + depositLimit_in?: InputMaybe>; + depositLimit_lt?: InputMaybe; + depositLimit_lte?: InputMaybe; + depositLimit_not?: InputMaybe; + depositLimit_not_in?: InputMaybe>; id?: InputMaybe; id_gt?: InputMaybe; id_gte?: InputMaybe; @@ -2460,6 +2512,7 @@ export enum PostActionArkSnapshot_OrderBy { ArkName = 'ark__name', ArkTotalValueLockedUsd = 'ark__totalValueLockedUSD', BlockNumber = 'blockNumber', + DepositLimit = 'depositLimit', Id = 'id', InputTokenBalance = 'inputTokenBalance', Protocol = 'protocol', @@ -2468,7 +2521,8 @@ export enum PostActionArkSnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2482,6 +2536,11 @@ export enum PostActionArkSnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -2662,7 +2721,8 @@ export enum PostActionVaultSnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2676,6 +2736,11 @@ export enum PostActionVaultSnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -3515,6 +3580,8 @@ export type Rebalance = { blockNumber: Scalars['BigInt']['output']; /** Ark that we reblance from */ from: Ark; + /** Post action snapshot of the from ark */ + fromPostAction: PostActionArkSnapshot; /** Transaction hash of the transaction that emitted this event */ hash: Scalars['String']['output']; /** { Transaction hash }-{ Log index } */ @@ -3527,6 +3594,8 @@ export type Rebalance = { timestamp: Scalars['BigInt']['output']; /** Ark that we reblance to */ to: Ark; + /** Post action snapshot of the to ark */ + toPostAction: PostActionArkSnapshot; /** The vault involving this transaction */ vault: Vault; }; @@ -3581,6 +3650,27 @@ export type Rebalance_Filter = { blockNumber_not?: InputMaybe; blockNumber_not_in?: InputMaybe>; from?: InputMaybe; + fromPostAction?: InputMaybe; + fromPostAction_?: InputMaybe; + fromPostAction_contains?: InputMaybe; + fromPostAction_contains_nocase?: InputMaybe; + fromPostAction_ends_with?: InputMaybe; + fromPostAction_ends_with_nocase?: InputMaybe; + fromPostAction_gt?: InputMaybe; + fromPostAction_gte?: InputMaybe; + fromPostAction_in?: InputMaybe>; + fromPostAction_lt?: InputMaybe; + fromPostAction_lte?: InputMaybe; + fromPostAction_not?: InputMaybe; + fromPostAction_not_contains?: InputMaybe; + fromPostAction_not_contains_nocase?: InputMaybe; + fromPostAction_not_ends_with?: InputMaybe; + fromPostAction_not_ends_with_nocase?: InputMaybe; + fromPostAction_not_in?: InputMaybe>; + fromPostAction_not_starts_with?: InputMaybe; + fromPostAction_not_starts_with_nocase?: InputMaybe; + fromPostAction_starts_with?: InputMaybe; + fromPostAction_starts_with_nocase?: InputMaybe; from_?: InputMaybe; from_contains?: InputMaybe; from_contains_nocase?: InputMaybe; @@ -3668,6 +3758,27 @@ export type Rebalance_Filter = { timestamp_not?: InputMaybe; timestamp_not_in?: InputMaybe>; to?: InputMaybe; + toPostAction?: InputMaybe; + toPostAction_?: InputMaybe; + toPostAction_contains?: InputMaybe; + toPostAction_contains_nocase?: InputMaybe; + toPostAction_ends_with?: InputMaybe; + toPostAction_ends_with_nocase?: InputMaybe; + toPostAction_gt?: InputMaybe; + toPostAction_gte?: InputMaybe; + toPostAction_in?: InputMaybe>; + toPostAction_lt?: InputMaybe; + toPostAction_lte?: InputMaybe; + toPostAction_not?: InputMaybe; + toPostAction_not_contains?: InputMaybe; + toPostAction_not_contains_nocase?: InputMaybe; + toPostAction_not_ends_with?: InputMaybe; + toPostAction_not_ends_with_nocase?: InputMaybe; + toPostAction_not_in?: InputMaybe>; + toPostAction_not_starts_with?: InputMaybe; + toPostAction_not_starts_with_nocase?: InputMaybe; + toPostAction_starts_with?: InputMaybe; + toPostAction_starts_with_nocase?: InputMaybe; to_?: InputMaybe; to_contains?: InputMaybe; to_contains_nocase?: InputMaybe; @@ -3723,6 +3834,14 @@ export enum Rebalance_OrderBy { AssetSymbol = 'asset__symbol', BlockNumber = 'blockNumber', From = 'from', + FromPostAction = 'fromPostAction', + FromPostActionApr = 'fromPostAction__apr', + FromPostActionBlockNumber = 'fromPostAction__blockNumber', + FromPostActionDepositLimit = 'fromPostAction__depositLimit', + FromPostActionId = 'fromPostAction__id', + FromPostActionInputTokenBalance = 'fromPostAction__inputTokenBalance', + FromPostActionTimestamp = 'fromPostAction__timestamp', + FromPostActionTotalValueLockedUsd = 'fromPostAction__totalValueLockedUSD', FromCalculatedApr = 'from__calculatedApr', FromCreatedBlockNumber = 'from__createdBlockNumber', FromCreatedTimestamp = 'from__createdTimestamp', @@ -3747,7 +3866,8 @@ export enum Rebalance_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -3760,6 +3880,14 @@ export enum Rebalance_OrderBy { ProtocolType = 'protocol__type', Timestamp = 'timestamp', To = 'to', + ToPostAction = 'toPostAction', + ToPostActionApr = 'toPostAction__apr', + ToPostActionBlockNumber = 'toPostAction__blockNumber', + ToPostActionDepositLimit = 'toPostAction__depositLimit', + ToPostActionId = 'toPostAction__id', + ToPostActionInputTokenBalance = 'toPostAction__inputTokenBalance', + ToPostActionTimestamp = 'toPostAction__timestamp', + ToPostActionTotalValueLockedUsd = 'toPostAction__totalValueLockedUSD', ToCalculatedApr = 'to__calculatedApr', ToCreatedBlockNumber = 'to__createdBlockNumber', ToCreatedTimestamp = 'to__createdTimestamp', @@ -3776,6 +3904,11 @@ export enum Rebalance_OrderBy { ToName = 'to__name', ToTotalValueLockedUsd = 'to__totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -4734,7 +4867,8 @@ export enum UsageMetricsDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -4877,7 +5011,8 @@ export enum UsageMetricsHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -4894,6 +5029,12 @@ export enum UsageMetricsHourlySnapshot_OrderBy { export type Vault = { __typename?: 'Vault'; actionSnapshots: Array; + apr7d: Scalars['BigDecimal']['output']; + apr30d: Scalars['BigDecimal']['output']; + apr90d: Scalars['BigDecimal']['output']; + apr180d: Scalars['BigDecimal']['output']; + apr365d: Scalars['BigDecimal']['output']; + aprValues: Array; arks: Array; arksArray: Array; /** APR based on revenue between last two snapshots */ @@ -5297,7 +5438,8 @@ export enum VaultDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -5314,6 +5456,11 @@ export enum VaultDailySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -5640,7 +5787,8 @@ export enum VaultHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -5657,6 +5805,11 @@ export enum VaultHourlySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -5681,6 +5834,52 @@ export type Vault_Filter = { _change_block?: InputMaybe; actionSnapshots_?: InputMaybe; and?: InputMaybe>>; + apr7d?: InputMaybe; + apr7d_gt?: InputMaybe; + apr7d_gte?: InputMaybe; + apr7d_in?: InputMaybe>; + apr7d_lt?: InputMaybe; + apr7d_lte?: InputMaybe; + apr7d_not?: InputMaybe; + apr7d_not_in?: InputMaybe>; + apr30d?: InputMaybe; + apr30d_gt?: InputMaybe; + apr30d_gte?: InputMaybe; + apr30d_in?: InputMaybe>; + apr30d_lt?: InputMaybe; + apr30d_lte?: InputMaybe; + apr30d_not?: InputMaybe; + apr30d_not_in?: InputMaybe>; + apr90d?: InputMaybe; + apr90d_gt?: InputMaybe; + apr90d_gte?: InputMaybe; + apr90d_in?: InputMaybe>; + apr90d_lt?: InputMaybe; + apr90d_lte?: InputMaybe; + apr90d_not?: InputMaybe; + apr90d_not_in?: InputMaybe>; + apr180d?: InputMaybe; + apr180d_gt?: InputMaybe; + apr180d_gte?: InputMaybe; + apr180d_in?: InputMaybe>; + apr180d_lt?: InputMaybe; + apr180d_lte?: InputMaybe; + apr180d_not?: InputMaybe; + apr180d_not_in?: InputMaybe>; + apr365d?: InputMaybe; + apr365d_gt?: InputMaybe; + apr365d_gte?: InputMaybe; + apr365d_in?: InputMaybe>; + apr365d_lt?: InputMaybe; + apr365d_lte?: InputMaybe; + apr365d_not?: InputMaybe; + apr365d_not_in?: InputMaybe>; + aprValues?: InputMaybe>; + aprValues_contains?: InputMaybe>; + aprValues_contains_nocase?: InputMaybe>; + aprValues_not?: InputMaybe>; + aprValues_not_contains?: InputMaybe>; + aprValues_not_contains_nocase?: InputMaybe>; arksArray?: InputMaybe>; arksArray_?: InputMaybe; arksArray_contains?: InputMaybe>; @@ -5948,6 +6147,12 @@ export type Vault_Filter = { export enum Vault_OrderBy { ActionSnapshots = 'actionSnapshots', + Apr7d = 'apr7d', + Apr30d = 'apr30d', + Apr90d = 'apr90d', + Apr180d = 'apr180d', + Apr365d = 'apr365d', + AprValues = 'aprValues', Arks = 'arks', ArksArray = 'arksArray', CalculatedApr = 'calculatedApr', @@ -5988,7 +6193,8 @@ export enum Vault_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -6236,7 +6442,8 @@ export enum Withdraw_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -6250,6 +6457,11 @@ export enum Withdraw_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -6287,7 +6499,8 @@ export type YieldAggregator = Protocol & { hourlyUsageMetrics: Array; /** Smart contract address of the protocol's main contract (Factory, Registry, etc) */ id: Scalars['ID']['output']; - lastUpdateTimestamp?: Maybe; + lastDailyUpdateTimestamp?: Maybe; + lastHourlyUpdateTimestamp?: Maybe; /** Version of the methodology used to compute metrics, loosely based on SemVer format (e.g. 1.0.0) */ methodologyVersion: Scalars['String']['output']; /** Name of the protocol, including version. e.g. Yearn v3 */ @@ -6405,14 +6618,22 @@ export type YieldAggregator_Filter = { id_lte?: InputMaybe; id_not?: InputMaybe; id_not_in?: InputMaybe>; - lastUpdateTimestamp?: InputMaybe; - lastUpdateTimestamp_gt?: InputMaybe; - lastUpdateTimestamp_gte?: InputMaybe; - lastUpdateTimestamp_in?: InputMaybe>; - lastUpdateTimestamp_lt?: InputMaybe; - lastUpdateTimestamp_lte?: InputMaybe; - lastUpdateTimestamp_not?: InputMaybe; - lastUpdateTimestamp_not_in?: InputMaybe>; + lastDailyUpdateTimestamp?: InputMaybe; + lastDailyUpdateTimestamp_gt?: InputMaybe; + lastDailyUpdateTimestamp_gte?: InputMaybe; + lastDailyUpdateTimestamp_in?: InputMaybe>; + lastDailyUpdateTimestamp_lt?: InputMaybe; + lastDailyUpdateTimestamp_lte?: InputMaybe; + lastDailyUpdateTimestamp_not?: InputMaybe; + lastDailyUpdateTimestamp_not_in?: InputMaybe>; + lastHourlyUpdateTimestamp?: InputMaybe; + lastHourlyUpdateTimestamp_gt?: InputMaybe; + lastHourlyUpdateTimestamp_gte?: InputMaybe; + lastHourlyUpdateTimestamp_in?: InputMaybe>; + lastHourlyUpdateTimestamp_lt?: InputMaybe; + lastHourlyUpdateTimestamp_lte?: InputMaybe; + lastHourlyUpdateTimestamp_not?: InputMaybe; + lastHourlyUpdateTimestamp_not_in?: InputMaybe>; methodologyVersion?: InputMaybe; methodologyVersion_contains?: InputMaybe; methodologyVersion_contains_nocase?: InputMaybe; @@ -6565,7 +6786,8 @@ export enum YieldAggregator_OrderBy { FinancialMetrics = 'financialMetrics', HourlyUsageMetrics = 'hourlyUsageMetrics', Id = 'id', - LastUpdateTimestamp = 'lastUpdateTimestamp', + LastDailyUpdateTimestamp = 'lastDailyUpdateTimestamp', + LastHourlyUpdateTimestamp = 'lastHourlyUpdateTimestamp', MethodologyVersion = 'methodologyVersion', Name = 'name', Network = 'network', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 916afd2ec1..8c4b14f800 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2070,6 +2070,9 @@ importers: sdk/armada-protocol-common: dependencies: + '@summerfi/contracts-provider-common': + specifier: workspace:* + version: link:../contracts-provider-common '@summerfi/sdk-common': specifier: workspace:* version: link:../sdk-common @@ -2238,9 +2241,6 @@ importers: '@summerfi/abi-provider-common': specifier: workspace:* version: link:../abi-provider-common - '@summerfi/armada-protocol-common': - specifier: workspace:* - version: link:../armada-protocol-common '@summerfi/blockchain-client-common': specifier: workspace:* version: link:../blockchain-client-common @@ -2638,6 +2638,9 @@ importers: '@summerfi/armada-protocol-common': specifier: workspace:* version: link:../armada-protocol-common + '@summerfi/contracts-provider-common': + specifier: workspace:* + version: link:../contracts-provider-common '@summerfi/protocol-plugins': specifier: workspace:* version: link:../protocol-plugins diff --git a/sdk/armada-protocol-common/package.json b/sdk/armada-protocol-common/package.json index f9f4223b3a..649f610e41 100644 --- a/sdk/armada-protocol-common/package.json +++ b/sdk/armada-protocol-common/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@summerfi/sdk-common": "workspace:*", + "@summerfi/contracts-provider-common": "workspace:*", "@summerfi/subgraph-manager-common": "workspace:*" }, "devDependencies": { diff --git a/sdk/armada-protocol-common/src/common/interfaces/IArmadaManager.ts b/sdk/armada-protocol-common/src/common/interfaces/IArmadaManager.ts index 224198c8f7..f73ccbf033 100644 --- a/sdk/armada-protocol-common/src/common/interfaces/IArmadaManager.ts +++ b/sdk/armada-protocol-common/src/common/interfaces/IArmadaManager.ts @@ -5,8 +5,8 @@ import { IArmadaVaultId } from './IArmadaVaultId' import { IArmadaPoolInfo } from './IArmadaPoolInfo' import { IArmadaPosition } from './IArmadaPosition' import { IArmadaPositionId } from './IArmadaPositionId' -import { IRebalanceData } from './IRebalanceData' import type { GetVaultQuery, GetVaultsQuery } from '@summerfi/subgraph-manager-common' +import type { IRebalanceData } from '@summerfi/contracts-provider-common' /** * @name IArmadaManager diff --git a/sdk/armada-protocol-common/src/common/interfaces/index.ts b/sdk/armada-protocol-common/src/common/interfaces/index.ts index 470a5eca7f..186f50683b 100644 --- a/sdk/armada-protocol-common/src/common/interfaces/index.ts +++ b/sdk/armada-protocol-common/src/common/interfaces/index.ts @@ -31,8 +31,3 @@ export { isArmadaProtocol, } from './IArmadaProtocol' export type { IArmadaProtocol, IArmadaProtocolData } from './IArmadaProtocol' -export { - __signature__ as __irebalancedata__, - isRebalanceData, - type IRebalanceData, -} from './IRebalanceData' diff --git a/sdk/armada-protocol-common/src/index.ts b/sdk/armada-protocol-common/src/index.ts index 4c440f64e1..5fddc7d25a 100644 --- a/sdk/armada-protocol-common/src/index.ts +++ b/sdk/armada-protocol-common/src/index.ts @@ -2,3 +2,5 @@ export * from './common' export * from './orders' export * from './simulator' export * from './types' + +export type { IRebalanceData } from '@summerfi/contracts-provider-common' diff --git a/sdk/armada-protocol-service/src/common/implementation/ArmadaManager.ts b/sdk/armada-protocol-service/src/common/implementation/ArmadaManager.ts index b1a47f58bb..7be1d11a24 100644 --- a/sdk/armada-protocol-service/src/common/implementation/ArmadaManager.ts +++ b/sdk/armada-protocol-service/src/common/implementation/ArmadaManager.ts @@ -5,10 +5,9 @@ import { IArmadaPoolInfo, IArmadaPosition, IArmadaPositionId, - IRebalanceData, } from '@summerfi/armada-protocol-common' import { IConfigurationProvider } from '@summerfi/configuration-provider-common' -import { IContractsProvider } from '@summerfi/contracts-provider-common' +import { IContractsProvider, type IRebalanceData } from '@summerfi/contracts-provider-common' import { IAddress, IPercentage, ITokenAmount, IUser, TransactionInfo } from '@summerfi/sdk-common' import { IArmadaSubgraphManager } from '@summerfi/subgraph-manager-common' import { ArmadaPool } from './ArmadaPool' diff --git a/sdk/armada-protocol-service/src/common/implementation/RebalanceData.ts b/sdk/armada-protocol-service/src/common/implementation/RebalanceData.ts deleted file mode 100644 index 41ef2911e5..0000000000 --- a/sdk/armada-protocol-service/src/common/implementation/RebalanceData.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { IRebalanceData, __irebalancedata__ } from '@summerfi/armada-protocol-common' -import { IAddress, ITokenAmount } from '@summerfi/sdk-common' - -/** - * Type for the parameters of TokenAmount - */ -export type RebalanceDataParameters = Omit - -/** - * @class RebalanceData - * @see IRebalanceData - */ -export class RebalanceData implements IRebalanceData { - /** SIGNATURE */ - readonly [__irebalancedata__] = __irebalancedata__ - - /** ATTRIBUTES */ - readonly fromArk: IAddress - readonly toArk: IAddress - readonly amount: ITokenAmount - - /** FACTORY */ - - static createFrom(params: RebalanceDataParameters): IRebalanceData { - return new RebalanceData(params) - } - - /** SEALED CONSTRUCTOR */ - - private constructor(params: IRebalanceData) { - this.fromArk = params.fromArk - this.toArk = params.toArk - this.amount = params.amount - } -} diff --git a/sdk/armada-protocol-service/src/common/implementation/index.ts b/sdk/armada-protocol-service/src/common/implementation/index.ts index 5de1143f99..626d0ad3b7 100644 --- a/sdk/armada-protocol-service/src/common/implementation/index.ts +++ b/sdk/armada-protocol-service/src/common/implementation/index.ts @@ -7,4 +7,3 @@ export * from './ArmadaPosition' export * from './ArmadaPositionId' export * from './ArmadaProtocol' export * from './ArmadaSimulation' -export * from './RebalanceData' diff --git a/sdk/contracts-provider-common/package.json b/sdk/contracts-provider-common/package.json index cb26f1ac2f..82989ed636 100644 --- a/sdk/contracts-provider-common/package.json +++ b/sdk/contracts-provider-common/package.json @@ -18,7 +18,6 @@ }, "dependencies": { "@summerfi/sdk-common": "workspace:*", - "@summerfi/armada-protocol-common": "workspace:*", "@summerfi/blockchain-client-common": "workspace:*", "@summerfi/abi-provider-common": "workspace:*" }, diff --git a/sdk/contracts-provider-common/src/interfaces/contracts/IFleetCommanderContract.ts b/sdk/contracts-provider-common/src/interfaces/contracts/IFleetCommanderContract.ts index faa2dd4a5e..35e3a0f838 100644 --- a/sdk/contracts-provider-common/src/interfaces/contracts/IFleetCommanderContract.ts +++ b/sdk/contracts-provider-common/src/interfaces/contracts/IFleetCommanderContract.ts @@ -1,8 +1,8 @@ -import { IRebalanceData } from '@summerfi/armada-protocol-common' import { IAddress, IPercentage, ITokenAmount, TransactionInfo } from '@summerfi/sdk-common' import { IContractWrapper } from './IContractWrapper' import { IErc20Contract } from './IErc20Contract' import { IErc4626Contract } from './IErc4626Contract' +import type { IFleetConfig, IRebalanceData } from '../types' /** * @name IFleetCommanderContract @@ -21,12 +21,7 @@ export interface IFleetCommanderContract extends IContractWrapper { * @name config * @description Returns the configuration of the fleet */ - config(): Promise<{ - bufferArk: IAddress - minimumBufferBalance: ITokenAmount - depositCap: ITokenAmount - maxRebalanceOperations: string - }> + config(): Promise /** * @name maxDeposit diff --git a/sdk/contracts-provider-common/src/interfaces/types/FleetCommander/index.ts b/sdk/contracts-provider-common/src/interfaces/types/FleetCommander/index.ts deleted file mode 100644 index 60d462dfae..0000000000 --- a/sdk/contracts-provider-common/src/interfaces/types/FleetCommander/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { type RebalanceDataSolidity } from './RebalanceDataSolidity' diff --git a/sdk/contracts-provider-common/src/interfaces/types/FleetCommander/RebalanceDataSolidity.ts b/sdk/contracts-provider-common/src/interfaces/types/FleetCommanderTypes.ts similarity index 100% rename from sdk/contracts-provider-common/src/interfaces/types/FleetCommander/RebalanceDataSolidity.ts rename to sdk/contracts-provider-common/src/interfaces/types/FleetCommanderTypes.ts diff --git a/sdk/contracts-provider-common/src/interfaces/types/IFleetConfig.ts b/sdk/contracts-provider-common/src/interfaces/types/IFleetConfig.ts new file mode 100644 index 0000000000..abd34164ea --- /dev/null +++ b/sdk/contracts-provider-common/src/interfaces/types/IFleetConfig.ts @@ -0,0 +1,18 @@ +import { IAddress, ITokenAmount } from '@summerfi/sdk-common/common' + +/** + * @name IFleetConfig + * @description Data structure for rebalancing assets, used by Keepers of a fleet + */ +export interface IFleetConfig { + /** The address of the buffer Ark associated with this Fleet */ + readonly bufferArk: IAddress + /** The minimum balance that should be maintained in the buffer Ark */ + readonly minimumBufferBalance: ITokenAmount + /** The maximum total value of assets that can be deposited into the fleet */ + readonly depositCap: ITokenAmount + /** The maximum number of rebalance operations that can be performed in a single rebalance transaction */ + readonly maxRebalanceOperations: string + /** The address of the staking rewards manager contract */ + readonly stakingRewardsManager: IAddress +} diff --git a/sdk/armada-protocol-common/src/common/interfaces/IRebalanceData.ts b/sdk/contracts-provider-common/src/interfaces/types/IRebalanceData.ts similarity index 88% rename from sdk/armada-protocol-common/src/common/interfaces/IRebalanceData.ts rename to sdk/contracts-provider-common/src/interfaces/types/IRebalanceData.ts index 7cc9be5a58..d7595f1629 100644 --- a/sdk/armada-protocol-common/src/common/interfaces/IRebalanceData.ts +++ b/sdk/contracts-provider-common/src/interfaces/types/IRebalanceData.ts @@ -6,18 +6,12 @@ import { } from '@summerfi/sdk-common/common' import { z } from 'zod' -/** - * Unique signature to provide branded types to the interface - */ -export const __signature__: unique symbol = Symbol() - /** * @name IRebalanceData * @description Data structure for rebalancing assets, used by Keepers of a fleet */ export interface IRebalanceData { /** Signature to differentiate from similar interfaces */ - readonly [__signature__]: symbol /** Ark where the tokens are taken from */ readonly fromArk: IAddress /** Ark where the tokens are moved to */ diff --git a/sdk/contracts-provider-common/src/interfaces/types/index.ts b/sdk/contracts-provider-common/src/interfaces/types/index.ts index bb853cce22..2b2b14b349 100644 --- a/sdk/contracts-provider-common/src/interfaces/types/index.ts +++ b/sdk/contracts-provider-common/src/interfaces/types/index.ts @@ -1 +1,3 @@ -export * as FleetCommander from './FleetCommander' +export * as FleetCommanderTypes from './FleetCommanderTypes' +export * from './IRebalanceData' +export * from './IFleetConfig' diff --git a/sdk/contracts-provider-service/src/implementation/contracts/FleetCommanderContract/FleetCommanderContract.ts b/sdk/contracts-provider-service/src/implementation/contracts/FleetCommanderContract/FleetCommanderContract.ts index f5ab3bc67c..1ad3618dfc 100644 --- a/sdk/contracts-provider-service/src/implementation/contracts/FleetCommanderContract/FleetCommanderContract.ts +++ b/sdk/contracts-provider-service/src/implementation/contracts/FleetCommanderContract/FleetCommanderContract.ts @@ -1,9 +1,11 @@ import { IBlockchainClient } from '@summerfi/blockchain-client-common' import { - FleetCommander, + FleetCommanderTypes, IErc20Contract, IErc4626Contract, IFleetCommanderContract, + type IFleetConfig, + type IRebalanceData, } from '@summerfi/contracts-provider-common' import { Address, @@ -19,7 +21,6 @@ import { import { ContractWrapper } from '../ContractWrapper' import { FleetCommanderAbi } from '@summerfi/armada-protocol-abis' -import { IRebalanceData } from '@summerfi/armada-protocol-common' import { Erc4626Contract } from '../Erc4626Contract/Erc4626Contract' /** @@ -82,14 +83,14 @@ export class FleetCommanderContract< } /** @see IFleetCommanderContract.config */ - async config(): Promise<{ - bufferArk: IAddress - minimumBufferBalance: ITokenAmount - depositCap: ITokenAmount - maxRebalanceOperations: string - }> { - const [bufferArkAddress, minimumBufferBalance, depositCap, maxRebalanceOperations] = - await this.contract.read.config() + async config(): Promise { + const [ + bufferArkAddress, + minimumBufferBalance, + depositCap, + maxRebalanceOperations, + stakingRewardsManagerAddress, + ] = await this.contract.read.config() const token = await this._erc4626Contract.asset() return { bufferArk: Address.createFromEthereum({ value: bufferArkAddress }), @@ -99,6 +100,9 @@ export class FleetCommanderContract< }), depositCap: TokenAmount.createFromBaseUnit({ token, amount: String(depositCap) }), maxRebalanceOperations: String(maxRebalanceOperations), + stakingRewardsManager: Address.createFromEthereum({ + value: stakingRewardsManagerAddress, + }), } } @@ -360,7 +364,7 @@ export class FleetCommanderContract< /** PRIVATE */ private _convertRebalanceDataToSolidity(params: { rebalanceData: IRebalanceData[] - }): FleetCommander.RebalanceDataSolidity[] { + }): FleetCommanderTypes.RebalanceDataSolidity[] { return params.rebalanceData.map((data) => ({ fromArk: data.fromArk.toSolidityValue(), toArk: data.toArk.toSolidityValue(), diff --git a/sdk/sdk-server/src/armada-protocol-handlers/governance/forceRebalance.ts b/sdk/sdk-server/src/armada-protocol-handlers/governance/forceRebalance.ts index 05f7c85149..319f7fdc03 100644 --- a/sdk/sdk-server/src/armada-protocol-handlers/governance/forceRebalance.ts +++ b/sdk/sdk-server/src/armada-protocol-handlers/governance/forceRebalance.ts @@ -1,11 +1,7 @@ -import { - isArmadaVaultId, - isRebalanceData, - type IArmadaVaultId, - type IRebalanceData, -} from '@summerfi/armada-protocol-common' +import { isArmadaVaultId, type IArmadaVaultId } from '@summerfi/armada-protocol-common' import { z } from 'zod' import { publicProcedure } from '../../SDKTRPC' +import { isRebalanceData, type IRebalanceData } from '@summerfi/contracts-provider-common' export const forceRebalance = publicProcedure .input( diff --git a/sdk/sdk-server/src/armada-protocol-handlers/keepers/adjustBuffer.ts b/sdk/sdk-server/src/armada-protocol-handlers/keepers/adjustBuffer.ts index 6d62ba4497..b6258d35ef 100644 --- a/sdk/sdk-server/src/armada-protocol-handlers/keepers/adjustBuffer.ts +++ b/sdk/sdk-server/src/armada-protocol-handlers/keepers/adjustBuffer.ts @@ -1,12 +1,8 @@ -import { - isArmadaVaultId, - isRebalanceData, - type IArmadaVaultId, - type IRebalanceData, -} from '@summerfi/armada-protocol-common' +import { isArmadaVaultId, type IArmadaVaultId } from '@summerfi/armada-protocol-common' import { z } from 'zod' import { publicProcedure } from '../../SDKTRPC' +import { isRebalanceData, type IRebalanceData } from '@summerfi/contracts-provider-common' export const adjustBuffer = publicProcedure .input( diff --git a/sdk/sdk-server/src/armada-protocol-handlers/keepers/rebalance.ts b/sdk/sdk-server/src/armada-protocol-handlers/keepers/rebalance.ts index 1dc40a8897..5c9b211a9f 100644 --- a/sdk/sdk-server/src/armada-protocol-handlers/keepers/rebalance.ts +++ b/sdk/sdk-server/src/armada-protocol-handlers/keepers/rebalance.ts @@ -1,11 +1,7 @@ -import { - isArmadaVaultId, - isRebalanceData, - type IArmadaVaultId, - type IRebalanceData, -} from '@summerfi/armada-protocol-common' +import { isArmadaVaultId, type IArmadaVaultId } from '@summerfi/armada-protocol-common' import { z } from 'zod' import { publicProcedure } from '../../SDKTRPC' +import { isRebalanceData, type IRebalanceData } from '@summerfi/contracts-provider-common' export const rebalance = publicProcedure .input( diff --git a/sdk/subgraph-manager-common/src/generated/client.ts b/sdk/subgraph-manager-common/src/generated/client.ts index f2b71b3ce4..0551b1eac5 100644 --- a/sdk/subgraph-manager-common/src/generated/client.ts +++ b/sdk/subgraph-manager-common/src/generated/client.ts @@ -398,7 +398,8 @@ export enum ArkDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -412,6 +413,11 @@ export enum ArkDailySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -598,7 +604,8 @@ export enum ArkHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -612,6 +619,11 @@ export enum ArkHourlySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -880,6 +892,11 @@ export enum Ark_OrderBy { RewardTokens = 'rewardTokens', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1174,7 +1191,8 @@ export enum Board_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1188,6 +1206,11 @@ export enum Board_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1434,7 +1457,8 @@ export enum Deposit_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1448,6 +1472,11 @@ export enum Deposit_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1732,7 +1761,8 @@ export enum Disembark_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -1746,6 +1776,11 @@ export enum Disembark_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -1925,7 +1960,8 @@ export enum Event_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2100,7 +2136,8 @@ export enum FinancialsDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2284,6 +2321,11 @@ export enum Position_OrderBy { OutputTokenBalanceNormalized = 'outputTokenBalanceNormalized', OutputTokenBalanceNormalizedInUsd = 'outputTokenBalanceNormalizedInUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -2311,6 +2353,8 @@ export type PostActionArkSnapshot = { ark: Ark; /** Block number of this snapshot */ blockNumber: Scalars['BigInt']['output']; + /** Deposit limit of the ark */ + depositLimit: Scalars['BigInt']['output']; /** { Smart contract address of the vault }-{ # of hours since Unix epoch time } */ id: Scalars['ID']['output']; /** Amount of input token in the pool */ @@ -2366,6 +2410,14 @@ export type PostActionArkSnapshot_Filter = { blockNumber_lte?: InputMaybe; blockNumber_not?: InputMaybe; blockNumber_not_in?: InputMaybe>; + depositLimit?: InputMaybe; + depositLimit_gt?: InputMaybe; + depositLimit_gte?: InputMaybe; + depositLimit_in?: InputMaybe>; + depositLimit_lt?: InputMaybe; + depositLimit_lte?: InputMaybe; + depositLimit_not?: InputMaybe; + depositLimit_not_in?: InputMaybe>; id?: InputMaybe; id_gt?: InputMaybe; id_gte?: InputMaybe; @@ -2462,6 +2514,7 @@ export enum PostActionArkSnapshot_OrderBy { ArkName = 'ark__name', ArkTotalValueLockedUsd = 'ark__totalValueLockedUSD', BlockNumber = 'blockNumber', + DepositLimit = 'depositLimit', Id = 'id', InputTokenBalance = 'inputTokenBalance', Protocol = 'protocol', @@ -2470,7 +2523,8 @@ export enum PostActionArkSnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2484,6 +2538,11 @@ export enum PostActionArkSnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -2664,7 +2723,8 @@ export enum PostActionVaultSnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -2678,6 +2738,11 @@ export enum PostActionVaultSnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -3517,6 +3582,8 @@ export type Rebalance = { blockNumber: Scalars['BigInt']['output']; /** Ark that we reblance from */ from: Ark; + /** Post action snapshot of the from ark */ + fromPostAction: PostActionArkSnapshot; /** Transaction hash of the transaction that emitted this event */ hash: Scalars['String']['output']; /** { Transaction hash }-{ Log index } */ @@ -3529,6 +3596,8 @@ export type Rebalance = { timestamp: Scalars['BigInt']['output']; /** Ark that we reblance to */ to: Ark; + /** Post action snapshot of the to ark */ + toPostAction: PostActionArkSnapshot; /** The vault involving this transaction */ vault: Vault; }; @@ -3583,6 +3652,27 @@ export type Rebalance_Filter = { blockNumber_not?: InputMaybe; blockNumber_not_in?: InputMaybe>; from?: InputMaybe; + fromPostAction?: InputMaybe; + fromPostAction_?: InputMaybe; + fromPostAction_contains?: InputMaybe; + fromPostAction_contains_nocase?: InputMaybe; + fromPostAction_ends_with?: InputMaybe; + fromPostAction_ends_with_nocase?: InputMaybe; + fromPostAction_gt?: InputMaybe; + fromPostAction_gte?: InputMaybe; + fromPostAction_in?: InputMaybe>; + fromPostAction_lt?: InputMaybe; + fromPostAction_lte?: InputMaybe; + fromPostAction_not?: InputMaybe; + fromPostAction_not_contains?: InputMaybe; + fromPostAction_not_contains_nocase?: InputMaybe; + fromPostAction_not_ends_with?: InputMaybe; + fromPostAction_not_ends_with_nocase?: InputMaybe; + fromPostAction_not_in?: InputMaybe>; + fromPostAction_not_starts_with?: InputMaybe; + fromPostAction_not_starts_with_nocase?: InputMaybe; + fromPostAction_starts_with?: InputMaybe; + fromPostAction_starts_with_nocase?: InputMaybe; from_?: InputMaybe; from_contains?: InputMaybe; from_contains_nocase?: InputMaybe; @@ -3670,6 +3760,27 @@ export type Rebalance_Filter = { timestamp_not?: InputMaybe; timestamp_not_in?: InputMaybe>; to?: InputMaybe; + toPostAction?: InputMaybe; + toPostAction_?: InputMaybe; + toPostAction_contains?: InputMaybe; + toPostAction_contains_nocase?: InputMaybe; + toPostAction_ends_with?: InputMaybe; + toPostAction_ends_with_nocase?: InputMaybe; + toPostAction_gt?: InputMaybe; + toPostAction_gte?: InputMaybe; + toPostAction_in?: InputMaybe>; + toPostAction_lt?: InputMaybe; + toPostAction_lte?: InputMaybe; + toPostAction_not?: InputMaybe; + toPostAction_not_contains?: InputMaybe; + toPostAction_not_contains_nocase?: InputMaybe; + toPostAction_not_ends_with?: InputMaybe; + toPostAction_not_ends_with_nocase?: InputMaybe; + toPostAction_not_in?: InputMaybe>; + toPostAction_not_starts_with?: InputMaybe; + toPostAction_not_starts_with_nocase?: InputMaybe; + toPostAction_starts_with?: InputMaybe; + toPostAction_starts_with_nocase?: InputMaybe; to_?: InputMaybe; to_contains?: InputMaybe; to_contains_nocase?: InputMaybe; @@ -3725,6 +3836,14 @@ export enum Rebalance_OrderBy { AssetSymbol = 'asset__symbol', BlockNumber = 'blockNumber', From = 'from', + FromPostAction = 'fromPostAction', + FromPostActionApr = 'fromPostAction__apr', + FromPostActionBlockNumber = 'fromPostAction__blockNumber', + FromPostActionDepositLimit = 'fromPostAction__depositLimit', + FromPostActionId = 'fromPostAction__id', + FromPostActionInputTokenBalance = 'fromPostAction__inputTokenBalance', + FromPostActionTimestamp = 'fromPostAction__timestamp', + FromPostActionTotalValueLockedUsd = 'fromPostAction__totalValueLockedUSD', FromCalculatedApr = 'from__calculatedApr', FromCreatedBlockNumber = 'from__createdBlockNumber', FromCreatedTimestamp = 'from__createdTimestamp', @@ -3749,7 +3868,8 @@ export enum Rebalance_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -3762,6 +3882,14 @@ export enum Rebalance_OrderBy { ProtocolType = 'protocol__type', Timestamp = 'timestamp', To = 'to', + ToPostAction = 'toPostAction', + ToPostActionApr = 'toPostAction__apr', + ToPostActionBlockNumber = 'toPostAction__blockNumber', + ToPostActionDepositLimit = 'toPostAction__depositLimit', + ToPostActionId = 'toPostAction__id', + ToPostActionInputTokenBalance = 'toPostAction__inputTokenBalance', + ToPostActionTimestamp = 'toPostAction__timestamp', + ToPostActionTotalValueLockedUsd = 'toPostAction__totalValueLockedUSD', ToCalculatedApr = 'to__calculatedApr', ToCreatedBlockNumber = 'to__createdBlockNumber', ToCreatedTimestamp = 'to__createdTimestamp', @@ -3778,6 +3906,11 @@ export enum Rebalance_OrderBy { ToName = 'to__name', ToTotalValueLockedUsd = 'to__totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -4736,7 +4869,8 @@ export enum UsageMetricsDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -4879,7 +5013,8 @@ export enum UsageMetricsHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -4896,6 +5031,12 @@ export enum UsageMetricsHourlySnapshot_OrderBy { export type Vault = { __typename?: 'Vault'; actionSnapshots: Array; + apr7d: Scalars['BigDecimal']['output']; + apr30d: Scalars['BigDecimal']['output']; + apr90d: Scalars['BigDecimal']['output']; + apr180d: Scalars['BigDecimal']['output']; + apr365d: Scalars['BigDecimal']['output']; + aprValues: Array; arks: Array; arksArray: Array; /** APR based on revenue between last two snapshots */ @@ -5299,7 +5440,8 @@ export enum VaultDailySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -5316,6 +5458,11 @@ export enum VaultDailySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -5642,7 +5789,8 @@ export enum VaultHourlySnapshot_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -5659,6 +5807,11 @@ export enum VaultHourlySnapshot_OrderBy { Timestamp = 'timestamp', TotalValueLockedUsd = 'totalValueLockedUSD', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -5683,6 +5836,52 @@ export type Vault_Filter = { _change_block?: InputMaybe; actionSnapshots_?: InputMaybe; and?: InputMaybe>>; + apr7d?: InputMaybe; + apr7d_gt?: InputMaybe; + apr7d_gte?: InputMaybe; + apr7d_in?: InputMaybe>; + apr7d_lt?: InputMaybe; + apr7d_lte?: InputMaybe; + apr7d_not?: InputMaybe; + apr7d_not_in?: InputMaybe>; + apr30d?: InputMaybe; + apr30d_gt?: InputMaybe; + apr30d_gte?: InputMaybe; + apr30d_in?: InputMaybe>; + apr30d_lt?: InputMaybe; + apr30d_lte?: InputMaybe; + apr30d_not?: InputMaybe; + apr30d_not_in?: InputMaybe>; + apr90d?: InputMaybe; + apr90d_gt?: InputMaybe; + apr90d_gte?: InputMaybe; + apr90d_in?: InputMaybe>; + apr90d_lt?: InputMaybe; + apr90d_lte?: InputMaybe; + apr90d_not?: InputMaybe; + apr90d_not_in?: InputMaybe>; + apr180d?: InputMaybe; + apr180d_gt?: InputMaybe; + apr180d_gte?: InputMaybe; + apr180d_in?: InputMaybe>; + apr180d_lt?: InputMaybe; + apr180d_lte?: InputMaybe; + apr180d_not?: InputMaybe; + apr180d_not_in?: InputMaybe>; + apr365d?: InputMaybe; + apr365d_gt?: InputMaybe; + apr365d_gte?: InputMaybe; + apr365d_in?: InputMaybe>; + apr365d_lt?: InputMaybe; + apr365d_lte?: InputMaybe; + apr365d_not?: InputMaybe; + apr365d_not_in?: InputMaybe>; + aprValues?: InputMaybe>; + aprValues_contains?: InputMaybe>; + aprValues_contains_nocase?: InputMaybe>; + aprValues_not?: InputMaybe>; + aprValues_not_contains?: InputMaybe>; + aprValues_not_contains_nocase?: InputMaybe>; arksArray?: InputMaybe>; arksArray_?: InputMaybe; arksArray_contains?: InputMaybe>; @@ -5950,6 +6149,12 @@ export type Vault_Filter = { export enum Vault_OrderBy { ActionSnapshots = 'actionSnapshots', + Apr7d = 'apr7d', + Apr30d = 'apr30d', + Apr90d = 'apr90d', + Apr180d = 'apr180d', + Apr365d = 'apr365d', + AprValues = 'aprValues', Arks = 'arks', ArksArray = 'arksArray', CalculatedApr = 'calculatedApr', @@ -5990,7 +6195,8 @@ export enum Vault_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -6238,7 +6444,8 @@ export enum Withdraw_OrderBy { ProtocolCumulativeTotalRevenueUsd = 'protocol__cumulativeTotalRevenueUSD', ProtocolCumulativeUniqueUsers = 'protocol__cumulativeUniqueUsers', ProtocolId = 'protocol__id', - ProtocolLastUpdateTimestamp = 'protocol__lastUpdateTimestamp', + ProtocolLastDailyUpdateTimestamp = 'protocol__lastDailyUpdateTimestamp', + ProtocolLastHourlyUpdateTimestamp = 'protocol__lastHourlyUpdateTimestamp', ProtocolMethodologyVersion = 'protocol__methodologyVersion', ProtocolName = 'protocol__name', ProtocolNetwork = 'protocol__network', @@ -6252,6 +6459,11 @@ export enum Withdraw_OrderBy { Timestamp = 'timestamp', To = 'to', Vault = 'vault', + VaultApr7d = 'vault__apr7d', + VaultApr30d = 'vault__apr30d', + VaultApr90d = 'vault__apr90d', + VaultApr180d = 'vault__apr180d', + VaultApr365d = 'vault__apr365d', VaultCalculatedApr = 'vault__calculatedApr', VaultCreatedBlockNumber = 'vault__createdBlockNumber', VaultCreatedTimestamp = 'vault__createdTimestamp', @@ -6289,7 +6501,8 @@ export type YieldAggregator = Protocol & { hourlyUsageMetrics: Array; /** Smart contract address of the protocol's main contract (Factory, Registry, etc) */ id: Scalars['ID']['output']; - lastUpdateTimestamp?: Maybe; + lastDailyUpdateTimestamp?: Maybe; + lastHourlyUpdateTimestamp?: Maybe; /** Version of the methodology used to compute metrics, loosely based on SemVer format (e.g. 1.0.0) */ methodologyVersion: Scalars['String']['output']; /** Name of the protocol, including version. e.g. Yearn v3 */ @@ -6407,14 +6620,22 @@ export type YieldAggregator_Filter = { id_lte?: InputMaybe; id_not?: InputMaybe; id_not_in?: InputMaybe>; - lastUpdateTimestamp?: InputMaybe; - lastUpdateTimestamp_gt?: InputMaybe; - lastUpdateTimestamp_gte?: InputMaybe; - lastUpdateTimestamp_in?: InputMaybe>; - lastUpdateTimestamp_lt?: InputMaybe; - lastUpdateTimestamp_lte?: InputMaybe; - lastUpdateTimestamp_not?: InputMaybe; - lastUpdateTimestamp_not_in?: InputMaybe>; + lastDailyUpdateTimestamp?: InputMaybe; + lastDailyUpdateTimestamp_gt?: InputMaybe; + lastDailyUpdateTimestamp_gte?: InputMaybe; + lastDailyUpdateTimestamp_in?: InputMaybe>; + lastDailyUpdateTimestamp_lt?: InputMaybe; + lastDailyUpdateTimestamp_lte?: InputMaybe; + lastDailyUpdateTimestamp_not?: InputMaybe; + lastDailyUpdateTimestamp_not_in?: InputMaybe>; + lastHourlyUpdateTimestamp?: InputMaybe; + lastHourlyUpdateTimestamp_gt?: InputMaybe; + lastHourlyUpdateTimestamp_gte?: InputMaybe; + lastHourlyUpdateTimestamp_in?: InputMaybe>; + lastHourlyUpdateTimestamp_lt?: InputMaybe; + lastHourlyUpdateTimestamp_lte?: InputMaybe; + lastHourlyUpdateTimestamp_not?: InputMaybe; + lastHourlyUpdateTimestamp_not_in?: InputMaybe>; methodologyVersion?: InputMaybe; methodologyVersion_contains?: InputMaybe; methodologyVersion_contains_nocase?: InputMaybe; @@ -6567,7 +6788,8 @@ export enum YieldAggregator_OrderBy { FinancialMetrics = 'financialMetrics', HourlyUsageMetrics = 'hourlyUsageMetrics', Id = 'id', - LastUpdateTimestamp = 'lastUpdateTimestamp', + LastDailyUpdateTimestamp = 'lastDailyUpdateTimestamp', + LastHourlyUpdateTimestamp = 'lastHourlyUpdateTimestamp', MethodologyVersion = 'methodologyVersion', Name = 'name', Network = 'network',