Skip to content

Commit

Permalink
most code written, need to update some events
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffywu committed Jul 18, 2022
1 parent ee11fe2 commit d8e7b6c
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 117 deletions.
48 changes: 26 additions & 22 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ type StrategyVaultMaturity @entity {
"All strategy vault accounts in this maturity"
accounts: [StrategyVaultAccount!] @derivedFrom(field: "strategyVaultMaturity")
historicalValue: [StrategyVaultHistoricalValue!] @derivedFrom(field: "strategyVaultMaturity")
trades: [StrategyVaultTrade!] @derivedFrom(field: "strategyVaultMaturity")
events: [StrategyVaultMaturityEvent!] @derivedFrom(field: "strategyVaultMaturity")
}

enum VaultTradeType {
Expand All @@ -1118,6 +1118,7 @@ enum VaultTradeType {
ExitPreMaturity,
ExitPostMaturity,
DeleverageAccount,
TransferFromDeleverage,
VaultRedeemStrategyToken,
VaultMintStrategyToken
}
Expand All @@ -1132,41 +1133,44 @@ type StrategyVaultTrade @entity {
transactionOrigin: Bytes!

vaultTradeType: VaultTradeType!
isVaultAction: Boolean!

strategyVaultMaturity: StrategyVaultMaturity!
"Will be empty if action is a vault level action"
strategyVaultAccount: StrategyVaultAccount
strategyVaultAccount: StrategyVaultAccount!
strategyVaultMaturityBefore: StrategyVaultMaturity
strategyVaultMaturityAfter: StrategyVaultMaturity

"Net change to fCash borrowed in the primary currencies"
primaryfCashBefore: BigInt!
primaryfCashAfter: BigInt!
netPrimaryfCashChange: BigInt!
primaryBorrowfCashBefore: BigInt!
primaryBorrowfCashAfter: BigInt!
netPrimaryBorrowfCashChange: BigInt!

"Net change to vault shares"
vaultSharesBefore: BigInt!
vaultSharesAfter: BigInt!
netVaultShareChange: BigInt!
netVaultSharesChange: BigInt!

"Net change to fCash borrowed in the secondary currencies"
secondaryDebtSharesBefore: [BigInt!]
secondaryDebtSharesAfter: [BigInt!]
netSecondaryDebtSharesChange: [BigInt!]
}

type StrategyVaultMaturityEvent @entity {
"strategyVault:account or vault address:transaction hash:log index"
id: ID!
blockHash: Bytes!
blockNumber: Int!
timestamp: Int!
transactionHash: Bytes!
transactionOrigin: Bytes!

strategyVaultMaturity: StrategyVaultMaturity!
"Net change to strategy tokens"
strategyTokensBefore: BigInt!
strategyTokensAfter: BigInt!
netStrategyTokenChange: BigInt!

"Net change to asset cash"
assetCashBefore: BigInt!
assetCashAfter: BigInt!
netAssetCashChange: BigInt!

"Net change to fCash borrowed in the secondary currencies"
secondaryfCashBefore: [BigInt!]
secondaryfCashAfter: [BigInt!]
netSecondaryfCashChange: [BigInt!]

"True if the liquidator transferred shares during liquidation"
didTransferInLiquidation: Boolean
}


type StrategyVaultHistoricalValue @entity {
"strategyVault:maturity:timestamp"
id: ID!
Expand Down
Loading

0 comments on commit d8e7b6c

Please sign in to comment.