Skip to content

Commit

Permalink
fix: query block number in subgraph remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl committed Jun 27, 2024
1 parent aa132e3 commit 2eeb23b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions adapters/rhomarkets/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,6 @@ export const getUserTVLByBlock = async (blocks: BlockData) => {
10n ** 18n,
marketsMapping[subStates[j].market].decimals
);

if (
subStates[j].user_address.toLowerCase() ===
"0x5fa5fbe3365d4317fbaa6df9b64f2262efdc771e".toLowerCase()
) {
console.log(
"marketsMapping[subStates[j].market].decimals ",
marketsMapping[subStates[j].market].decimals
);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions adapters/rhomarkets/src/sdk/marketDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const getMarketInfos = async (
functionName: "symbol",
})) as any,
});


const exchangeRateResults = await publicClient.multicall({
contracts: markets.map((m) => ({
Expand Down
5 changes: 2 additions & 3 deletions adapters/rhomarkets/src/sdk/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ interface GraphQLResponse {
export async function fetchSubgraphData(
limit: number,
lastId: string,
blockNumber: number,
url: string
) {
const query = `
query MyQuery {
accounts(block: {number: ${blockNumber}}, first: ${limit}, where: { id_gt: "${lastId}" }, orderBy: id) {
accounts(first: ${limit}, where: { id_gt: "${lastId}" }, orderBy: id) {
id
tokens {
cTokenBalance
Expand Down Expand Up @@ -80,7 +79,7 @@ export async function fetchGraphQLData(

while (moreDataAvailable) {
const { accounts: batchData, lastId: currentLastId } =
await fetchSubgraphData(totalLimit, lastId, blockNumber, url);
await fetchSubgraphData(totalLimit, lastId, url);

lastId = currentLastId;
allData = allData.concat(batchData);
Expand Down

0 comments on commit 2eeb23b

Please sign in to comment.