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

Feat/add accrued interest #32

Open
wants to merge 22 commits into
base: notional-v3
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Negativef",
"Positivef",
"Rebalance",
"reinvestments",
"Wrappedf"
],
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"deploy:mainnet": "yarn run prepare:mainnet && yarn run codegen && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ notional-finance/mainnet-v2",
"deploy:mainnet-debug": "yarn run prepare:mainnet && yarn run codegen && graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ notional-finance/mainnet-debug",
"deploy:studio:arbitrum-debug": "yarn run prepare:arbitrum-one && yarn run codegen && yarn run graph deploy --studio notional-finance-v3-arbitrum",
"deploy:studio:mainnet-debug": "yarn run prepare:mainnet && yarn run codegen && yarn run graph deploy --studio notional-finance-v3-mainnet",
"deploy:studio:arbitrum": "yarn run prepare:arbitrum-one && yarn run codegen && yarn run graph deploy --studio notional-v3-arbitrum",
"deploy:studio:mainnet": "yarn run prepare:mainnet && yarn run codegen && yarn run graph deploy --studio notional-v3-mainnet",
"subgraph:up": "./start.sh",
"subgraph:down": "docker-compose down",
"compile:subgraph": "yarn run prepare:local && yarn run codegen && yarn run build && yarn run deploy:local"
},
"devDependencies": {
"@goldskycom/cli": "^1.12.0",
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-cli": "^0.80.1",
"@graphprotocol/graph-ts": "^0.31.0",
"hbs-cli": "^1.4.0",
"matchstick-as": "^0.5.2"
Expand Down
9 changes: 8 additions & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ type ProfitLossLineItem @entity(immutable: true) {

"Set to a value that points to the token that generated an incentive payment"
incentivizedToken: Token

"Set to the amount of fees paid, if applicable"
feesPaid: BigInt
}

type Transaction @entity(immutable: true) {
Expand Down Expand Up @@ -219,8 +222,10 @@ enum OracleType {
PrimeDebtToMoneyMarketExchangeRate,
MoneyMarketToUnderlyingExchangeRate
VaultShareOracleRate,
VaultShareInterestAccrued,
nTokenToUnderlyingExchangeRate,
nTokenBlendedInterestRate,
nTokenInterestAccrued,
nTokenFeeRate,
nTokenIncentiveRate,
nTokenSecondaryIncentiveRate,
Expand Down Expand Up @@ -274,7 +279,7 @@ type Oracle @entity {
historicalRates: [ExchangeRate!] @derivedFrom(field: "oracle")
}

type ExchangeRate @entity(immutable: true) {
type ExchangeRate @entity {
"External Oracle ID:Block Number:Transaction Hash"
id: ID!
blockNumber: BigInt!
Expand Down Expand Up @@ -525,6 +530,8 @@ type BalanceSnapshot @entity(immutable: true) {
_accumulatedBalance: BigInt!
"Cumulative realized cost for internal PnL calculations"
_accumulatedCostRealized: BigInt!
"Internal interest accumulator"
_lastInterestAccumulator: BigInt!

profitLossLineItems: [ProfitLossLineItem!] @derivedFrom(field: "balanceSnapshot")
"Snapshots of the secondary incentives"
Expand Down
Loading