Skip to content

Commit

Permalink
Merge branch 'master' into fill-missing-snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-chauhan committed Dec 5, 2023
2 parents 8cbecb7 + 18a4325 commit b77963c
Show file tree
Hide file tree
Showing 16 changed files with 3,988 additions and 3,449 deletions.
48 changes: 26 additions & 22 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -178,7 +178,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -212,7 +212,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -246,7 +246,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -272,7 +272,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -298,7 +298,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -332,7 +332,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -358,7 +358,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -384,7 +384,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -410,7 +410,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -432,7 +432,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -458,7 +458,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -480,7 +480,7 @@
"status": "dev",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -502,7 +502,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.1.0"
},
"files": {
Expand All @@ -528,7 +528,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "1.0.1",
"subgraph": "1.1.0",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -3592,7 +3592,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -3626,7 +3626,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -3652,7 +3652,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.5",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -3682,7 +3682,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -3716,7 +3716,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -3742,7 +3742,7 @@
"status": "prod",
"versions": {
"schema": "3.0.1",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -3772,7 +3772,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.0.4",
"subgraph": "2.1.0",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -9870,6 +9870,10 @@
"hosted-service": {
"slug": "friend-tech-base",
"query-id": "friend-tech-base"
},
"decentralized-network": {
"slug": "friend-tech-base",
"query-id": "8fjDwMF5JPXYEg3tU45ttTsnp3mdTQd5efhkHhHGHCKj"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/_reference_/src/sdk/protocols/lending/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { INT_ONE, INT_ZERO } from "./constants";
* - Making position snapshots
*
* Schema Version: 3.1.1
* SDK Version: 1.0.7
* SDK Version: 1.0.8
* Author(s):
* - @melotik
* - @dhruv-chauhan
Expand Down
6 changes: 4 additions & 2 deletions subgraphs/_reference_/src/sdk/protocols/lending/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { PositionManager } from "./position";
* need to think about all of the detailed storage changes that occur.
*
* Schema Version: 3.1.1
* SDK Version: 1.0.7
* SDK Version: 1.0.8
* Author(s):
* - @melotik
* - @dhruv-chauhan
Expand Down Expand Up @@ -888,14 +888,16 @@ export class DataManager {
newVariableBorrowBalance: BigInt | null = null,
newStableBorrowBalance: BigInt | null = null,
newReserveBalance: BigInt | null = null,
exchangeRate: BigDecimal | null = null
exchangeRate: BigDecimal | null = null,
outputTokenSupply: BigInt | null = null
): void {
const mantissaFactorBD = exponentToBigDecimal(
this.inputToken.getDecimals()
);
this.inputToken.updatePrice(inputTokenPriceUSD);
this.market.inputTokenPriceUSD = inputTokenPriceUSD;
this.market.inputTokenBalance = newInputTokenBalance;
this.market.outputTokenSupply = outputTokenSupply;
if (newVariableBorrowBalance) {
this.market.variableBorrowedTokenBalance = newVariableBorrowBalance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { PositionSide } from "./constants";
* make changes to a given position.
*
* Schema Version: 3.1.1
* SDK Version: 1.0.7
* SDK Version: 1.0.8
* Author(s):
* - @melotik
* - @dhruv-chauhan
Expand Down
9 changes: 8 additions & 1 deletion subgraphs/_reference_/src/sdk/protocols/lending/snapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
* need to think about all of the detailed storage changes that occur.
*
* Schema Version: 3.1.1
* SDK Version: 1.0.7
* SDK Version: 1.0.8
* Author(s):
* - @melotik
* - @dhruv-chauhan
Expand Down Expand Up @@ -456,6 +456,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyDepositUSD.plus(amountUSD);
this.financialSnapshot.dailyDepositUSD =
this.financialSnapshot.dailyDepositUSD.plus(amountUSD);
this.marketDailySnapshot.dailyDepositCount += INT_ONE;
this.usageDailySnapshot.dailyDepositCount += INT_ONE;
this.usageHourlySnapshot.hourlyDepositCount += INT_ONE;
} else if (transactionType == TransactionType.WITHDRAW) {
Expand All @@ -467,6 +468,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyWithdrawUSD.plus(amountUSD);
this.financialSnapshot.dailyWithdrawUSD =
this.financialSnapshot.dailyWithdrawUSD.plus(amountUSD);
this.marketDailySnapshot.dailyWithdrawCount += INT_ONE;
this.usageDailySnapshot.dailyWithdrawCount += INT_ONE;
this.usageHourlySnapshot.hourlyWithdrawCount += INT_ONE;
} else if (transactionType == TransactionType.BORROW) {
Expand All @@ -478,6 +480,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyBorrowUSD.plus(amountUSD);
this.financialSnapshot.dailyBorrowUSD =
this.financialSnapshot.dailyBorrowUSD.plus(amountUSD);
this.marketDailySnapshot.dailyBorrowCount += INT_ONE;
this.usageDailySnapshot.dailyBorrowCount += INT_ONE;
this.usageHourlySnapshot.hourlyBorrowCount += INT_ONE;
} else if (transactionType == TransactionType.REPAY) {
Expand All @@ -489,6 +492,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyRepayUSD.plus(amountUSD);
this.financialSnapshot.dailyRepayUSD =
this.financialSnapshot.dailyRepayUSD.plus(amountUSD);
this.marketDailySnapshot.dailyRepayCount += INT_ONE;
this.usageDailySnapshot.dailyRepayCount += INT_ONE;
this.usageHourlySnapshot.hourlyRepayCount += INT_ONE;
} else if (transactionType == TransactionType.LIQUIDATE) {
Expand All @@ -500,6 +504,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyLiquidateUSD.plus(amountUSD);
this.financialSnapshot.dailyLiquidateUSD =
this.financialSnapshot.dailyLiquidateUSD.plus(amountUSD);
this.marketDailySnapshot.dailyLiquidateCount += INT_ONE;
this.usageDailySnapshot.dailyLiquidateCount += INT_ONE;
this.usageHourlySnapshot.hourlyLiquidateCount += INT_ONE;
} else if (transactionType == TransactionType.TRANSFER) {
Expand All @@ -511,6 +516,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyTransferUSD.plus(amountUSD);
this.financialSnapshot.dailyTransferUSD =
this.financialSnapshot.dailyTransferUSD.plus(amountUSD);
this.marketDailySnapshot.dailyTransferCount += INT_ONE;
this.usageDailySnapshot.dailyTransferCount += INT_ONE;
} else if (transactionType == TransactionType.FLASHLOAN) {
this.marketDailySnapshot.dailyFlashloanUSD =
Expand All @@ -521,6 +527,7 @@ export class SnapshotManager {
this.marketHourlySnapshot.hourlyFlashloanUSD.plus(amountUSD);
this.financialSnapshot.dailyFlashloanUSD =
this.financialSnapshot.dailyFlashloanUSD.plus(amountUSD);
this.marketDailySnapshot.dailyFlashloanCount += INT_ONE;
this.usageDailySnapshot.dailyFlashloanCount += INT_ONE;
} else {
log.error("[updateTransactionData] Invalid transaction type: {}", [
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/_reference_/src/sdk/protocols/lending/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
* use in mappings and get info about the token.
*
* Schema Version: 3.1.1
* SDK Version: 1.0.7
* SDK Version: 1.0.8
* Author(s):
* - @melotik
* - @dhruv-chauhan
Expand Down
2 changes: 2 additions & 0 deletions subgraphs/aave-forks/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# .prettierrc or .prettierrc.yaml
trailingComma: "es5"
Loading

0 comments on commit b77963c

Please sign in to comment.