diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 9390fce..63bb90a 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -1,7 +1,4 @@ -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI +name: Bun CI on: push: @@ -15,21 +12,50 @@ jobs: strategy: matrix: - node-version: [16.14.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [18.17.x] steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + + - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - cache: 'yarn' - - run: yarn workspace @tender-graph/subgraph install - - run: yarn workspace @tender-graph/subgraph prettier:check - - run: yarn workspace @tender-graph/subgraph prepare:mainnet - - run: yarn workspace @tender-graph/subgraph codegen - - run: yarn workspace @tender-graph/subgraph build - - run: yarn workspace @tender-graph/client install - - run: yarn workspace @tender-graph/client prettier:check - - run: yarn workspace @tender-graph/cient codegen + # Removed yarn cache since we are using bun + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + + # --- Subgraph Workspace --- + - name: Install dependencies in subgraph workspace + run: bun install + working-directory: packages/subgraph + + - name: Run subgraph prettier:check + run: bun run prettier:check + working-directory: packages/subgraph + + - name: Run subgraph prepare:mainnet + run: bun run prepare:mainnet + working-directory: packages/subgraph + + - name: Run subgraph codegen + run: bun run codegen + working-directory: packages/subgraph + + - name: Run subgraph build + run: bun run build + working-directory: packages/subgraph + + # --- Client Workspace --- + - name: Install dependencies in client workspace + run: bun install + working-directory: packages/graph-client + + - name: Run client prettier:check + run: bun run prettier:check + working-directory: packages/graph-client + + - name: Run client codegen + run: bun run codegen + working-directory: packages/graph-client diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..c1ec0b9 Binary files /dev/null and b/bun.lockb differ diff --git a/packages/graph-client/.graphclient/index.ts b/packages/graph-client/.graphclient/index.ts index 36ef91c..b1c735c 100644 --- a/packages/graph-client/.graphclient/index.ts +++ b/packages/graph-client/.graphclient/index.ts @@ -482,6 +482,8 @@ export type Query = { swapDepositEvents: Array; swapWithdrawEvent?: Maybe; swapWithdrawEvents: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; swapUnlockBuyEvent?: Maybe; swapUnlockBuyEvents: Array; swapUnlockRedeemedEvent?: Maybe; @@ -815,6 +817,24 @@ export type QueryswapWithdrawEventsArgs = { }; +export type QueryswapLPTokenTransferEventArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryswapLPTokenTransferEventsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type QueryswapUnlockBuyEventArgs = { id: Scalars['ID']; block?: InputMaybe; @@ -1128,6 +1148,8 @@ export type Subscription = { swapDepositEvents: Array; swapWithdrawEvent?: Maybe; swapWithdrawEvents: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; swapUnlockBuyEvent?: Maybe; swapUnlockBuyEvents: Array; swapUnlockRedeemedEvent?: Maybe; @@ -1461,6 +1483,24 @@ export type SubscriptionswapWithdrawEventsArgs = { }; +export type SubscriptionswapLPTokenTransferEventArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionswapLPTokenTransferEventsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type SubscriptionswapUnlockBuyEventArgs = { id: Scalars['ID']; block?: InputMaybe; @@ -1504,7 +1544,7 @@ export type Subscription_metaArgs = { export type SwapDepositEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; sharesMinted: Scalars['BigInt']; @@ -1528,14 +1568,14 @@ export type SwapDepositEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -1626,7 +1666,7 @@ export type SwapDepositEvent_orderBy = export type SwapEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; fee: Scalars['BigInt']; @@ -1650,14 +1690,14 @@ export type SwapEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -1745,6 +1785,140 @@ export type SwapEvent_orderBy = | 'SwapPool__treasuryCut' | 'SwapPool__treasuryCutUSD'; +export type SwapLPTokenTransferEvent = { + id: Scalars['ID']; + timestamp: Scalars['Int']; + blockNumber: Scalars['BigInt']; + from: Scalars['String']; + to: Scalars['String']; + amount: Scalars['BigInt']; + SwapPool: SwapPool; +}; + +export type SwapLPTokenTransferEvent_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_lt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; + from?: InputMaybe; + from_not?: InputMaybe; + from_gt?: InputMaybe; + from_lt?: InputMaybe; + from_gte?: InputMaybe; + from_lte?: InputMaybe; + from_in?: InputMaybe>; + from_not_in?: InputMaybe>; + from_contains?: InputMaybe; + from_contains_nocase?: InputMaybe; + from_not_contains?: InputMaybe; + from_not_contains_nocase?: InputMaybe; + from_starts_with?: InputMaybe; + from_starts_with_nocase?: InputMaybe; + from_not_starts_with?: InputMaybe; + from_not_starts_with_nocase?: InputMaybe; + from_ends_with?: InputMaybe; + from_ends_with_nocase?: InputMaybe; + from_not_ends_with?: InputMaybe; + from_not_ends_with_nocase?: InputMaybe; + to?: InputMaybe; + to_not?: InputMaybe; + to_gt?: InputMaybe; + to_lt?: InputMaybe; + to_gte?: InputMaybe; + to_lte?: InputMaybe; + to_in?: InputMaybe>; + to_not_in?: InputMaybe>; + to_contains?: InputMaybe; + to_contains_nocase?: InputMaybe; + to_not_contains?: InputMaybe; + to_not_contains_nocase?: InputMaybe; + to_starts_with?: InputMaybe; + to_starts_with_nocase?: InputMaybe; + to_not_starts_with?: InputMaybe; + to_not_starts_with_nocase?: InputMaybe; + to_ends_with?: InputMaybe; + to_ends_with_nocase?: InputMaybe; + to_not_ends_with?: InputMaybe; + to_not_ends_with_nocase?: InputMaybe; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + SwapPool?: InputMaybe; + SwapPool_not?: InputMaybe; + SwapPool_gt?: InputMaybe; + SwapPool_lt?: InputMaybe; + SwapPool_gte?: InputMaybe; + SwapPool_lte?: InputMaybe; + SwapPool_in?: InputMaybe>; + SwapPool_not_in?: InputMaybe>; + SwapPool_contains?: InputMaybe; + SwapPool_contains_nocase?: InputMaybe; + SwapPool_not_contains?: InputMaybe; + SwapPool_not_contains_nocase?: InputMaybe; + SwapPool_starts_with?: InputMaybe; + SwapPool_starts_with_nocase?: InputMaybe; + SwapPool_not_starts_with?: InputMaybe; + SwapPool_not_starts_with_nocase?: InputMaybe; + SwapPool_ends_with?: InputMaybe; + SwapPool_ends_with_nocase?: InputMaybe; + SwapPool_not_ends_with?: InputMaybe; + SwapPool_not_ends_with_nocase?: InputMaybe; + SwapPool_?: InputMaybe; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type SwapLPTokenTransferEvent_orderBy = + | 'id' + | 'timestamp' + | 'blockNumber' + | 'from' + | 'to' + | 'amount' + | 'SwapPool' + | 'SwapPool__id' + | 'SwapPool__createdAtTimestamp' + | 'SwapPool__asset' + | 'SwapPool__lpToken' + | 'SwapPool__totalSupply' + | 'SwapPool__liabilities' + | 'SwapPool__unlocking' + | 'SwapPool__volume' + | 'SwapPool__volumeUSD' + | 'SwapPool__fees' + | 'SwapPool__feesUSD' + | 'SwapPool__lpRewards' + | 'SwapPool__lpRewardsUSD' + | 'SwapPool__treasuryCut' + | 'SwapPool__treasuryCutUSD'; + export type SwapPool = { id: Scalars['ID']; createdAtTimestamp: Scalars['Int']; @@ -2126,7 +2300,7 @@ export type SwapPool_orderBy = export type SwapUnlockBuyEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; unlock: Unlock; asset: Scalars['String']; @@ -2153,14 +2327,14 @@ export type SwapUnlockBuyEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2308,7 +2482,7 @@ export type SwapUnlockBuyEvent_orderBy = export type SwapUnlockRedeemedEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; unlock: Unlock; asset: Scalars['String']; @@ -2335,14 +2509,14 @@ export type SwapUnlockRedeemedEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2490,10 +2664,10 @@ export type SwapUnlockRedeemedEvent_orderBy = export type SwapWithdrawEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; - sharesBurned: Scalars['BigInt']; + sharesBurnt: Scalars['BigInt']; SwapPool: SwapPool; }; @@ -2514,14 +2688,14 @@ export type SwapWithdrawEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2550,14 +2724,14 @@ export type SwapWithdrawEvent_filter = { amount_lte?: InputMaybe; amount_in?: InputMaybe>; amount_not_in?: InputMaybe>; - sharesBurned?: InputMaybe; - sharesBurned_not?: InputMaybe; - sharesBurned_gt?: InputMaybe; - sharesBurned_lt?: InputMaybe; - sharesBurned_gte?: InputMaybe; - sharesBurned_lte?: InputMaybe; - sharesBurned_in?: InputMaybe>; - sharesBurned_not_in?: InputMaybe>; + sharesBurnt?: InputMaybe; + sharesBurnt_not?: InputMaybe; + sharesBurnt_gt?: InputMaybe; + sharesBurnt_lt?: InputMaybe; + sharesBurnt_gte?: InputMaybe; + sharesBurnt_lte?: InputMaybe; + sharesBurnt_in?: InputMaybe>; + sharesBurnt_not_in?: InputMaybe>; SwapPool?: InputMaybe; SwapPool_not?: InputMaybe; SwapPool_gt?: InputMaybe; @@ -2591,7 +2765,7 @@ export type SwapWithdrawEvent_orderBy = | 'blockNumber' | 'account' | 'amount' - | 'sharesBurned' + | 'sharesBurnt' | 'SwapPool' | 'SwapPool__id' | 'SwapPool__createdAtTimestamp' @@ -3824,6 +3998,9 @@ export type ResolversTypes = ResolversObject<{ SwapEvent: ResolverTypeWrapper; SwapEvent_filter: SwapEvent_filter; SwapEvent_orderBy: SwapEvent_orderBy; + SwapLPTokenTransferEvent: ResolverTypeWrapper; + SwapLPTokenTransferEvent_filter: SwapLPTokenTransferEvent_filter; + SwapLPTokenTransferEvent_orderBy: SwapLPTokenTransferEvent_orderBy; SwapPool: ResolverTypeWrapper; SwapPoolDay: ResolverTypeWrapper; SwapPoolDay_filter: SwapPoolDay_filter; @@ -3897,6 +4074,8 @@ export type ResolversParentTypes = ResolversObject<{ SwapDepositEvent_filter: SwapDepositEvent_filter; SwapEvent: SwapEvent; SwapEvent_filter: SwapEvent_filter; + SwapLPTokenTransferEvent: SwapLPTokenTransferEvent; + SwapLPTokenTransferEvent_filter: SwapLPTokenTransferEvent_filter; SwapPool: SwapPool; SwapPoolDay: SwapPoolDay; SwapPoolDay_filter: SwapPoolDay_filter; @@ -4033,6 +4212,8 @@ export type QueryResolvers, ParentType, ContextType, RequireFields>; swapWithdrawEvent?: Resolver, ParentType, ContextType, RequireFields>; swapWithdrawEvents?: Resolver, ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvent?: Resolver, ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvents?: Resolver, ParentType, ContextType, RequireFields>; swapUnlockBuyEvent?: Resolver, ParentType, ContextType, RequireFields>; swapUnlockBuyEvents?: Resolver, ParentType, ContextType, RequireFields>; swapUnlockRedeemedEvent?: Resolver, ParentType, ContextType, RequireFields>; @@ -4097,6 +4278,8 @@ export type SubscriptionResolvers, "swapDepositEvents", ParentType, ContextType, RequireFields>; swapWithdrawEvent?: SubscriptionResolver, "swapWithdrawEvent", ParentType, ContextType, RequireFields>; swapWithdrawEvents?: SubscriptionResolver, "swapWithdrawEvents", ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvent?: SubscriptionResolver, "swapLPTokenTransferEvent", ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvents?: SubscriptionResolver, "swapLPTokenTransferEvents", ParentType, ContextType, RequireFields>; swapUnlockBuyEvent?: SubscriptionResolver, "swapUnlockBuyEvent", ParentType, ContextType, RequireFields>; swapUnlockBuyEvents?: SubscriptionResolver, "swapUnlockBuyEvents", ParentType, ContextType, RequireFields>; swapUnlockRedeemedEvent?: SubscriptionResolver, "swapUnlockRedeemedEvent", ParentType, ContextType, RequireFields>; @@ -4107,7 +4290,7 @@ export type SubscriptionResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; - blockNumber?: Resolver; + blockNumber?: Resolver; account?: Resolver; amount?: Resolver; sharesMinted?: Resolver; @@ -4118,7 +4301,7 @@ export type SwapDepositEventResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; - blockNumber?: Resolver; + blockNumber?: Resolver; account?: Resolver; amount?: Resolver; fee?: Resolver; @@ -4126,6 +4309,17 @@ export type SwapEventResolvers; }>; +export type SwapLPTokenTransferEventResolvers = ResolversObject<{ + id?: Resolver; + timestamp?: Resolver; + blockNumber?: Resolver; + from?: Resolver; + to?: Resolver; + amount?: Resolver; + SwapPool?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; + export type SwapPoolResolvers = ResolversObject<{ id?: Resolver; createdAtTimestamp?: Resolver; @@ -4167,7 +4361,7 @@ export type SwapPoolDayResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; - blockNumber?: Resolver; + blockNumber?: Resolver; account?: Resolver; unlock?: Resolver; asset?: Resolver; @@ -4181,7 +4375,7 @@ export type SwapUnlockBuyEventResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; - blockNumber?: Resolver; + blockNumber?: Resolver; account?: Resolver; unlock?: Resolver; asset?: Resolver; @@ -4195,10 +4389,10 @@ export type SwapUnlockRedeemedEventResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; - blockNumber?: Resolver; + blockNumber?: Resolver; account?: Resolver; amount?: Resolver; - sharesBurned?: Resolver; + sharesBurnt?: Resolver; SwapPool?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }>; @@ -4327,6 +4521,7 @@ export type Resolvers = ResolversObject<{ Subscription?: SubscriptionResolvers; SwapDepositEvent?: SwapDepositEventResolvers; SwapEvent?: SwapEventResolvers; + SwapLPTokenTransferEvent?: SwapLPTokenTransferEventResolvers; SwapPool?: SwapPoolResolvers; SwapPoolDay?: SwapPoolDayResolvers; SwapUnlockBuyEvent?: SwapUnlockBuyEventResolvers; @@ -4395,7 +4590,7 @@ const tenderizeTransforms = []; const additionalTypeDefs = [] as any[]; const tenderizeHandler = new GraphqlHandler({ name: "Tenderize", - config: {"endpoint":"https://api.studio.thegraph.com/query/45970/tenderize-v2-mainnet/version/latest"}, + config: {"endpoint":"https://api.studio.thegraph.com/query/93675/tenderize-v2-arbitrum/version/latest"}, baseDir, cache, pubsub, diff --git a/packages/graph-client/.graphclient/schema.graphql b/packages/graph-client/.graphclient/schema.graphql index a9d5613..fe2ab62 100644 --- a/packages/graph-client/.graphclient/schema.graphql +++ b/packages/graph-client/.graphclient/schema.graphql @@ -890,6 +890,32 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [SwapWithdrawEvent!]! + swapLPTokenTransferEvent( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SwapLPTokenTransferEvent_orderBy + orderDirection: OrderDirection + where: SwapLPTokenTransferEvent_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SwapLPTokenTransferEvent!]! swapUnlockBuyEvent( id: ID! """ @@ -1653,6 +1679,32 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [SwapWithdrawEvent!]! + swapLPTokenTransferEvent( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SwapLPTokenTransferEvent_orderBy + orderDirection: OrderDirection + where: SwapLPTokenTransferEvent_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SwapLPTokenTransferEvent!]! swapUnlockBuyEvent( id: ID! """ @@ -1712,7 +1764,7 @@ type Subscription { type SwapDepositEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! sharesMinted: BigInt! @@ -1736,14 +1788,14 @@ input SwapDepositEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -1835,7 +1887,7 @@ enum SwapDepositEvent_orderBy { type SwapEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! fee: BigInt! @@ -1859,14 +1911,14 @@ input SwapEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -1955,6 +2007,141 @@ enum SwapEvent_orderBy { SwapPool__treasuryCutUSD } +type SwapLPTokenTransferEvent { + id: ID! + timestamp: Int! + blockNumber: BigInt! + from: String! + to: String! + amount: BigInt! + SwapPool: SwapPool! +} + +input SwapLPTokenTransferEvent_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + timestamp: Int + timestamp_not: Int + timestamp_gt: Int + timestamp_lt: Int + timestamp_gte: Int + timestamp_lte: Int + timestamp_in: [Int!] + timestamp_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] + from: String + from_not: String + from_gt: String + from_lt: String + from_gte: String + from_lte: String + from_in: [String!] + from_not_in: [String!] + from_contains: String + from_contains_nocase: String + from_not_contains: String + from_not_contains_nocase: String + from_starts_with: String + from_starts_with_nocase: String + from_not_starts_with: String + from_not_starts_with_nocase: String + from_ends_with: String + from_ends_with_nocase: String + from_not_ends_with: String + from_not_ends_with_nocase: String + to: String + to_not: String + to_gt: String + to_lt: String + to_gte: String + to_lte: String + to_in: [String!] + to_not_in: [String!] + to_contains: String + to_contains_nocase: String + to_not_contains: String + to_not_contains_nocase: String + to_starts_with: String + to_starts_with_nocase: String + to_not_starts_with: String + to_not_starts_with_nocase: String + to_ends_with: String + to_ends_with_nocase: String + to_not_ends_with: String + to_not_ends_with_nocase: String + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + SwapPool: String + SwapPool_not: String + SwapPool_gt: String + SwapPool_lt: String + SwapPool_gte: String + SwapPool_lte: String + SwapPool_in: [String!] + SwapPool_not_in: [String!] + SwapPool_contains: String + SwapPool_contains_nocase: String + SwapPool_not_contains: String + SwapPool_not_contains_nocase: String + SwapPool_starts_with: String + SwapPool_starts_with_nocase: String + SwapPool_not_starts_with: String + SwapPool_not_starts_with_nocase: String + SwapPool_ends_with: String + SwapPool_ends_with_nocase: String + SwapPool_not_ends_with: String + SwapPool_not_ends_with_nocase: String + SwapPool_: SwapPool_filter + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [SwapLPTokenTransferEvent_filter] + or: [SwapLPTokenTransferEvent_filter] +} + +enum SwapLPTokenTransferEvent_orderBy { + id + timestamp + blockNumber + from + to + amount + SwapPool + SwapPool__id + SwapPool__createdAtTimestamp + SwapPool__asset + SwapPool__lpToken + SwapPool__totalSupply + SwapPool__liabilities + SwapPool__unlocking + SwapPool__volume + SwapPool__volumeUSD + SwapPool__fees + SwapPool__feesUSD + SwapPool__lpRewards + SwapPool__lpRewardsUSD + SwapPool__treasuryCut + SwapPool__treasuryCutUSD +} + type SwapPool { id: ID! createdAtTimestamp: Int! @@ -2329,7 +2516,7 @@ enum SwapPool_orderBy { type SwapUnlockBuyEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! unlock: Unlock! asset: String! @@ -2356,14 +2543,14 @@ input SwapUnlockBuyEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2512,7 +2699,7 @@ enum SwapUnlockBuyEvent_orderBy { type SwapUnlockRedeemedEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! unlock: Unlock! asset: String! @@ -2539,14 +2726,14 @@ input SwapUnlockRedeemedEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2695,10 +2882,10 @@ enum SwapUnlockRedeemedEvent_orderBy { type SwapWithdrawEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! - sharesBurned: BigInt! + sharesBurnt: BigInt! SwapPool: SwapPool! } @@ -2719,14 +2906,14 @@ input SwapWithdrawEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2755,14 +2942,14 @@ input SwapWithdrawEvent_filter { amount_lte: BigInt amount_in: [BigInt!] amount_not_in: [BigInt!] - sharesBurned: BigInt - sharesBurned_not: BigInt - sharesBurned_gt: BigInt - sharesBurned_lt: BigInt - sharesBurned_gte: BigInt - sharesBurned_lte: BigInt - sharesBurned_in: [BigInt!] - sharesBurned_not_in: [BigInt!] + sharesBurnt: BigInt + sharesBurnt_not: BigInt + sharesBurnt_gt: BigInt + sharesBurnt_lt: BigInt + sharesBurnt_gte: BigInt + sharesBurnt_lte: BigInt + sharesBurnt_in: [BigInt!] + sharesBurnt_not_in: [BigInt!] SwapPool: String SwapPool_not: String SwapPool_gt: String @@ -2796,7 +2983,7 @@ enum SwapWithdrawEvent_orderBy { blockNumber account amount - sharesBurned + sharesBurnt SwapPool SwapPool__id SwapPool__createdAtTimestamp diff --git a/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts b/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts index 4f64a7c..6dd9912 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts +++ b/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts @@ -9848,6 +9848,244 @@ const schemaAST = { }, "directives": [] }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "swapLPTokenTransferEvent" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapLPTokenTransferEvent" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "swapLPTokenTransferEvents" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapLPTokenTransferEvent_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapLPTokenTransferEvent_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapLPTokenTransferEvent" + } + } + } + } + }, + "directives": [] + }, { "kind": "FieldDefinition", "name": { @@ -17933,7 +18171,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapUnlockBuyEvent" + "value": "swapLPTokenTransferEvent" }, "arguments": [ { @@ -18006,7 +18244,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockBuyEvent" + "value": "SwapLPTokenTransferEvent" } }, "directives": [] @@ -18015,7 +18253,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapUnlockBuyEvents" + "value": "swapLPTokenTransferEvents" }, "arguments": [ { @@ -18066,7 +18304,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockBuyEvent_orderBy" + "value": "SwapLPTokenTransferEvent_orderBy" } }, "directives": [] @@ -18096,7 +18334,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockBuyEvent_filter" + "value": "SwapLPTokenTransferEvent_filter" } }, "directives": [] @@ -18159,7 +18397,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockBuyEvent" + "value": "SwapLPTokenTransferEvent" } } } @@ -18171,7 +18409,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapUnlockRedeemedEvent" + "value": "swapUnlockBuyEvent" }, "arguments": [ { @@ -18244,7 +18482,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockRedeemedEvent" + "value": "SwapUnlockBuyEvent" } }, "directives": [] @@ -18253,7 +18491,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapUnlockRedeemedEvents" + "value": "swapUnlockBuyEvents" }, "arguments": [ { @@ -18304,7 +18542,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockRedeemedEvent_orderBy" + "value": "SwapUnlockBuyEvent_orderBy" } }, "directives": [] @@ -18334,7 +18572,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockRedeemedEvent_filter" + "value": "SwapUnlockBuyEvent_filter" } }, "directives": [] @@ -18397,7 +18635,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapUnlockRedeemedEvent" + "value": "SwapUnlockBuyEvent" } } } @@ -18407,14 +18645,252 @@ const schemaAST = { }, { "kind": "FieldDefinition", - "description": { - "kind": "StringValue", - "value": "Access to subgraph metadata", - "block": true - }, "name": { "kind": "Name", - "value": "_meta" + "value": "swapUnlockRedeemedEvent" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapUnlockRedeemedEvent" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "swapUnlockRedeemedEvents" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapUnlockRedeemedEvent_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapUnlockRedeemedEvent_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapUnlockRedeemedEvent" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "description": { + "kind": "StringValue", + "value": "Access to subgraph metadata", + "block": true + }, + "name": { + "kind": "Name", + "value": "_meta" }, "arguments": [ { @@ -18443,14 +18919,1709 @@ const schemaAST = { "directives": [] } ], - "interfaces": [], + "interfaces": [], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "SwapDepositEvent" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "timestamp" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "blockNumber" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "SwapPool" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapPool" + } + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "SwapDepositEvent_filter" + }, + "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_starts_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_starts_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_ends_with" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_not_ends_with_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool_" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapPool_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapDepositEvent_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "SwapDepositEvent_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "SwapDepositEvent_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "timestamp" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "sharesMinted" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__createdAtTimestamp" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__asset" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__lpToken" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__totalSupply" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__liabilities" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__unlocking" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__volume" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__volumeUSD" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__fees" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__feesUSD" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__lpRewards" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__lpRewardsUSD" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__treasuryCut" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "SwapPool__treasuryCutUSD" + }, + "directives": [] + } + ], "directives": [] }, { "kind": "ObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapDepositEvent" + "value": "SwapEvent" }, "fields": [ { @@ -18504,7 +20675,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } }, @@ -18552,7 +20723,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "sharesMinted" + "value": "fee" }, "arguments": [], "type": { @@ -18594,7 +20765,7 @@ const schemaAST = { "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapDepositEvent_filter" + "value": "SwapEvent_filter" }, "fields": [ { @@ -18871,7 +21042,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18886,7 +21057,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18901,7 +21072,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18916,7 +21087,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18931,7 +21102,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18946,7 +21117,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -18965,7 +21136,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -18986,7 +21157,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -19441,7 +21612,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted" + "value": "fee" }, "type": { "kind": "NamedType", @@ -19456,7 +21627,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_not" + "value": "fee_not" }, "type": { "kind": "NamedType", @@ -19471,7 +21642,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_gt" + "value": "fee_gt" }, "type": { "kind": "NamedType", @@ -19486,7 +21657,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_lt" + "value": "fee_lt" }, "type": { "kind": "NamedType", @@ -19501,7 +21672,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_gte" + "value": "fee_gte" }, "type": { "kind": "NamedType", @@ -19516,7 +21687,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_lte" + "value": "fee_lte" }, "type": { "kind": "NamedType", @@ -19531,7 +21702,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_in" + "value": "fee_in" }, "type": { "kind": "ListType", @@ -19552,7 +21723,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted_not_in" + "value": "fee_not_in" }, "type": { "kind": "ListType", @@ -19928,7 +22099,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapDepositEvent_filter" + "value": "SwapEvent_filter" } } }, @@ -19946,7 +22117,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapDepositEvent_filter" + "value": "SwapEvent_filter" } } }, @@ -19959,7 +22130,7 @@ const schemaAST = { "kind": "EnumTypeDefinition", "name": { "kind": "Name", - "value": "SwapDepositEvent_orderBy" + "value": "SwapEvent_orderBy" }, "values": [ { @@ -20006,7 +22177,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "sharesMinted" + "value": "fee" }, "directives": [] }, @@ -20145,7 +22316,7 @@ const schemaAST = { "kind": "ObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapEvent" + "value": "SwapLPTokenTransferEvent" }, "fields": [ { @@ -20199,7 +22370,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } }, @@ -20209,7 +22380,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "account" + "value": "from" }, "arguments": [], "type": { @@ -20228,7 +22399,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "amount" + "value": "to" }, "arguments": [], "type": { @@ -20237,7 +22408,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } } }, @@ -20247,7 +22418,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "fee" + "value": "amount" }, "arguments": [], "type": { @@ -20289,7 +22460,7 @@ const schemaAST = { "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapEvent_filter" + "value": "SwapLPTokenTransferEvent_filter" }, "fields": [ { @@ -20566,7 +22737,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20581,7 +22752,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20596,7 +22767,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20611,7 +22782,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20626,7 +22797,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20641,7 +22812,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -20660,7 +22831,160 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "blockNumber_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } } } @@ -20671,19 +22995,43 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "blockNumber_not_in" + "value": "from_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_contains_nocase" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "from_not_contains" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Int" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -20692,7 +23040,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account" + "value": "from_not_contains_nocase" }, "type": { "kind": "NamedType", @@ -20707,7 +23055,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not" + "value": "from_starts_with" }, "type": { "kind": "NamedType", @@ -20722,7 +23070,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_gt" + "value": "from_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -20737,7 +23085,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_lt" + "value": "from_not_starts_with" }, "type": { "kind": "NamedType", @@ -20752,7 +23100,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_gte" + "value": "from_not_starts_with_nocase" }, "type": { "kind": "NamedType", @@ -20767,7 +23115,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_lte" + "value": "from_ends_with" }, "type": { "kind": "NamedType", @@ -20782,19 +23130,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_in" + "value": "from_ends_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -20803,19 +23145,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_in" + "value": "from_not_ends_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -20824,7 +23160,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_contains" + "value": "from_not_ends_with_nocase" }, "type": { "kind": "NamedType", @@ -20839,7 +23175,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_contains_nocase" + "value": "to" }, "type": { "kind": "NamedType", @@ -20854,7 +23190,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_contains" + "value": "to_not" }, "type": { "kind": "NamedType", @@ -20869,7 +23205,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_contains_nocase" + "value": "to_gt" }, "type": { "kind": "NamedType", @@ -20884,7 +23220,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_starts_with" + "value": "to_lt" }, "type": { "kind": "NamedType", @@ -20899,7 +23235,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_starts_with_nocase" + "value": "to_gte" }, "type": { "kind": "NamedType", @@ -20914,7 +23250,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_starts_with" + "value": "to_lte" }, "type": { "kind": "NamedType", @@ -20929,13 +23265,19 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_starts_with_nocase" + "value": "to_in" }, "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "String" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } } }, "directives": [] @@ -20944,7 +23286,28 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_ends_with" + "value": "to_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "to_contains" }, "type": { "kind": "NamedType", @@ -20959,7 +23322,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_ends_with_nocase" + "value": "to_contains_nocase" }, "type": { "kind": "NamedType", @@ -20974,7 +23337,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_ends_with" + "value": "to_not_contains" }, "type": { "kind": "NamedType", @@ -20989,7 +23352,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "account_not_ends_with_nocase" + "value": "to_not_contains_nocase" }, "type": { "kind": "NamedType", @@ -21004,13 +23367,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount" + "value": "to_starts_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21019,13 +23382,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_not" + "value": "to_starts_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21034,13 +23397,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_gt" + "value": "to_not_starts_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21049,13 +23412,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_lt" + "value": "to_not_starts_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21064,13 +23427,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_gte" + "value": "to_ends_with" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21079,13 +23442,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_lte" + "value": "to_ends_with_nocase" }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BigInt" + "value": "String" } }, "directives": [] @@ -21094,19 +23457,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_in" + "value": "to_not_ends_with" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -21115,19 +23472,13 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "amount_not_in" + "value": "to_not_ends_with_nocase" }, "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "BigInt" - } - } + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "String" } }, "directives": [] @@ -21136,7 +23487,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee" + "value": "amount" }, "type": { "kind": "NamedType", @@ -21151,7 +23502,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_not" + "value": "amount_not" }, "type": { "kind": "NamedType", @@ -21166,7 +23517,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_gt" + "value": "amount_gt" }, "type": { "kind": "NamedType", @@ -21181,7 +23532,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_lt" + "value": "amount_lt" }, "type": { "kind": "NamedType", @@ -21196,7 +23547,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_gte" + "value": "amount_gte" }, "type": { "kind": "NamedType", @@ -21211,7 +23562,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_lte" + "value": "amount_lte" }, "type": { "kind": "NamedType", @@ -21226,7 +23577,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_in" + "value": "amount_in" }, "type": { "kind": "ListType", @@ -21247,7 +23598,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "fee_not_in" + "value": "amount_not_in" }, "type": { "kind": "ListType", @@ -21623,7 +23974,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapEvent_filter" + "value": "SwapLPTokenTransferEvent_filter" } } }, @@ -21641,7 +23992,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapEvent_filter" + "value": "SwapLPTokenTransferEvent_filter" } } }, @@ -21654,7 +24005,7 @@ const schemaAST = { "kind": "EnumTypeDefinition", "name": { "kind": "Name", - "value": "SwapEvent_orderBy" + "value": "SwapLPTokenTransferEvent_orderBy" }, "values": [ { @@ -21685,7 +24036,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "account" + "value": "from" }, "directives": [] }, @@ -21693,7 +24044,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "amount" + "value": "to" }, "directives": [] }, @@ -21701,7 +24052,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "fee" + "value": "amount" }, "directives": [] }, @@ -27486,7 +29837,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } }, @@ -27910,7 +30261,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -27925,7 +30276,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -27940,7 +30291,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -27955,7 +30306,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -27970,7 +30321,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -27985,7 +30336,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -28004,7 +30355,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -28025,7 +30376,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -30073,7 +32424,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } }, @@ -30497,7 +32848,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30512,7 +32863,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30527,7 +32878,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30542,7 +32893,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30557,7 +32908,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30572,7 +32923,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -30591,7 +32942,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -30612,7 +32963,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -32660,7 +35011,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } }, @@ -32708,7 +35059,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "sharesBurned" + "value": "sharesBurnt" }, "arguments": [], "type": { @@ -33027,7 +35378,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33042,7 +35393,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33057,7 +35408,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33072,7 +35423,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33087,7 +35438,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33102,7 +35453,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } }, "directives": [] @@ -33121,7 +35472,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -33142,7 +35493,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Int" + "value": "BigInt" } } } @@ -33597,7 +35948,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned" + "value": "sharesBurnt" }, "type": { "kind": "NamedType", @@ -33612,7 +35963,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_not" + "value": "sharesBurnt_not" }, "type": { "kind": "NamedType", @@ -33627,7 +35978,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_gt" + "value": "sharesBurnt_gt" }, "type": { "kind": "NamedType", @@ -33642,7 +35993,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_lt" + "value": "sharesBurnt_lt" }, "type": { "kind": "NamedType", @@ -33657,7 +36008,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_gte" + "value": "sharesBurnt_gte" }, "type": { "kind": "NamedType", @@ -33672,7 +36023,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_lte" + "value": "sharesBurnt_lte" }, "type": { "kind": "NamedType", @@ -33687,7 +36038,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_in" + "value": "sharesBurnt_in" }, "type": { "kind": "ListType", @@ -33708,7 +36059,7 @@ const schemaAST = { "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned_not_in" + "value": "sharesBurnt_not_in" }, "type": { "kind": "ListType", @@ -34162,7 +36513,7 @@ const schemaAST = { "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "sharesBurned" + "value": "sharesBurnt" }, "directives": [] }, diff --git a/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql b/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql index a9d5613..fe2ab62 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql +++ b/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql @@ -890,6 +890,32 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [SwapWithdrawEvent!]! + swapLPTokenTransferEvent( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SwapLPTokenTransferEvent_orderBy + orderDirection: OrderDirection + where: SwapLPTokenTransferEvent_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SwapLPTokenTransferEvent!]! swapUnlockBuyEvent( id: ID! """ @@ -1653,6 +1679,32 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [SwapWithdrawEvent!]! + swapLPTokenTransferEvent( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SwapLPTokenTransferEvent_orderBy + orderDirection: OrderDirection + where: SwapLPTokenTransferEvent_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SwapLPTokenTransferEvent!]! swapUnlockBuyEvent( id: ID! """ @@ -1712,7 +1764,7 @@ type Subscription { type SwapDepositEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! sharesMinted: BigInt! @@ -1736,14 +1788,14 @@ input SwapDepositEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -1835,7 +1887,7 @@ enum SwapDepositEvent_orderBy { type SwapEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! fee: BigInt! @@ -1859,14 +1911,14 @@ input SwapEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -1955,6 +2007,141 @@ enum SwapEvent_orderBy { SwapPool__treasuryCutUSD } +type SwapLPTokenTransferEvent { + id: ID! + timestamp: Int! + blockNumber: BigInt! + from: String! + to: String! + amount: BigInt! + SwapPool: SwapPool! +} + +input SwapLPTokenTransferEvent_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + timestamp: Int + timestamp_not: Int + timestamp_gt: Int + timestamp_lt: Int + timestamp_gte: Int + timestamp_lte: Int + timestamp_in: [Int!] + timestamp_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] + from: String + from_not: String + from_gt: String + from_lt: String + from_gte: String + from_lte: String + from_in: [String!] + from_not_in: [String!] + from_contains: String + from_contains_nocase: String + from_not_contains: String + from_not_contains_nocase: String + from_starts_with: String + from_starts_with_nocase: String + from_not_starts_with: String + from_not_starts_with_nocase: String + from_ends_with: String + from_ends_with_nocase: String + from_not_ends_with: String + from_not_ends_with_nocase: String + to: String + to_not: String + to_gt: String + to_lt: String + to_gte: String + to_lte: String + to_in: [String!] + to_not_in: [String!] + to_contains: String + to_contains_nocase: String + to_not_contains: String + to_not_contains_nocase: String + to_starts_with: String + to_starts_with_nocase: String + to_not_starts_with: String + to_not_starts_with_nocase: String + to_ends_with: String + to_ends_with_nocase: String + to_not_ends_with: String + to_not_ends_with_nocase: String + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + SwapPool: String + SwapPool_not: String + SwapPool_gt: String + SwapPool_lt: String + SwapPool_gte: String + SwapPool_lte: String + SwapPool_in: [String!] + SwapPool_not_in: [String!] + SwapPool_contains: String + SwapPool_contains_nocase: String + SwapPool_not_contains: String + SwapPool_not_contains_nocase: String + SwapPool_starts_with: String + SwapPool_starts_with_nocase: String + SwapPool_not_starts_with: String + SwapPool_not_starts_with_nocase: String + SwapPool_ends_with: String + SwapPool_ends_with_nocase: String + SwapPool_not_ends_with: String + SwapPool_not_ends_with_nocase: String + SwapPool_: SwapPool_filter + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [SwapLPTokenTransferEvent_filter] + or: [SwapLPTokenTransferEvent_filter] +} + +enum SwapLPTokenTransferEvent_orderBy { + id + timestamp + blockNumber + from + to + amount + SwapPool + SwapPool__id + SwapPool__createdAtTimestamp + SwapPool__asset + SwapPool__lpToken + SwapPool__totalSupply + SwapPool__liabilities + SwapPool__unlocking + SwapPool__volume + SwapPool__volumeUSD + SwapPool__fees + SwapPool__feesUSD + SwapPool__lpRewards + SwapPool__lpRewardsUSD + SwapPool__treasuryCut + SwapPool__treasuryCutUSD +} + type SwapPool { id: ID! createdAtTimestamp: Int! @@ -2329,7 +2516,7 @@ enum SwapPool_orderBy { type SwapUnlockBuyEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! unlock: Unlock! asset: String! @@ -2356,14 +2543,14 @@ input SwapUnlockBuyEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2512,7 +2699,7 @@ enum SwapUnlockBuyEvent_orderBy { type SwapUnlockRedeemedEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! unlock: Unlock! asset: String! @@ -2539,14 +2726,14 @@ input SwapUnlockRedeemedEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2695,10 +2882,10 @@ enum SwapUnlockRedeemedEvent_orderBy { type SwapWithdrawEvent { id: ID! timestamp: Int! - blockNumber: Int! + blockNumber: BigInt! account: String! amount: BigInt! - sharesBurned: BigInt! + sharesBurnt: BigInt! SwapPool: SwapPool! } @@ -2719,14 +2906,14 @@ input SwapWithdrawEvent_filter { timestamp_lte: Int timestamp_in: [Int!] timestamp_not_in: [Int!] - blockNumber: Int - blockNumber_not: Int - blockNumber_gt: Int - blockNumber_lt: Int - blockNumber_gte: Int - blockNumber_lte: Int - blockNumber_in: [Int!] - blockNumber_not_in: [Int!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -2755,14 +2942,14 @@ input SwapWithdrawEvent_filter { amount_lte: BigInt amount_in: [BigInt!] amount_not_in: [BigInt!] - sharesBurned: BigInt - sharesBurned_not: BigInt - sharesBurned_gt: BigInt - sharesBurned_lt: BigInt - sharesBurned_gte: BigInt - sharesBurned_lte: BigInt - sharesBurned_in: [BigInt!] - sharesBurned_not_in: [BigInt!] + sharesBurnt: BigInt + sharesBurnt_not: BigInt + sharesBurnt_gt: BigInt + sharesBurnt_lt: BigInt + sharesBurnt_gte: BigInt + sharesBurnt_lte: BigInt + sharesBurnt_in: [BigInt!] + sharesBurnt_not_in: [BigInt!] SwapPool: String SwapPool_not: String SwapPool_gt: String @@ -2796,7 +2983,7 @@ enum SwapWithdrawEvent_orderBy { blockNumber account amount - sharesBurned + sharesBurnt SwapPool SwapPool__id SwapPool__createdAtTimestamp diff --git a/packages/graph-client/.graphclient/sources/Tenderize/types.ts b/packages/graph-client/.graphclient/sources/Tenderize/types.ts index b7591e3..33608f3 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/types.ts +++ b/packages/graph-client/.graphclient/sources/Tenderize/types.ts @@ -460,6 +460,8 @@ export type Query = { swapDepositEvents: Array; swapWithdrawEvent?: Maybe; swapWithdrawEvents: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; swapUnlockBuyEvent?: Maybe; swapUnlockBuyEvents: Array; swapUnlockRedeemedEvent?: Maybe; @@ -793,6 +795,24 @@ export type QueryswapWithdrawEventsArgs = { }; +export type QueryswapLPTokenTransferEventArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryswapLPTokenTransferEventsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type QueryswapUnlockBuyEventArgs = { id: Scalars['ID']; block?: InputMaybe; @@ -1106,6 +1126,8 @@ export type Subscription = { swapDepositEvents: Array; swapWithdrawEvent?: Maybe; swapWithdrawEvents: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; swapUnlockBuyEvent?: Maybe; swapUnlockBuyEvents: Array; swapUnlockRedeemedEvent?: Maybe; @@ -1439,6 +1461,24 @@ export type SubscriptionswapWithdrawEventsArgs = { }; +export type SubscriptionswapLPTokenTransferEventArgs = { + id: Scalars['ID']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionswapLPTokenTransferEventsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type SubscriptionswapUnlockBuyEventArgs = { id: Scalars['ID']; block?: InputMaybe; @@ -1482,7 +1522,7 @@ export type Subscription_metaArgs = { export type SwapDepositEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; sharesMinted: Scalars['BigInt']; @@ -1506,14 +1546,14 @@ export type SwapDepositEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -1604,7 +1644,7 @@ export type SwapDepositEvent_orderBy = export type SwapEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; fee: Scalars['BigInt']; @@ -1628,14 +1668,14 @@ export type SwapEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -1723,6 +1763,140 @@ export type SwapEvent_orderBy = | 'SwapPool__treasuryCut' | 'SwapPool__treasuryCutUSD'; +export type SwapLPTokenTransferEvent = { + id: Scalars['ID']; + timestamp: Scalars['Int']; + blockNumber: Scalars['BigInt']; + from: Scalars['String']; + to: Scalars['String']; + amount: Scalars['BigInt']; + SwapPool: SwapPool; +}; + +export type SwapLPTokenTransferEvent_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + timestamp?: InputMaybe; + timestamp_not?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_lt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; + from?: InputMaybe; + from_not?: InputMaybe; + from_gt?: InputMaybe; + from_lt?: InputMaybe; + from_gte?: InputMaybe; + from_lte?: InputMaybe; + from_in?: InputMaybe>; + from_not_in?: InputMaybe>; + from_contains?: InputMaybe; + from_contains_nocase?: InputMaybe; + from_not_contains?: InputMaybe; + from_not_contains_nocase?: InputMaybe; + from_starts_with?: InputMaybe; + from_starts_with_nocase?: InputMaybe; + from_not_starts_with?: InputMaybe; + from_not_starts_with_nocase?: InputMaybe; + from_ends_with?: InputMaybe; + from_ends_with_nocase?: InputMaybe; + from_not_ends_with?: InputMaybe; + from_not_ends_with_nocase?: InputMaybe; + to?: InputMaybe; + to_not?: InputMaybe; + to_gt?: InputMaybe; + to_lt?: InputMaybe; + to_gte?: InputMaybe; + to_lte?: InputMaybe; + to_in?: InputMaybe>; + to_not_in?: InputMaybe>; + to_contains?: InputMaybe; + to_contains_nocase?: InputMaybe; + to_not_contains?: InputMaybe; + to_not_contains_nocase?: InputMaybe; + to_starts_with?: InputMaybe; + to_starts_with_nocase?: InputMaybe; + to_not_starts_with?: InputMaybe; + to_not_starts_with_nocase?: InputMaybe; + to_ends_with?: InputMaybe; + to_ends_with_nocase?: InputMaybe; + to_not_ends_with?: InputMaybe; + to_not_ends_with_nocase?: InputMaybe; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + SwapPool?: InputMaybe; + SwapPool_not?: InputMaybe; + SwapPool_gt?: InputMaybe; + SwapPool_lt?: InputMaybe; + SwapPool_gte?: InputMaybe; + SwapPool_lte?: InputMaybe; + SwapPool_in?: InputMaybe>; + SwapPool_not_in?: InputMaybe>; + SwapPool_contains?: InputMaybe; + SwapPool_contains_nocase?: InputMaybe; + SwapPool_not_contains?: InputMaybe; + SwapPool_not_contains_nocase?: InputMaybe; + SwapPool_starts_with?: InputMaybe; + SwapPool_starts_with_nocase?: InputMaybe; + SwapPool_not_starts_with?: InputMaybe; + SwapPool_not_starts_with_nocase?: InputMaybe; + SwapPool_ends_with?: InputMaybe; + SwapPool_ends_with_nocase?: InputMaybe; + SwapPool_not_ends_with?: InputMaybe; + SwapPool_not_ends_with_nocase?: InputMaybe; + SwapPool_?: InputMaybe; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type SwapLPTokenTransferEvent_orderBy = + | 'id' + | 'timestamp' + | 'blockNumber' + | 'from' + | 'to' + | 'amount' + | 'SwapPool' + | 'SwapPool__id' + | 'SwapPool__createdAtTimestamp' + | 'SwapPool__asset' + | 'SwapPool__lpToken' + | 'SwapPool__totalSupply' + | 'SwapPool__liabilities' + | 'SwapPool__unlocking' + | 'SwapPool__volume' + | 'SwapPool__volumeUSD' + | 'SwapPool__fees' + | 'SwapPool__feesUSD' + | 'SwapPool__lpRewards' + | 'SwapPool__lpRewardsUSD' + | 'SwapPool__treasuryCut' + | 'SwapPool__treasuryCutUSD'; + export type SwapPool = { id: Scalars['ID']; createdAtTimestamp: Scalars['Int']; @@ -2104,7 +2278,7 @@ export type SwapPool_orderBy = export type SwapUnlockBuyEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; unlock: Unlock; asset: Scalars['String']; @@ -2131,14 +2305,14 @@ export type SwapUnlockBuyEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2286,7 +2460,7 @@ export type SwapUnlockBuyEvent_orderBy = export type SwapUnlockRedeemedEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; unlock: Unlock; asset: Scalars['String']; @@ -2313,14 +2487,14 @@ export type SwapUnlockRedeemedEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2468,10 +2642,10 @@ export type SwapUnlockRedeemedEvent_orderBy = export type SwapWithdrawEvent = { id: Scalars['ID']; timestamp: Scalars['Int']; - blockNumber: Scalars['Int']; + blockNumber: Scalars['BigInt']; account: Scalars['String']; amount: Scalars['BigInt']; - sharesBurned: Scalars['BigInt']; + sharesBurnt: Scalars['BigInt']; SwapPool: SwapPool; }; @@ -2492,14 +2666,14 @@ export type SwapWithdrawEvent_filter = { timestamp_lte?: InputMaybe; timestamp_in?: InputMaybe>; timestamp_not_in?: InputMaybe>; - blockNumber?: InputMaybe; - blockNumber_not?: InputMaybe; - blockNumber_gt?: InputMaybe; - blockNumber_lt?: InputMaybe; - blockNumber_gte?: InputMaybe; - blockNumber_lte?: InputMaybe; - blockNumber_in?: InputMaybe>; - blockNumber_not_in?: InputMaybe>; + blockNumber?: InputMaybe; + blockNumber_not?: InputMaybe; + blockNumber_gt?: InputMaybe; + blockNumber_lt?: InputMaybe; + blockNumber_gte?: InputMaybe; + blockNumber_lte?: InputMaybe; + blockNumber_in?: InputMaybe>; + blockNumber_not_in?: InputMaybe>; account?: InputMaybe; account_not?: InputMaybe; account_gt?: InputMaybe; @@ -2528,14 +2702,14 @@ export type SwapWithdrawEvent_filter = { amount_lte?: InputMaybe; amount_in?: InputMaybe>; amount_not_in?: InputMaybe>; - sharesBurned?: InputMaybe; - sharesBurned_not?: InputMaybe; - sharesBurned_gt?: InputMaybe; - sharesBurned_lt?: InputMaybe; - sharesBurned_gte?: InputMaybe; - sharesBurned_lte?: InputMaybe; - sharesBurned_in?: InputMaybe>; - sharesBurned_not_in?: InputMaybe>; + sharesBurnt?: InputMaybe; + sharesBurnt_not?: InputMaybe; + sharesBurnt_gt?: InputMaybe; + sharesBurnt_lt?: InputMaybe; + sharesBurnt_gte?: InputMaybe; + sharesBurnt_lte?: InputMaybe; + sharesBurnt_in?: InputMaybe>; + sharesBurnt_not_in?: InputMaybe>; SwapPool?: InputMaybe; SwapPool_not?: InputMaybe; SwapPool_gt?: InputMaybe; @@ -2569,7 +2743,7 @@ export type SwapWithdrawEvent_orderBy = | 'blockNumber' | 'account' | 'amount' - | 'sharesBurned' + | 'sharesBurnt' | 'SwapPool' | 'SwapPool__id' | 'SwapPool__createdAtTimestamp' @@ -3751,6 +3925,10 @@ export type _SubgraphErrorPolicy_ = /** null **/ swapWithdrawEvents: InContextSdkMethod, /** null **/ + swapLPTokenTransferEvent: InContextSdkMethod, + /** null **/ + swapLPTokenTransferEvents: InContextSdkMethod, + /** null **/ swapUnlockBuyEvent: InContextSdkMethod, /** null **/ swapUnlockBuyEvents: InContextSdkMethod, @@ -3840,6 +4018,10 @@ export type _SubgraphErrorPolicy_ = /** null **/ swapWithdrawEvents: InContextSdkMethod, /** null **/ + swapLPTokenTransferEvent: InContextSdkMethod, + /** null **/ + swapLPTokenTransferEvents: InContextSdkMethod, + /** null **/ swapUnlockBuyEvent: InContextSdkMethod, /** null **/ swapUnlockBuyEvents: InContextSdkMethod, diff --git a/packages/graph-client/.graphclientrc.yaml b/packages/graph-client/.graphclientrc.yaml index e09347f..6d8460d 100644 --- a/packages/graph-client/.graphclientrc.yaml +++ b/packages/graph-client/.graphclientrc.yaml @@ -2,12 +2,9 @@ sources: - name: Tenderize handler: graphql: - endpoint: "https://api.studio.thegraph.com/query/45970/tenderize-v2-mainnet/version/latest" + endpoint: "https://api.studio.thegraph.com/query/93675/tenderize-v2-arbitrum/version/latest" documents: - ./gql/**/*.gql - - - # 1bebc8cea3046e82264ffadc0e36e3f4 # mainnet https://gateway-arbitrum.network.thegraph.com/api/1bebc8cea3046e82264ffadc0e36e3f4/subgraphs/id/FNGU4YKPjuy5sayHT6c5xt3EXzZE5fnUwcjFXKLgudBi -# arbitrum https://gateway-arbitrum.network.thegraph.com/api/1bebc8cea3046e82264ffadc0e36e3f4/subgraphs/id/2ygWAHMhm9tKXm59DN8DdSJ7VNpxrKMkA39Krij4b4tu \ No newline at end of file +# arbitrum https://gateway-arbitrum.network.thegraph.com/api/1bebc8cea3046e82264ffadc0e36e3f4/subgraphs/id/2ygWAHMhm9tKXm59DN8DdSJ7VNpxrKMkA39Krij4b4tu diff --git a/packages/graph-client/gql/Swap.gql b/packages/graph-client/gql/Swap.gql index 2550e08..370ce6f 100644 --- a/packages/graph-client/gql/Swap.gql +++ b/packages/graph-client/gql/Swap.gql @@ -37,10 +37,14 @@ query getPools($dateFilter: Int = 0, $first: Int = 1000, $skip: Int = 0) { lpRewards lpRewardsUSD - poolDays(where: { date_gte: $dateFilter }, orderBy: date, orderDirection: desc) { + poolDays( + where: { date_gte: $dateFilter } + orderBy: date + orderDirection: desc + ) { date id - + liabilities totalSupply unlocking @@ -56,7 +60,7 @@ query getPools($dateFilter: Int = 0, $first: Int = 1000, $skip: Int = 0) { } query getPool($id: ID!, $dateFilter: Int = 0) { - swapPool (id: $id) { + swapPool(id: $id) { id asset lpToken @@ -72,10 +76,14 @@ query getPool($id: ID!, $dateFilter: Int = 0) { lpRewards lpRewardsUSD - poolDays(where: { date_gte: $dateFilter }, orderBy: date, orderDirection: desc) { + poolDays( + where: { date_gte: $dateFilter } + orderBy: date + orderDirection: desc + ) { date id - + liabilities totalSupply unlocking @@ -88,4 +96,4 @@ query getPool($id: ID!, $dateFilter: Int = 0) { lpRewardsUSD } } -} \ No newline at end of file +} diff --git a/packages/graph-client/gql/User.gql b/packages/graph-client/gql/User.gql index ce58eb6..ffe7fc8 100644 --- a/packages/graph-client/gql/User.gql +++ b/packages/graph-client/gql/User.gql @@ -1,6 +1,6 @@ query GetUser($user: ID!) { user(id: $user) { - stakes (where: {shares_gt: 0}) { + stakes(where: { shares_gt: 0 }) { id shares netDeposits @@ -31,7 +31,7 @@ query GetUser($user: ID!) { } } } - liquidityPositions(where: {shares_gt: 0}) { + liquidityPositions(where: { shares_gt: 0 }) { id shares netDeposits diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index 424641b..9adecda 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -17,8 +17,8 @@ "auth": "graph auth --studio $GRAPH_ACCESS_TOKEN", "build": "graph build", "codegen": "graph codegen --output-dir src/types/", - "prettier:check": "prettier --check \"**/*.{ts,md,yaml,graphql}\"", - "prettier:write": "prettier --write \"**/*.{ts,md,yaml,graphql}\"", + "prettier:check": "prettier --check \"**/*.{ts,md,graphql}\"", + "prettier:write": "prettier --write \"**/*.{ts,md,graphql}\"", "deploy": "graph deploy --studio ${SUBGRAPH_NAME}" }, "devDependencies": { diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 0883b1b..96be14c 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -258,6 +258,20 @@ type SwapWithdrawEvent @entity { SwapPool: SwapPool! } +type SwapLPTokenTransferEvent @entity { + id: ID! + timestamp: Int! + blockNumber: BigInt! + + from: String! + to: String! + shares: BigInt! + value: BigInt! + + # Relational fields + SwapPool: SwapPool! +} + type SwapUnlockBuyEvent @entity { id: ID! timestamp: Int! @@ -293,3 +307,8 @@ type SwapUnlockRedeemedEvent @entity { # Relational fields SwapPool: SwapPool! } + +type LPToken @entity { + id: ID! # LP token address + pool: SwapPool! +} diff --git a/packages/subgraph/src/mappings/helpers.ts b/packages/subgraph/src/mappings/helpers.ts index 7cdc0c1..0f8e1b6 100644 --- a/packages/subgraph/src/mappings/helpers.ts +++ b/packages/subgraph/src/mappings/helpers.ts @@ -22,7 +22,6 @@ export const WETH9_ARBITRUM = Address.fromString('0x82aF49447D8a07e3bd95BD0d56f3 export const USDC_ARBITRUM = Address.fromString('0xaf88d065e77c8cC2239327C5EDb3A432268e5831') export const USDC_MAINNET = Address.fromString('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') - export function exponentToBigDecimal(decimals: BigInt): BigDecimal { let bd = BigDecimal.fromString('1') for (let i = BI_ZERO; i.lt(decimals as BigInt); i = i.plus(BI_ONE)) { @@ -41,13 +40,7 @@ export const calculateDayID = (timestamp: BigInt): BigInt => { export const maticUsd = (): BigDecimal => { const quoter = UniswapQuoter.bind(QUOTER) - const maticUsd = quoter.try_quoteExactInputSingle( - MATIC, - USDC_MAINNET, - 3000, - TEN_18, - BI_ZERO - ) + const maticUsd = quoter.try_quoteExactInputSingle(MATIC, USDC_MAINNET, 3000, TEN_18, BI_ZERO) if (maticUsd.reverted) return BD_ZERO return maticUsd.value.toBigDecimal().div(TEN_6.toBigDecimal()) @@ -55,44 +48,20 @@ export const maticUsd = (): BigDecimal => { export const grtUsd = (): BigDecimal => { const quoter = UniswapQuoter.bind(QUOTER) - const grtEth = quoter.try_quoteExactInputSingle( - GRT, - WETH9_ARBITRUM, - 3000, - TEN_18, - BI_ZERO - ) + const grtEth = quoter.try_quoteExactInputSingle(GRT, WETH9_ARBITRUM, 3000, TEN_18, BI_ZERO) if (grtEth.reverted) return BD_ZERO - const ethUsdc = quoter.try_quoteExactInputSingle( - WETH9_ARBITRUM, - USDC_ARBITRUM, - 500, - TEN_18, - BI_ZERO - ) + const ethUsdc = quoter.try_quoteExactInputSingle(WETH9_ARBITRUM, USDC_ARBITRUM, 500, TEN_18, BI_ZERO) return grtEth.value.toBigDecimal().times(ethUsdc.value.toBigDecimal()).div(TEN_24.toBigDecimal()) } export const lptUsd = (): BigDecimal => { const quoter = UniswapQuoter.bind(QUOTER) - const lptEth = quoter.try_quoteExactInputSingle( - LPT, - WETH9_ARBITRUM, - 3000, - TEN_18, - BI_ZERO - ) + const lptEth = quoter.try_quoteExactInputSingle(LPT, WETH9_ARBITRUM, 3000, TEN_18, BI_ZERO) if (lptEth.reverted) return BD_ZERO - const ethUsdc = quoter.try_quoteExactInputSingle( - WETH9_ARBITRUM, - USDC_ARBITRUM, - 500, - TEN_18, - BI_ZERO - ) + const ethUsdc = quoter.try_quoteExactInputSingle(WETH9_ARBITRUM, USDC_ARBITRUM, 500, TEN_18, BI_ZERO) return lptEth.value.toBigDecimal().times(ethUsdc.value.toBigDecimal()).div(TEN_24.toBigDecimal()) } @@ -105,47 +74,47 @@ export const getUsdPrice = (token: Address): BigDecimal => { } // Define the return type class DecodedTokenId { - tenderizer: string; - id: BigInt; + tenderizer: string + id: BigInt constructor(tenderizer: string, id: BigInt) { - this.tenderizer = tenderizer; - this.id = id; + this.tenderizer = tenderizer + this.id = id } } export const decodeTokenId = (tokenId: BigInt): DecodedTokenId => { let hexId = tokenId.toHexString() - let address = "0x" + hexId.substring(0, 20) + let address = '0x' + hexId.substring(0, 20) let uint96 = BigInt.fromUnsignedBytes(Bytes.fromHexString(hexId.substring(20, 32))) // Return the decoded values - return new DecodedTokenId(address, uint96); + return new DecodedTokenId(address, uint96) } -const REBASE_TOPIC = "0x11c6bf55864ff83827df712625d7a80e5583eef0264921025e7cd22003a21511" +const REBASE_TOPIC = '0x11c6bf55864ff83827df712625d7a80e5583eef0264921025e7cd22003a21511' export function findClosestRebaseEvent( receipt: ethereum.TransactionReceipt | null, contractAddress: Address, logIndex: BigInt ): BigDecimal | null { - if (receipt == null) return null; - if (logIndex == BI_ZERO) return null; + if (receipt == null) return null + if (logIndex == BI_ZERO) return null for (let i = receipt.logs.length - 1; i >= 0; i--) { - let log = receipt.logs[i]; - if (log.logIndex.ge(logIndex)) continue; + let log = receipt.logs[i] + if (log.logIndex.ge(logIndex)) continue // Check if the log is from the correct contract - if (log.address != contractAddress) continue; - if (log.topics.length == 0 || log.topics[0].toHexString() != REBASE_TOPIC) continue; + if (log.address != contractAddress) continue + if (log.topics.length == 0 || log.topics[0].toHexString() != REBASE_TOPIC) continue // Check if the log is a Rebase event - let decoded = ethereum.decode('(uint256,uint256)', log.data); - if (decoded == null) return null; - const t = decoded.toTuple(); - return convertToDecimal(t[0].toBigInt()); + let decoded = ethereum.decode('(uint256,uint256)', log.data) + if (decoded == null) return null + const t = decoded.toTuple() + return convertToDecimal(t[0].toBigInt()) } - return null; -} \ No newline at end of file + return null +} diff --git a/packages/subgraph/src/mappings/swapFactory.ts b/packages/subgraph/src/mappings/swapFactory.ts index 9546258..ae4df7b 100644 --- a/packages/subgraph/src/mappings/swapFactory.ts +++ b/packages/subgraph/src/mappings/swapFactory.ts @@ -1,26 +1,33 @@ import { SwapDeployed as SwapDeployedEvent } from '../types/SwapFactory/SwapFactory' -import { SwapPool as SwapPoolSource } from '../types/templates' -import { SwapPool } from '../types/schema' +import { SwapPool as SwapPoolSource, SwapPoolToken } from '../types/templates' +import { LPToken, SwapPool } from '../types/schema' import { BD_ZERO, BI_ZERO } from './helpers' import { TenderSwap } from '../types/templates/SwapPool/TenderSwap' export function handleNewSwapPool(event: SwapDeployedEvent): void { - SwapPoolSource.create(event.params.swap) - let pool = new SwapPool(event.params.swap.toHex()) - pool.asset = event.params.underlying.toHex() - pool.createdAtTimestamp = event.block.timestamp.toI32() - pool.lpToken = TenderSwap.bind(event.params.swap).lpToken().toHex() - pool.totalSupply = BI_ZERO - pool.liabilities = BI_ZERO - pool.unlocking = BI_ZERO - pool.volume = BI_ZERO - pool.volumeUSD = BD_ZERO - pool.fees = BI_ZERO - pool.feesUSD = BD_ZERO - pool.lpRewards = BI_ZERO - pool.lpRewardsUSD = BD_ZERO - pool.treasuryCut = BI_ZERO - pool.treasuryCutUSD = BD_ZERO + SwapPoolSource.create(event.params.swap) + let lpTokenAddr = TenderSwap.bind(event.params.swap).lpToken() + let pool = new SwapPool(event.params.swap.toHex()) + pool.asset = event.params.underlying.toHex() + pool.createdAtTimestamp = event.block.timestamp.toI32() + pool.lpToken = lpTokenAddr.toHex() + pool.totalSupply = BI_ZERO + pool.liabilities = BI_ZERO + pool.unlocking = BI_ZERO + pool.volume = BI_ZERO + pool.volumeUSD = BD_ZERO + pool.fees = BI_ZERO + pool.feesUSD = BD_ZERO + pool.lpRewards = BI_ZERO + pool.lpRewardsUSD = BD_ZERO + pool.treasuryCut = BI_ZERO + pool.treasuryCutUSD = BD_ZERO - pool.save() -} \ No newline at end of file + pool.save() + + let lpToken = new LPToken(lpTokenAddr.toHex()) + lpToken.pool = pool.id + lpToken.save() + + SwapPoolToken.create(lpTokenAddr) +} diff --git a/packages/subgraph/src/mappings/tenderizer.ts b/packages/subgraph/src/mappings/tenderizer.ts index f1edee3..8d1aad0 100644 --- a/packages/subgraph/src/mappings/tenderizer.ts +++ b/packages/subgraph/src/mappings/tenderizer.ts @@ -108,7 +108,7 @@ export function handleUnlock(event: EmitUnlock): void { unlock.tenderizer = tenderizer.id unlock.amount = amount let unlockMaturityResult = TenderizerContract.bind(event.address).try__unlockMaturity(event.params.unlockID) - unlockMaturityResult.reverted ? unlock.maturity = 0 : unlock.maturity = unlockMaturityResult.value.toI32() + unlockMaturityResult.reverted ? (unlock.maturity = 0) : (unlock.maturity = unlockMaturityResult.value.toI32()) unlock.save() let unlockEvent = new UnlockEvent(event.transaction.hash.toHex()) diff --git a/packages/subgraph/src/mappings/tenderswap.ts b/packages/subgraph/src/mappings/tenderswap.ts index 51ad247..83f1df2 100644 --- a/packages/subgraph/src/mappings/tenderswap.ts +++ b/packages/subgraph/src/mappings/tenderswap.ts @@ -1,239 +1,287 @@ -import { SwapPool, SwapPoolDay, LiquidityPosition, User, SwapWithdrawEvent, SwapDepositEvent, SwapEvent, SwapUnlockBuyEvent } from '../types/schema' -import { Deposit as DepositEmitted, Withdraw as WithdrawEmitted, Swap as SwapEmitted, UnlockBought as UnlockBoughtEmitted, UnlockRedeemed as UnlockRedeemedEmitted } from '../types/templates/SwapPool/TenderSwap' -import {Transfer as SwapTokenTransferEmitted} from '../types/templates/SwapPoolToken/ERC20' -import { Address, BigInt } from '@graphprotocol/graph-ts'; -import { BI_ZERO, BD_ZERO, getUsdPrice, calculateDayID, TEN_18, convertToDecimal } from './helpers'; - +import { + SwapPool, + SwapPoolDay, + LiquidityPosition, + User, + SwapWithdrawEvent, + SwapDepositEvent, + SwapEvent, + SwapUnlockBuyEvent, + SwapLPTokenTransferEvent, + LPToken, +} from '../types/schema' +import { + Deposit as DepositEmitted, + Withdraw as WithdrawEmitted, + Swap as SwapEmitted, + UnlockBought as UnlockBoughtEmitted, + UnlockRedeemed as UnlockRedeemedEmitted, +} from '../types/templates/SwapPool/TenderSwap' +import { Transfer as SwapTokenTransferEmitted } from '../types/templates/SwapPoolToken/ERC20' +import { Address, BigInt } from '@graphprotocol/graph-ts' +import { BI_ZERO, BD_ZERO, getUsdPrice, calculateDayID, TEN_18, convertToDecimal } from './helpers' +import { log } from '@graphprotocol/graph-ts' const initiatePoolDay = (pool: SwapPool, dayID: BigInt): SwapPoolDay => { - const poolDay = new SwapPoolDay(pool.id.concat('-').concat(dayID.toString())) + const poolDay = new SwapPoolDay(pool.id.concat('-').concat(dayID.toString())) - poolDay.date = dayID.toI32() - poolDay.pool = pool.id + poolDay.date = dayID.toI32() + poolDay.pool = pool.id - poolDay.totalSupply = pool.totalSupply - poolDay.liabilities = pool.liabilities - poolDay.unlocking = pool.unlocking + poolDay.totalSupply = pool.totalSupply + poolDay.liabilities = pool.liabilities + poolDay.unlocking = pool.unlocking - poolDay.volume = BI_ZERO - poolDay.volumeUSD = BD_ZERO - poolDay.fees = BI_ZERO - poolDay.feesUSD = BD_ZERO - poolDay.lpRewards = BI_ZERO - poolDay.lpRewardsUSD = BD_ZERO - poolDay.treasuryCut = BI_ZERO - poolDay.treasuryCutUSD = BD_ZERO + poolDay.volume = BI_ZERO + poolDay.volumeUSD = BD_ZERO + poolDay.fees = BI_ZERO + poolDay.feesUSD = BD_ZERO + poolDay.lpRewards = BI_ZERO + poolDay.lpRewardsUSD = BD_ZERO + poolDay.treasuryCut = BI_ZERO + poolDay.treasuryCutUSD = BD_ZERO - return poolDay + return poolDay } - export function handleSwap(event: SwapEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - const usdPrice = getUsdPrice(Address.fromString(pool.asset)) - - const amountInUSD = usdPrice.times(convertToDecimal(event.params.amountIn)) - const feeInUSD = usdPrice.times(convertToDecimal(event.params.fee)) - - pool.unlocking = pool.unlocking.plus(event.params.amountIn) - pool.volume = pool.volume.plus(event.params.amountIn) - pool.volumeUSD = pool.volumeUSD.plus(amountInUSD) - pool.fees = pool.fees.plus(event.params.fee) - pool.feesUSD = pool.feesUSD.plus(feeInUSD) - - let dayID = calculateDayID(event.block.timestamp) - let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.volume = poolDay.volume.plus(event.params.amountIn) - poolDay.volumeUSD = poolDay.volumeUSD.plus(amountInUSD) - poolDay.fees = poolDay.fees.plus(event.params.fee) - poolDay.feesUSD = poolDay.feesUSD.plus(feeInUSD) - - poolDay.save() - pool.save() - - let swapEvent = new SwapEvent(event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString())) - swapEvent.timestamp = event.block.timestamp.toI32() - swapEvent.blockNumber = event.block.number - swapEvent.account = event.params.caller.toHex() - swapEvent.amount = event.params.amountIn - swapEvent.fee = event.params.fee - swapEvent.SwapPool = pool.id - swapEvent.save() + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + const usdPrice = getUsdPrice(Address.fromString(pool.asset)) + + const amountInUSD = usdPrice.times(convertToDecimal(event.params.amountIn)) + const feeInUSD = usdPrice.times(convertToDecimal(event.params.fee)) + + pool.unlocking = pool.unlocking.plus(event.params.amountIn) + pool.volume = pool.volume.plus(event.params.amountIn) + pool.volumeUSD = pool.volumeUSD.plus(amountInUSD) + pool.fees = pool.fees.plus(event.params.fee) + pool.feesUSD = pool.feesUSD.plus(feeInUSD) + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.volume = poolDay.volume.plus(event.params.amountIn) + poolDay.volumeUSD = poolDay.volumeUSD.plus(amountInUSD) + poolDay.fees = poolDay.fees.plus(event.params.fee) + poolDay.feesUSD = poolDay.feesUSD.plus(feeInUSD) + + poolDay.save() + pool.save() + + let swapEvent = new SwapEvent(event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString())) + swapEvent.timestamp = event.block.timestamp.toI32() + swapEvent.blockNumber = event.block.number + swapEvent.account = event.params.caller.toHex() + swapEvent.amount = event.params.amountIn + swapEvent.fee = event.params.fee + swapEvent.SwapPool = pool.id + swapEvent.save() } export function handleSwapUnlockBought(event: UnlockBoughtEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - const usdPrice = getUsdPrice(Address.fromString(pool.asset)) - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) - const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) - - pool.unlocking = pool.unlocking.minus(event.params.amount) - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) - pool.liabilities = pool.liabilities.plus(event.params.lpFees) - let dayID = calculateDayID(event.block.timestamp) - let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) - poolDay.save() - pool.save() + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + const usdPrice = getUsdPrice(Address.fromString(pool.asset)) + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() + pool.save() } export function handleSwapUnlockRedeemed(event: UnlockRedeemedEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - const usdPrice = getUsdPrice(Address.fromString(pool.asset)) - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) - - const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) - - pool.unlocking = pool.unlocking.minus(event.params.amount) - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) - pool.liabilities = pool.liabilities.plus(event.params.lpFees) - let dayID = calculateDayID(event.block.timestamp) - let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) - poolDay.save() - pool.save() + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + const usdPrice = getUsdPrice(Address.fromString(pool.asset)) + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() + pool.save() } export function handleSwapDeposit(event: DepositEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - pool.totalSupply = pool.totalSupply.plus(event.params.lpSharesMinted) - pool.liabilities = pool.liabilities.plus(event.params.amount) - - let dayID = calculateDayID(event.block.timestamp) - let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - - let from = event.params.from.toHex(); - let user = User.load(from) - if (user == null) { - user = new User(from) - user.save() - } - - let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) - if (lp == null) { - lp = new LiquidityPosition(from.concat('-').concat(pool.id)) - lp.user = from - lp.pool = pool.id - lp.shares = BI_ZERO - lp.netDeposits = BI_ZERO - } - lp.shares = lp.shares.plus(event.params.lpSharesMinted) - lp.netDeposits = lp.netDeposits.plus(event.params.amount) - lp.save() - - poolDay.save() - pool.save() - - let depositEvent = new SwapDepositEvent(event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString())) - depositEvent.timestamp = event.block.timestamp.toI32() - depositEvent.blockNumber = event.block.number - depositEvent.account = from - depositEvent.amount = event.params.amount - depositEvent.sharesMinted = event.params.lpSharesMinted - depositEvent.SwapPool = pool.id - depositEvent.save() + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + pool.totalSupply = pool.totalSupply.plus(event.params.lpSharesMinted) + pool.liabilities = pool.liabilities.plus(event.params.amount) + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + + let from = event.params.from.toHex() + let user = User.load(from) + if (user == null) { + user = new User(from) + user.save() + } + + let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) + if (lp == null) { + lp = new LiquidityPosition(from.concat('-').concat(pool.id)) + lp.user = from + lp.pool = pool.id + lp.shares = BI_ZERO + lp.netDeposits = BI_ZERO + } + lp.shares = lp.shares.plus(event.params.lpSharesMinted) + lp.netDeposits = lp.netDeposits.plus(event.params.amount) + lp.save() + + poolDay.save() + pool.save() + + let depositEvent = new SwapDepositEvent(event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString())) + depositEvent.timestamp = event.block.timestamp.toI32() + depositEvent.blockNumber = event.block.number + depositEvent.account = from + depositEvent.amount = event.params.amount + depositEvent.sharesMinted = event.params.lpSharesMinted + depositEvent.SwapPool = pool.id + depositEvent.save() } export function handleSwapWithdraw(event: WithdrawEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - let totalSupply = pool.totalSupply - pool.totalSupply = pool.totalSupply.minus(event.params.lpSharesBurnt) - pool.liabilities = pool.liabilities.minus(event.params.amount) - let user = event.params.to.toHex() - let lp = LiquidityPosition.load(user.concat('-').concat(pool.id)) - if (lp == null) return; - let bal = lp.shares.times(pool.liabilities.times(TEN_18).div(totalSupply)).div(TEN_18) + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + let totalSupply = pool.totalSupply + pool.totalSupply = pool.totalSupply.minus(event.params.lpSharesBurnt) + pool.liabilities = pool.liabilities.minus(event.params.amount) + let user = event.params.to.toHex() + let lp = LiquidityPosition.load(user.concat('-').concat(pool.id)) + if (lp == null) { + log.debug('Liquidity Position not found with id: {}', [user.concat('-').concat(pool.id)]) + } else { + let bal = lp.shares.times(pool.liabilities).div(totalSupply) let amount = event.params.amount if (bal.minus(lp.netDeposits).lt(amount)) { - // if rewards less than amount, set net deposits - // to balance minus what wasnt subtracted from the rewards - lp.netDeposits = bal.minus(amount) + // if rewards less than amount, set net deposits + // to balance minus what wasnt subtracted from the rewards + lp.netDeposits = bal.minus(amount) } lp.shares = lp.shares.minus(event.params.lpSharesBurnt) - - - let dayID = calculateDayID(event.block.timestamp) - let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - - poolDay.save() lp.save() - pool.save() - - let withdrawEvent = new SwapWithdrawEvent(event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString())) - withdrawEvent.timestamp = event.block.timestamp.toI32() - withdrawEvent.blockNumber = event.block.number - withdrawEvent.account = user - withdrawEvent.amount = event.params.amount - withdrawEvent.sharesBurnt = event.params.lpSharesBurnt - withdrawEvent.SwapPool = pool.id - withdrawEvent.save() + } + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + + poolDay.save() + pool.save() + + let withdrawEvent = new SwapWithdrawEvent( + event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString()) + ) + withdrawEvent.timestamp = event.block.timestamp.toI32() + withdrawEvent.blockNumber = event.block.number + withdrawEvent.account = user + withdrawEvent.amount = event.params.amount + withdrawEvent.sharesBurnt = event.params.lpSharesBurnt + withdrawEvent.SwapPool = pool.id + withdrawEvent.save() } export function handleSwapTokenTransfer(event: SwapTokenTransferEmitted): void { - let pool = SwapPool.load(event.address.toHex()) - if (pool == null) return; - - let from = event.params.from.toHex(); - let to = event.params.to.toHex(); - let user = User.load(from) - if (user == null) { - user = new User(from) - user.save() - } - - let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) - if (lp == null) return; - + log.debug('Swap Token Transfer Event: {}', [event.transaction.hash.toHex()]) + // burn + if (event.params.to.toHex() == '0x0000000000000000000000000000000000000000') return + // mint + if (event.params.from.toHex() == '0x0000000000000000000000000000000000000000') return + + let lpToken = LPToken.load(event.address.toHex()) + if (lpToken == null) return + + let pool = SwapPool.load(lpToken.pool) + if (pool == null) return + + let from = event.params.from.toHex() + let to = event.params.to.toHex() + let toUser = User.load(to) + if (toUser == null) { + toUser = new User(to) + toUser.save() + } + + let lpTo = LiquidityPosition.load(to.concat('-').concat(pool.id)) + if (lpTo == null) { + lpTo = new LiquidityPosition(to.concat('-').concat(pool.id)) + lpTo.user = to + lpTo.pool = pool.id + lpTo.shares = BI_ZERO + lpTo.netDeposits = BI_ZERO + } + lpTo.shares = lpTo.shares.plus(event.params.value) + + let value = event.params.value.times(pool.liabilities).div(pool.totalSupply) + lpTo.netDeposits = value + lpTo.save() + + let transfer = new SwapLPTokenTransferEvent( + event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString()) + ) + transfer.timestamp = event.block.timestamp.toI32() + transfer.blockNumber = event.block.number + transfer.from = from + transfer.to = to + transfer.value = value + transfer.shares = event.params.value + transfer.SwapPool = pool.id + transfer.save() + + let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) + if (lp != null) { + lp.shares = lp.shares.minus(event.params.value) let totalSupply = pool.totalSupply - let bal = lp.shares.times(pool.liabilities.times(TEN_18).div(totalSupply)).div(TEN_18) - let amount = event.params.value - if (bal.minus(lp.netDeposits).lt(amount)) { - // if rewards less than amount, set net deposits - // to balance minus what wasnt subtracted from the rewards - lp.netDeposits = bal.minus(amount) - } - - let lpTo = LiquidityPosition.load(to.concat('-').concat(pool.id)) - if (lpTo == null) { - lpTo = new LiquidityPosition(to.concat('-').concat(pool.id)) - lpTo.user = to - lpTo.pool = pool.id - lpTo.shares = BI_ZERO - lpTo.netDeposits = BI_ZERO + let bal = lp.shares.times(pool.liabilities).div(totalSupply) + if (bal.minus(lp.netDeposits).lt(value)) { + // if rewards less than amount, set net deposits + // to balance minus what wasnt subtracted from the rewards + let remainder = value.minus(bal.minus(lp.netDeposits)) + if (remainder.lt(lp.netDeposits)) { + lp.netDeposits = bal.minus(remainder) + } else { + lp.netDeposits = BI_ZERO + } } - lpTo.shares = lpTo.shares.plus(event.params.value) - lpTo.netDeposits = lpTo.netDeposits.plus(event.params.value) lp.save() - lpTo.save() -} \ No newline at end of file + } +} diff --git a/packages/subgraph/src/mappings/unlocks.ts b/packages/subgraph/src/mappings/unlocks.ts index e412629..63a9471 100644 --- a/packages/subgraph/src/mappings/unlocks.ts +++ b/packages/subgraph/src/mappings/unlocks.ts @@ -1,24 +1,23 @@ - -import { Unlock, User } from "../types/schema"; -import { Transfer as UnlockTransferEvent } from "../types/Unlocks/Unlocks"; -import { ADDRESS_ZERO, decodeTokenId } from "./helpers"; +import { Unlock, User } from '../types/schema' +import { Transfer as UnlockTransferEvent } from '../types/Unlocks/Unlocks' +import { ADDRESS_ZERO, decodeTokenId } from './helpers' export function handleUnlockTransfer(event: UnlockTransferEvent): void { - if (event.params.from === ADDRESS_ZERO) return; + if (event.params.from === ADDRESS_ZERO) return - const decoded = decodeTokenId(event.params.id) - const idAsString = decoded.id.toString() - let unlockID = decoded.tenderizer.concat('0'.repeat(24 - idAsString.length).concat(idAsString)) + const decoded = decodeTokenId(event.params.id) + const idAsString = decoded.id.toString() + let unlockID = decoded.tenderizer.concat('0'.repeat(24 - idAsString.length).concat(idAsString)) - let u = Unlock.load(unlockID); - if (u == null) return; - let receiver = event.params.to.toHex(); - let user = User.load(receiver) - if (user == null) { - user = new User(receiver) - user.save() - } + let u = Unlock.load(unlockID) + if (u == null) return + let receiver = event.params.to.toHex() + let user = User.load(receiver) + if (user == null) { + user = new User(receiver) + user.save() + } - u.user = receiver; - u.save(); -} \ No newline at end of file + u.user = receiver + u.save() +} diff --git a/packages/subgraph/src/types/schema.ts b/packages/subgraph/src/types/schema.ts index a21b5e2..413b930 100644 --- a/packages/subgraph/src/types/schema.ts +++ b/packages/subgraph/src/types/schema.ts @@ -2360,6 +2360,144 @@ export class SwapWithdrawEvent extends Entity { } } +export class SwapLPTokenTransferEvent extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert( + id != null, + "Cannot save SwapLPTokenTransferEvent entity without an ID" + ); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type SwapLPTokenTransferEvent must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("SwapLPTokenTransferEvent", id.toString(), this); + } + } + + static loadInBlock(id: string): SwapLPTokenTransferEvent | null { + return changetype( + store.get_in_block("SwapLPTokenTransferEvent", id) + ); + } + + static load(id: string): SwapLPTokenTransferEvent | null { + return changetype( + store.get("SwapLPTokenTransferEvent", id) + ); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get timestamp(): i32 { + let value = this.get("timestamp"); + if (!value || value.kind == ValueKind.NULL) { + return 0; + } else { + return value.toI32(); + } + } + + set timestamp(value: i32) { + this.set("timestamp", Value.fromI32(value)); + } + + get blockNumber(): BigInt { + let value = this.get("blockNumber"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set blockNumber(value: BigInt) { + this.set("blockNumber", Value.fromBigInt(value)); + } + + get from(): string { + let value = this.get("from"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set from(value: string) { + this.set("from", Value.fromString(value)); + } + + get to(): string { + let value = this.get("to"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set to(value: string) { + this.set("to", Value.fromString(value)); + } + + get shares(): BigInt { + let value = this.get("shares"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set shares(value: BigInt) { + this.set("shares", Value.fromBigInt(value)); + } + + get value(): BigInt { + let value = this.get("value"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set value(value: BigInt) { + this.set("value", Value.fromBigInt(value)); + } + + get SwapPool(): string { + let value = this.get("SwapPool"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set SwapPool(value: string) { + this.set("SwapPool", Value.fromString(value)); + } +} + export class SwapUnlockBuyEvent extends Entity { constructor(id: string) { super(); @@ -2685,6 +2823,59 @@ export class SwapUnlockRedeemedEvent extends Entity { } } +export class LPToken extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save LPToken entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type LPToken must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}` + ); + store.set("LPToken", id.toString(), this); + } + } + + static loadInBlock(id: string): LPToken | null { + return changetype(store.get_in_block("LPToken", id)); + } + + static load(id: string): LPToken | null { + return changetype(store.get("LPToken", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get pool(): string { + let value = this.get("pool"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set pool(value: string) { + this.set("pool", Value.fromString(value)); + } +} + export class AssetDayLoader extends Entity { _entity: string; _field: string; diff --git a/packages/subgraph/subgraph.template.yaml b/packages/subgraph/subgraph.template.yaml index 1f31cda..133bc52 100644 --- a/packages/subgraph/subgraph.template.yaml +++ b/packages/subgraph/subgraph.template.yaml @@ -139,6 +139,7 @@ templates: file: ./src/mappings/tenderswap.ts entities: - SwapPool + - SwapLPTokenTransfer abis: - name: ERC20 file: ./abis/ERC20.json