-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interest rate fetching to the subgraph client
In this update, we introduced a new function `getInterestRates` to the subgraph client API. The function allows querying MorphoBlueMarket for its interest rates within a particular time range. A specific GraphQL query, `GetInterestRates`, has been defined for this purpose. The upgrade enhances data interaction with the decentralized finance market.
- Loading branch information
1 parent
069112c
commit 12c0d56
Showing
4 changed files
with
148 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
packages/morpho-blue-subgraph/queries/intrest-rates.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
query GetInterestRates($marketId: String!, $marketIdBytes: ID!, $fromTimestamp: BigInt!, $toTimestamp: BigInt!) { | ||
market(id: $marketIdBytes) { | ||
id | ||
collateralToken { | ||
address | ||
symbol | ||
} | ||
debtToken { | ||
address | ||
symbol | ||
} | ||
} | ||
interestRates(where: { market: $marketId, timestamp_gte: $fromTimestamp, timestamp_lte: $toTimestamp }, orderBy: timestamp, orderDirection: desc) { | ||
id | ||
rate | ||
timestamp | ||
type | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters