From 735a8cc690a83a7494b118e5c15c0fd99458a6f6 Mon Sep 17 00:00:00 2001 From: Tarun Bansal Date: Fri, 29 Jul 2022 13:11:45 +0530 Subject: [PATCH] Remove from all the subgraphs schema and common lib code --- aave-v2/schema.graphql | 2 -- aave-v2/src/library/common.ts | 12 ------------ balancer-v2/schema.graphql | 2 -- balancer-v2/src/common.ts | 12 ------------ compound/schema.graphql | 2 -- compound/src/library/common.ts | 12 ------------ curve-exchange/schema.graphql | 2 -- curve-exchange/src/common.ts | 12 ------------ curve-gauges/schema.graphql | 2 -- curve-gauges/src/common.ts | 12 ------------ lib/common.ts | 12 ------------ minichef/schema.graphql | 2 -- minichef/src/library/common.ts | 12 ------------ mstable-v2/schema.graphql | 2 -- mstable-v2/src/common.ts | 12 ------------ stake-dao/schema.graphql | 2 -- stake-dao/src/common.ts | 12 ------------ sushiswap-farms/schema.graphql | 2 -- sushiswap-farms/src/library/common.ts | 12 ------------ 19 files changed, 138 deletions(-) diff --git a/aave-v2/schema.graphql b/aave-v2/schema.graphql index 796ee262..4b9482a8 100644 --- a/aave-v2/schema.graphql +++ b/aave-v2/schema.graphql @@ -149,7 +149,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -165,7 +164,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/aave-v2/src/library/common.ts b/aave-v2/src/library/common.ts index 064a8bc2..27875a24 100644 --- a/aave-v2/src/library/common.ts +++ b/aave-v2/src/library/common.ts @@ -273,7 +273,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -347,7 +346,6 @@ function createPositionSnapshot(position: Position, transaction: Transaction): P newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -511,16 +509,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true; diff --git a/balancer-v2/schema.graphql b/balancer-v2/schema.graphql index 9c31c5b5..da443bda 100644 --- a/balancer-v2/schema.graphql +++ b/balancer-v2/schema.graphql @@ -145,7 +145,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -161,7 +160,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/balancer-v2/src/common.ts b/balancer-v2/src/common.ts index c4c10a72..141add1b 100644 --- a/balancer-v2/src/common.ts +++ b/balancer-v2/src/common.ts @@ -189,7 +189,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0) position.inputTokenBalances = [] position.rewardTokenBalances = [] - position.transferredTo = [] position.closed = false position.blockNumber = event.block.number position.timestamp = event.block.timestamp @@ -278,7 +277,6 @@ function createPostionSnapshot(position: Position, transaction: Transaction): Po newSnapshot.outputTokenBalance = position.outputTokenBalance newSnapshot.inputTokenBalances = position.inputTokenBalances newSnapshot.rewardTokenBalances = position.rewardTokenBalances - newSnapshot.transferredTo = position.transferredTo position.blockNumber = transaction.blockNumber position.timestamp = transaction.timestamp newSnapshot.save() @@ -398,16 +396,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance position.rewardTokenBalances = rewardTokenBalances.map(tb => tb.toString()) - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo) - if (!exists) { - let newTransferredTo = position.transferredTo - newTransferredTo.push(transferredTo) - position.transferredTo = newTransferredTo - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true diff --git a/compound/schema.graphql b/compound/schema.graphql index 853d41cf..bfcff851 100644 --- a/compound/schema.graphql +++ b/compound/schema.graphql @@ -151,7 +151,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -167,7 +166,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/compound/src/library/common.ts b/compound/src/library/common.ts index 51ae3701..d75bea08 100644 --- a/compound/src/library/common.ts +++ b/compound/src/library/common.ts @@ -273,7 +273,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -347,7 +346,6 @@ function createPositionSnapshot(position: Position, transaction: Transaction): P newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -511,16 +509,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo as string); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo as string); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true; diff --git a/curve-exchange/schema.graphql b/curve-exchange/schema.graphql index f0842230..f36c6601 100644 --- a/curve-exchange/schema.graphql +++ b/curve-exchange/schema.graphql @@ -145,7 +145,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -161,7 +160,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/curve-exchange/src/common.ts b/curve-exchange/src/common.ts index 739017da..5ea55aa7 100644 --- a/curve-exchange/src/common.ts +++ b/curve-exchange/src/common.ts @@ -180,7 +180,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -273,7 +272,6 @@ function createPostionSnapshot(position: Position, transaction: Transaction): Po newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -401,16 +399,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true; diff --git a/curve-gauges/schema.graphql b/curve-gauges/schema.graphql index aacf4a24..8ede64d3 100644 --- a/curve-gauges/schema.graphql +++ b/curve-gauges/schema.graphql @@ -147,7 +147,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -163,7 +162,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/curve-gauges/src/common.ts b/curve-gauges/src/common.ts index 0ba94ec3..a40e663f 100644 --- a/curve-gauges/src/common.ts +++ b/curve-gauges/src/common.ts @@ -232,7 +232,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -306,7 +305,6 @@ function createPositionSnapshot(position: Position, transaction: Transaction): P newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -470,16 +468,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true; diff --git a/lib/common.ts b/lib/common.ts index 5905926d..225b97cc 100644 --- a/lib/common.ts +++ b/lib/common.ts @@ -175,7 +175,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0) position.inputTokenBalances = [] position.rewardTokenBalances = [] - position.transferredTo = [] position.closed = false position.blockNumber = event.block.number position.timestamp = event.block.timestamp @@ -264,7 +263,6 @@ function createPostionSnapshot(position: Position, transaction: Transaction): Po newSnapshot.outputTokenBalance = position.outputTokenBalance newSnapshot.inputTokenBalances = position.inputTokenBalances newSnapshot.rewardTokenBalances = position.rewardTokenBalances - newSnapshot.transferredTo = position.transferredTo position.blockNumber = transaction.blockNumber position.timestamp = transaction.timestamp newSnapshot.save() @@ -384,16 +382,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance position.rewardTokenBalances = rewardTokenBalances.map(tb => tb.toString()) - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo) - if (!exists) { - let newTransferredTo = position.transferredTo - newTransferredTo.push(transferredTo) - position.transferredTo = newTransferredTo - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true diff --git a/minichef/schema.graphql b/minichef/schema.graphql index d897c282..ba127ae8 100644 --- a/minichef/schema.graphql +++ b/minichef/schema.graphql @@ -149,7 +149,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -165,7 +164,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/minichef/src/library/common.ts b/minichef/src/library/common.ts index 68bbd1d4..b2ba96ca 100644 --- a/minichef/src/library/common.ts +++ b/minichef/src/library/common.ts @@ -273,7 +273,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -347,7 +346,6 @@ function createPositionSnapshot(position: Position, transaction: Transaction): P newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -511,16 +509,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true; diff --git a/mstable-v2/schema.graphql b/mstable-v2/schema.graphql index b86a21c3..917fa33d 100644 --- a/mstable-v2/schema.graphql +++ b/mstable-v2/schema.graphql @@ -145,7 +145,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -161,7 +160,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # MStable protocol entities diff --git a/mstable-v2/src/common.ts b/mstable-v2/src/common.ts index 29952a63..b75fe33b 100644 --- a/mstable-v2/src/common.ts +++ b/mstable-v2/src/common.ts @@ -175,7 +175,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0) position.inputTokenBalances = [] position.rewardTokenBalances = [] - position.transferredTo = [] position.closed = false position.blockNumber = event.block.number position.timestamp = event.block.timestamp @@ -264,7 +263,6 @@ function createPostionSnapshot(position: Position, transaction: Transaction): Po newSnapshot.outputTokenBalance = position.outputTokenBalance newSnapshot.inputTokenBalances = position.inputTokenBalances newSnapshot.rewardTokenBalances = position.rewardTokenBalances - newSnapshot.transferredTo = position.transferredTo position.blockNumber = transaction.blockNumber position.timestamp = transaction.timestamp newSnapshot.save() @@ -384,16 +382,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance position.rewardTokenBalances = rewardTokenBalances.map(tb => tb.toString()) - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo) - if (!exists) { - let newTransferredTo = position.transferredTo - newTransferredTo.push(transferredTo) - position.transferredTo = newTransferredTo - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true diff --git a/stake-dao/schema.graphql b/stake-dao/schema.graphql index d9a759bc..0e11a64b 100644 --- a/stake-dao/schema.graphql +++ b/stake-dao/schema.graphql @@ -147,7 +147,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -163,7 +162,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/stake-dao/src/common.ts b/stake-dao/src/common.ts index fa36d58e..d8516454 100644 --- a/stake-dao/src/common.ts +++ b/stake-dao/src/common.ts @@ -200,7 +200,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0) position.inputTokenBalances = [] position.rewardTokenBalances = [] - position.transferredTo = [] position.closed = false position.blockNumber = event.block.number position.timestamp = event.block.timestamp @@ -289,7 +288,6 @@ function createPostionSnapshot(position: Position, transaction: Transaction): Po newSnapshot.outputTokenBalance = position.outputTokenBalance newSnapshot.inputTokenBalances = position.inputTokenBalances newSnapshot.rewardTokenBalances = position.rewardTokenBalances - newSnapshot.transferredTo = position.transferredTo position.blockNumber = transaction.blockNumber position.timestamp = transaction.timestamp newSnapshot.save() @@ -409,16 +407,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance position.rewardTokenBalances = rewardTokenBalances.map(tb => tb.toString()) - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo) - if (!exists) { - let newTransferredTo = position.transferredTo - newTransferredTo.push(transferredTo) - position.transferredTo = newTransferredTo - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true diff --git a/sushiswap-farms/schema.graphql b/sushiswap-farms/schema.graphql index f30f6b45..b1f17e42 100644 --- a/sushiswap-farms/schema.graphql +++ b/sushiswap-farms/schema.graphql @@ -147,7 +147,6 @@ type Position @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! closed: Boolean! blockNumber: BigInt! timestamp: BigInt! @@ -163,7 +162,6 @@ type PositionSnapshot @entity { outputTokenBalance: BigInt! inputTokenBalances: [String!]! # TokenBalance string format rewardTokenBalances: [String!]! # TokenBalance string format - transferredTo: [String!]! # TokenBalance string format } # END - Common entities for all protocols diff --git a/sushiswap-farms/src/library/common.ts b/sushiswap-farms/src/library/common.ts index 1e168849..de38d694 100644 --- a/sushiswap-farms/src/library/common.ts +++ b/sushiswap-farms/src/library/common.ts @@ -273,7 +273,6 @@ export function getOrCreateOpenPosition( position.outputTokenBalance = BigInt.fromI32(0); position.inputTokenBalances = []; position.rewardTokenBalances = []; - position.transferredTo = []; position.closed = false; position.blockNumber = event.block.number; position.timestamp = event.block.timestamp; @@ -347,7 +346,6 @@ function createPositionSnapshot(position: Position, transaction: Transaction): P newSnapshot.outputTokenBalance = position.outputTokenBalance; newSnapshot.inputTokenBalances = position.inputTokenBalances; newSnapshot.rewardTokenBalances = position.rewardTokenBalances; - newSnapshot.transferredTo = position.transferredTo; position.blockNumber = transaction.blockNumber; position.timestamp = transaction.timestamp; newSnapshot.save(); @@ -511,16 +509,6 @@ export function redeemFromMarket( position.outputTokenBalance = outputTokenBalance; position.rewardTokenBalances = rewardTokenBalances.map((tb) => tb.toString()); - // Check if it is transferred to some other account - if (transferredTo != null) { - let exists = position.transferredTo.includes(transferredTo); - if (!exists) { - let newTransferredTo = position.transferredTo; - newTransferredTo.push(transferredTo); - position.transferredTo = newTransferredTo; - } - } - // Check if postion is closed if (position.outputTokenBalance == BigInt.fromI32(0)) { position.closed = true;