Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove from all the subgraphs schema and common lib code #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions aave-v2/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions aave-v2/src/library/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -511,16 +509,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance;
position.rewardTokenBalances = rewardTokenBalances.map<string>((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;
Expand Down
2 changes: 0 additions & 2 deletions balancer-v2/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions balancer-v2/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -398,16 +396,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance
position.rewardTokenBalances = rewardTokenBalances.map<string>(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
Expand Down
2 changes: 0 additions & 2 deletions compound/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions compound/src/library/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -511,16 +509,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance;
position.rewardTokenBalances = rewardTokenBalances.map<string>((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;
Expand Down
2 changes: 0 additions & 2 deletions curve-exchange/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions curve-exchange/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -401,16 +399,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance;
position.rewardTokenBalances = rewardTokenBalances.map<string>((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;
Expand Down
2 changes: 0 additions & 2 deletions curve-gauges/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions curve-gauges/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -470,16 +468,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance;
position.rewardTokenBalances = rewardTokenBalances.map<string>((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;
Expand Down
12 changes: 0 additions & 12 deletions lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -384,16 +382,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance
position.rewardTokenBalances = rewardTokenBalances.map<string>(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
Expand Down
2 changes: 0 additions & 2 deletions minichef/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions minichef/src/library/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -511,16 +509,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance;
position.rewardTokenBalances = rewardTokenBalances.map<string>((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;
Expand Down
2 changes: 0 additions & 2 deletions mstable-v2/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions mstable-v2/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -384,16 +382,6 @@ export function redeemFromMarket(
position.outputTokenBalance = outputTokenBalance
position.rewardTokenBalances = rewardTokenBalances.map<string>(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
Expand Down
2 changes: 0 additions & 2 deletions stake-dao/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down
Loading