Advertisement
alfonso_graziano_bc

AAVE

Aug 23rd, 2021
1,743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 4.84 KB | None | 0 0
  1. type Pool @entity {
  2.   id: ID!
  3.   protocol: Protocol!
  4.   lendingPool: Bytes
  5.   lendingPoolCollateralManager: Bytes
  6.   lendingPoolConfiguratorImpl: Bytes
  7.   lendingPoolImpl: Bytes
  8.   lendingPoolConfigurator: Bytes
  9.   proxyPriceProvider: Bytes
  10.   lendingRateOracle: Bytes
  11.   configurationAdmin: Bytes
  12.   ethereumAddress: Bytes
  13.   emergencyAdmin: Bytes
  14.   history: [PoolConfigurationHistoryItem!]! @derivedFrom(field: "pool")
  15.   lastUpdateTimestamp: Int!
  16.  
  17.   reserves: [Reserve!]! @derivedFrom(field: "pool")
  18.   depositHistory: [Deposit!]! @derivedFrom(field: "pool")
  19.   redeemUnderlyingHistory: [RedeemUnderlying!]! @derivedFrom(field: "pool")
  20.   borrowHistory: [Borrow!]! @derivedFrom(field: "pool")
  21.   swapHistory: [Swap!]! @derivedFrom(field: "pool")
  22.   usageAsCollateralHistory: [UsageAsCollateral!]! @derivedFrom(field: "pool")
  23.   rebalanceStableBorrowRateHistory: [RebalanceStableBorrowRate!]! @derivedFrom(field: "pool")
  24.   repayHistory: [Repay!]! @derivedFrom(field: "pool")
  25.   flashLoanHistory: [FlashLoan!]! @derivedFrom(field: "pool")
  26.   liquidationCallHistory: [LiquidationCall!]! @derivedFrom(field: "pool")
  27.   originationFeeLiquidationHistory: [OriginationFeeLiquidation!]! @derivedFrom(field: "pool")
  28.  
  29.   active: Boolean!
  30.   paused: Boolean!
  31. }
  32.  
  33. #una riserva sarebbe un token
  34. type Reserve @entity {
  35.   """
  36.  Reserve address
  37.  """
  38.   id: ID!
  39.   underlyingAsset: Bytes!
  40.   pool: Pool!
  41.   symbol: String!
  42.   name: String!
  43.   #uiColor: String! #TODO MOVE: move to the frontend
  44.   #currencyType: CurrencyType! #TODO MOVE: move to the frontend
  45.   decimals: Int!
  46.   usageAsCollateralEnabled: Boolean! # defalt false
  47.   borrowingEnabled: Boolean! # defalt false
  48.   stableBorrowRateEnabled: Boolean! # defalt false
  49.   isActive: Boolean! # defalt false
  50.   isFrozen: Boolean! # defalt false
  51.   price: PriceOracleAsset!
  52.   reserveInterestRateStrategy: Bytes!
  53.   optimalUtilisationRate: BigInt!
  54.   variableRateSlope1: BigInt!
  55.   variableRateSlope2: BigInt!
  56.   stableRateSlope1: BigInt!
  57.   stableRateSlope2: BigInt!
  58.   baseVariableBorrowRate: BigInt!
  59.   baseLTVasCollateral: BigInt!
  60.   reserveLiquidationThreshold: BigInt!
  61.   reserveLiquidationBonus: BigInt!
  62.   utilizationRate: BigDecimal! # default: 0
  63.   totalLiquidity: BigInt! # default: 0
  64.   totalATokenSupply: BigInt!
  65.   totalLiquidityAsCollateral: BigInt! # default: 0
  66.   availableLiquidity: BigInt! # default: 0
  67.   totalPrincipalStableDebt: BigInt! # default: 0
  68.   totalScaledVariableDebt: BigInt! # default: 0
  69.   totalCurrentVariableDebt: BigInt! # default: 0
  70.   totalDeposits: BigInt! # default: 0
  71.   liquidityRate: BigInt! # depositors interest
  72.   averageStableRate: BigInt!
  73.   variableBorrowRate: BigInt!
  74.   stableBorrowRate: BigInt!
  75.   liquidityIndex: BigInt!
  76.   variableBorrowIndex: BigInt!
  77.   aToken: AToken!
  78.   vToken: VToken!
  79.   sToken: SToken!
  80.   reserveFactor: BigInt! #default 0
  81.   lastUpdateTimestamp: Int!
  82.   stableDebtLastUpdateTimestamp: Int!
  83.  
  84.   # incentives
  85.   aEmissionPerSecond: BigInt!
  86.   vEmissionPerSecond: BigInt!
  87.   sEmissionPerSecond: BigInt!
  88.   aTokenIncentivesIndex: BigInt!
  89.   vTokenIncentivesIndex: BigInt!
  90.   sTokenIncentivesIndex: BigInt!
  91.   aIncentivesLastUpdateTimestamp: Int!
  92.   vIncentivesLastUpdateTimestamp: Int!
  93.   sIncentivesLastUpdateTimestamp: Int!
  94.  
  95.   lifetimeLiquidity: BigInt! # default: 0
  96.   lifetimePrincipalStableDebt: BigInt! # default: 0
  97.   lifetimeScaledVariableDebt: BigInt! # default: 0
  98.   lifetimeCurrentVariableDebt: BigInt! # default: 0
  99.   lifetimeRepayments: BigInt! # default: 0
  100.   lifetimeWithdrawals: BigInt! # default: 0
  101.   lifetimeBorrows: BigInt! # default: 0
  102.   lifetimeLiquidated: BigInt! # default: 0
  103.   lifetimeFlashLoans: BigInt! # default: 0
  104.   lifetimeFlashLoanPremium: BigInt! # default: 0
  105.   lifetimeDepositorsInterestEarned: BigInt!
  106.   lifetimeReserveFactorAccrued: BigInt!
  107.   # lifetimeStableDebFeeCollected: BigInt!
  108.   # lifetimeVariableDebtFeeCollected: BigInt!
  109.   userReserves: [UserReserve!]! @derivedFrom(field: "reserve")
  110.   depositHistory: [Deposit!]! @derivedFrom(field: "reserve")
  111.   redeemUnderlyingHistory: [RedeemUnderlying!]! @derivedFrom(field: "reserve")
  112.   borrowHistory: [Borrow!]! @derivedFrom(field: "reserve")
  113.   usageAsCollateralHistory: [UsageAsCollateral!]! @derivedFrom(field: "reserve")
  114.   swapHistory: [Swap!]! @derivedFrom(field: "reserve")
  115.   rebalanceStableBorrowRateHistory: [RebalanceStableBorrowRate!]! @derivedFrom(field: "reserve")
  116.   repayHistory: [Repay!]! @derivedFrom(field: "reserve")
  117.   flashLoanHistory: [FlashLoan!]! @derivedFrom(field: "reserve")
  118.   liquidationCallHistory: [LiquidationCall!]! @derivedFrom(field: "collateralReserve")
  119.   originationFeeLiquidationHistory: [OriginationFeeLiquidation!]!
  120.     @derivedFrom(field: "collateralReserve")
  121.   paramsHistory: [ReserveParamsHistoryItem!]! @derivedFrom(field: "reserve")
  122.   configurationHistory: [ReserveConfigurationHistoryItem!]! @derivedFrom(field: "reserve")
  123.   deposits: [Deposit!]! @derivedFrom(field: "reserve")
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement