From 2deacb2924da6d2f174fe532fc1abcccbb1d7883 Mon Sep 17 00:00:00 2001 From: Ghost Scripter Date: Mon, 8 Jul 2024 19:27:29 +0530 Subject: [PATCH 1/3] added omni staking and LP --- adapters/zerolend/hourly_blocks.csv | 2 + adapters/zerolend/src/index.ts | 22 +++++-- adapters/zerolend/src/sdk/lp.ts | 61 +++++++++++++++++++ adapters/zerolend/src/sdk/stake.ts | 62 ++++++++++++++++++++ adapters/zerolend/src/{sdk.ts => sdk/tvl.ts} | 38 +----------- adapters/zerolend/src/sdk/types.ts | 47 +++++++++++++++ 6 files changed, 193 insertions(+), 39 deletions(-) create mode 100644 adapters/zerolend/hourly_blocks.csv create mode 100644 adapters/zerolend/src/sdk/lp.ts create mode 100644 adapters/zerolend/src/sdk/stake.ts rename adapters/zerolend/src/{sdk.ts => sdk/tvl.ts} (71%) create mode 100644 adapters/zerolend/src/sdk/types.ts diff --git a/adapters/zerolend/hourly_blocks.csv b/adapters/zerolend/hourly_blocks.csv new file mode 100644 index 00000000..8ffabfab --- /dev/null +++ b/adapters/zerolend/hourly_blocks.csv @@ -0,0 +1,2 @@ +number,timestamp +4243360,1714773599 \ No newline at end of file diff --git a/adapters/zerolend/src/index.ts b/adapters/zerolend/src/index.ts index ed58aaa1..40def2f2 100644 --- a/adapters/zerolend/src/index.ts +++ b/adapters/zerolend/src/index.ts @@ -1,7 +1,10 @@ import { write } from "fast-csv"; import fs from "fs"; import csv from "csv-parser"; -import { BlockData, getUserTVLByBlock } from "./sdk"; +import { BlockData } from "./sdk/types"; +import { getUserTVLByBlock } from "./sdk/tvl"; +import { getUserStakeByBlock } from "./sdk/stake"; +import { getUserLPByBlock } from "./sdk/lp"; // const readBlocksFromCSV = async (filePath: string): Promise => { // const blocks: BlockData[] = []; @@ -98,10 +101,21 @@ readBlocksFromCSV('hourly_blocks.csv').then(async (blocks: BlockData[]) => { for (const block of blocks) { try { - const result = await getUserTVLByBlock(block); - for (let i = 0; i < result.length; i++) { - allCsvRows.push(result[i]) + const resultTvl = await getUserTVLByBlock(block); + for (let i = 0; i < resultTvl.length; i++) { + allCsvRows.push(resultTvl[i]) } + + const resultStake = await getUserStakeByBlock(block); + for (let i = 0; i < resultStake.length; i++) { + allCsvRows.push(resultStake[i]) + } + + const resultLp = await getUserLPByBlock(block); + for (let i = 0; i < resultLp.length; i++) { + allCsvRows.push(resultLp[i]) + } + } catch (error) { console.error(`An error occurred for block ${block}:`, error); } diff --git a/adapters/zerolend/src/sdk/lp.ts b/adapters/zerolend/src/sdk/lp.ts new file mode 100644 index 00000000..0426a3ff --- /dev/null +++ b/adapters/zerolend/src/sdk/lp.ts @@ -0,0 +1,61 @@ +import { BlockData, IOmniStakingData, IOmniStakingResponse, ITVLResponse, OutputDataSchemaRow } from "./types"; + +const queryURL = + "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; + +const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7" //do we need to convert the case + +const symbol = "ZERO" + +export const getUserLPByBlock = async ( + blocks: BlockData +): Promise => { + const timestamp = blocks.blockTimestamp; + const first = 1000; + const rows: OutputDataSchemaRow[] = []; + + let lastAddress = "0x0000000000000000000000000000000000000000"; + + do { + const query = `{ + tokenBalances( + where: {id_gt: "${lastAddress}", balance_omni_lp_gt: "0"} + first: ${first} + ) { + id + balance_omni_lp + } + }`; + + const response = await fetch(queryURL, { + method: "POST", + body: JSON.stringify({ query }), + headers: { "Content-Type": "application/json" }, + }); + const batch: IOmniStakingResponse = await response.json(); + + if (!batch.data || batch.data.tokenBalances.length == 0) break; + + batch.data.tokenBalances.forEach((data: IOmniStakingData) => { + + rows.push({ + block_number: blocks.blockNumber, + timestamp, + user_address: data.id, + token_address: tokenAddress, + token_balance: Number(data.balance_omni_lp), + token_symbol: symbol, + usd_price: 0, + }); + + lastAddress = data.id; + }); + + console.log( + `Processed ${rows.length} rows. Last address is ${lastAddress}` + ); + } while (true); + + return rows; +}; + diff --git a/adapters/zerolend/src/sdk/stake.ts b/adapters/zerolend/src/sdk/stake.ts new file mode 100644 index 00000000..3b5722b8 --- /dev/null +++ b/adapters/zerolend/src/sdk/stake.ts @@ -0,0 +1,62 @@ +import { BlockData, IOmniStakingData, IOmniStakingResponse, ITVLResponse, OutputDataSchemaRow } from "./types"; + + +const queryURL = + "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; + +const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7" //do we need to convert the case + +const symbol = "ZERO" + +export const getUserStakeByBlock = async ( + blocks: BlockData +): Promise => { + const timestamp = blocks.blockTimestamp; + const first = 1000; + const rows: OutputDataSchemaRow[] = []; + + let lastAddress = "0x0000000000000000000000000000000000000000"; + + do { + const query = `{ + tokenBalances( + where: {id_gt: "${lastAddress}", balance_omni_gt: "0"} + first: ${first} + ) { + id + balance_omni + } + }`; + + const response = await fetch(queryURL, { + method: "POST", + body: JSON.stringify({ query }), + headers: { "Content-Type": "application/json" }, + }); + const batch: IOmniStakingResponse = await response.json(); + + if (!batch.data || batch.data.tokenBalances.length == 0) break; + + batch.data.tokenBalances.forEach((data: IOmniStakingData) => { + + rows.push({ + block_number: blocks.blockNumber, + timestamp, + user_address: data.id, + token_address: tokenAddress, + token_balance: Number(data.balance_omni), + token_symbol: symbol, + usd_price: 0, + }); + + lastAddress = data.id; + }); + + console.log( + `Processed ${rows.length} rows. Last address is ${lastAddress}` + ); + } while (true); + + return rows; +}; + diff --git a/adapters/zerolend/src/sdk.ts b/adapters/zerolend/src/sdk/tvl.ts similarity index 71% rename from adapters/zerolend/src/sdk.ts rename to adapters/zerolend/src/sdk/tvl.ts index efb596db..015ba549 100644 --- a/adapters/zerolend/src/sdk.ts +++ b/adapters/zerolend/src/sdk/tvl.ts @@ -1,37 +1,5 @@ -interface IResponse { - data: { - userReserves: IData[]; - }; -} +import { BlockData, ITVLData, ITVLResponse, OutputDataSchemaRow } from "./types"; -interface IData { - user: { - id: string; - }; - currentTotalDebt: string; - currentATokenBalance: string; - reserve: { - underlyingAsset: string; - symbol: string; - name: string; - }; - liquidityRate: "0"; -} - -type OutputDataSchemaRow = { - block_number: number; - timestamp: number; - user_address: string; - token_address: string; - token_balance: number; - token_symbol: string; - usd_price: number; -}; - -export interface BlockData { - blockNumber: number; - blockTimestamp: number; -} const queryURL = "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-linea/1.0.0/gn"; @@ -71,11 +39,11 @@ export const getUserTVLByBlock = async ( body: JSON.stringify({ query }), headers: { "Content-Type": "application/json" }, }); - const batch: IResponse = await response.json(); + const batch: ITVLResponse = await response.json(); if (!batch.data || batch.data.userReserves.length == 0) break; - batch.data.userReserves.forEach((data: IData) => { + batch.data.userReserves.forEach((data: ITVLData) => { const balance = BigInt(data.currentATokenBalance) - BigInt(data.currentTotalDebt); diff --git a/adapters/zerolend/src/sdk/types.ts b/adapters/zerolend/src/sdk/types.ts new file mode 100644 index 00000000..76dfdfe1 --- /dev/null +++ b/adapters/zerolend/src/sdk/types.ts @@ -0,0 +1,47 @@ +export interface IOmniStakingResponse { + data: { + tokenBalances: IOmniStakingData[]; + }; +} + +export interface IOmniStakingData { + id: string, + balance_omni: string + balance_omni_lp: string + +} + +export type OutputDataSchemaRow = { + block_number: number; + timestamp: number; + user_address: string; + token_address: string; + token_balance: number; + token_symbol: string; + usd_price: number; +}; + +export interface BlockData { + blockNumber: number; + blockTimestamp: number; +} + +export interface ITVLResponse { + data: { + userReserves: ITVLData[]; + }; +} + +export interface ITVLData { + user: { + id: string; + }; + currentTotalDebt: string; + currentATokenBalance: string; + reserve: { + underlyingAsset: string; + symbol: string; + name: string; + }; + liquidityRate: "0"; +} \ No newline at end of file From 27db579fdf31e1c36a3006f4394c770fdb05d8b5 Mon Sep 17 00:00:00 2001 From: Deadshot Ryker Date: Mon, 29 Jul 2024 03:34:23 +0400 Subject: [PATCH 2/3] formatted files for ZL --- adapters/zerolend/src/index.ts | 138 +++++++++-------------------- adapters/zerolend/src/sdk/lp.ts | 106 +++++++++++----------- adapters/zerolend/src/sdk/stake.ts | 80 +++++++++-------- adapters/zerolend/src/sdk/tvl.ts | 8 +- adapters/zerolend/src/sdk/types.ts | 61 +++++++------ 5 files changed, 171 insertions(+), 222 deletions(-) diff --git a/adapters/zerolend/src/index.ts b/adapters/zerolend/src/index.ts index 40def2f2..dcb38919 100644 --- a/adapters/zerolend/src/index.ts +++ b/adapters/zerolend/src/index.ts @@ -6,65 +6,6 @@ import { getUserTVLByBlock } from "./sdk/tvl"; import { getUserStakeByBlock } from "./sdk/stake"; import { getUserLPByBlock } from "./sdk/lp"; -// const readBlocksFromCSV = async (filePath: string): Promise => { -// const blocks: BlockData[] = []; - -// await new Promise((resolve, reject) => { -// fs.createReadStream(filePath) -// .pipe(csv()) // Specify the separator as '\t' for TSV files -// .on("data", (row: any) => { -// const blockNumber = parseInt(row.number, 10); -// const blockTimestamp = parseInt(row.block_timestamp, 10); -// if (!isNaN(blockNumber) && blockTimestamp) { -// blocks.push({ blockNumber: blockNumber, blockTimestamp }); -// } -// }) -// .on("end", resolve) -// .on("error", reject); -// }); - -// return blocks; -// }; - -// readBlocksFromCSV("hourly_blocks.csv") -// .then(async (blocks) => { -// const allCsvRows: any[] = []; // Array to accumulate CSV rows for all blocks -// const batchSize = 10; // Size of batch to trigger writing to the file -// let i = 0; -// console.log("block number received") -// for (const block of blocks) { -// try { -// const result = await getUserTVLByBlock(block); - -// // Accumulate CSV rows for all blocks -// allCsvRows.push(...result); - -// i++; -// console.log(`Processed block ${i}`); - -// // Write to file when batch size is reached or at the end of loop -// if (i % batchSize === 0 || i === blocks.length) { -// const ws = fs.createWriteStream(`outputData.csv`, { -// flags: i === batchSize ? "w" : "a", -// }); -// write(allCsvRows, { headers: i === batchSize ? true : false }) -// .pipe(ws) -// .on("finish", () => { -// console.log(`CSV file has been written.`); -// }); - -// // Clear the accumulated CSV rows -// allCsvRows.length = 0; -// } -// } catch (error) { -// console.error(`An error occurred for block ${block}:`, error); -// } -// } -// }) -// .catch((err) => { -// console.error("Error reading CSV file:", err); -// }); - module.exports = { getUserTVLByBlock, }; @@ -75,17 +16,17 @@ const readBlocksFromCSV = async (filePath: string): Promise => { await new Promise((resolve, reject) => { fs.createReadStream(filePath) .pipe(csv()) // Specify the separator as '\t' for TSV files - .on('data', (row) => { + .on("data", (row) => { const blockNumber = parseInt(row.number, 10); const blockTimestamp = parseInt(row.timestamp, 10); if (!isNaN(blockNumber) && blockTimestamp) { blocks.push({ blockNumber: blockNumber, blockTimestamp }); } }) - .on('end', () => { + .on("end", () => { resolve(); }) - .on('error', (err) => { + .on("error", (err) => { reject(err); }); }); @@ -93,42 +34,43 @@ const readBlocksFromCSV = async (filePath: string): Promise => { return blocks; }; -readBlocksFromCSV('hourly_blocks.csv').then(async (blocks: BlockData[]) => { - console.log(blocks); - const allCsvRows: any[] = []; // Array to accumulate CSV rows for all blocks - const batchSize = 1000; // Size of batch to trigger writing to the file - let i = 0; - - for (const block of blocks) { - try { - const resultTvl = await getUserTVLByBlock(block); - for (let i = 0; i < resultTvl.length; i++) { - allCsvRows.push(resultTvl[i]) - } - - const resultStake = await getUserStakeByBlock(block); - for (let i = 0; i < resultStake.length; i++) { - allCsvRows.push(resultStake[i]) - } - - const resultLp = await getUserLPByBlock(block); - for (let i = 0; i < resultLp.length; i++) { - allCsvRows.push(resultLp[i]) +readBlocksFromCSV("hourly_blocks.csv") + .then(async (blocks: BlockData[]) => { + console.log(blocks); + const allCsvRows: any[] = []; // Array to accumulate CSV rows for all blocks + const batchSize = 1000; // Size of batch to trigger writing to the file + let i = 0; + + for (const block of blocks) { + try { + // const resultTvl = await getUserTVLByBlock(block); + // for (let i = 0; i < resultTvl.length; i++) { + // allCsvRows.push(resultTvl[i]); + // } + + // const resultStake = await getUserStakeByBlock(block); + // for (let i = 0; i < resultStake.length; i++) { + // allCsvRows.push(resultStake[i]); + // } + + const resultLp = await getUserLPByBlock(block); + for (let i = 0; i < resultLp.length; i++) { + allCsvRows.push(resultLp[i]); + } + } catch (error) { + console.error(`An error occurred for block ${block}:`, error); } - - } catch (error) { - console.error(`An error occurred for block ${block}:`, error); } - } - await new Promise((resolve, reject) => { - const ws = fs.createWriteStream(`outputData.csv`, { flags: 'w' }); - write(allCsvRows, { headers: true }) - .pipe(ws) - .on("finish", () => { - console.log(`CSV file has been written.`); - resolve; - }); + await new Promise((resolve, reject) => { + const ws = fs.createWriteStream(`outputData.csv`, { flags: "w" }); + write(allCsvRows, { headers: true }) + .pipe(ws) + .on("finish", () => { + console.log(`CSV file has been written.`); + resolve; + }); + }); + }) + .catch((err) => { + console.error("Error reading CSV file:", err); }); -}).catch((err) => { - console.error('Error reading CSV file:', err); -}); \ No newline at end of file diff --git a/adapters/zerolend/src/sdk/lp.ts b/adapters/zerolend/src/sdk/lp.ts index 0426a3ff..1ecc005a 100644 --- a/adapters/zerolend/src/sdk/lp.ts +++ b/adapters/zerolend/src/sdk/lp.ts @@ -1,61 +1,63 @@ -import { BlockData, IOmniStakingData, IOmniStakingResponse, ITVLResponse, OutputDataSchemaRow } from "./types"; +import { + BlockData, + IOmniStakingData, + IOmniStakingResponse, + OutputDataSchemaRow, +} from "./types"; const queryURL = - "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; + "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; -const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7" //do we need to convert the case - -const symbol = "ZERO" +const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"; //do we need to convert the case +const symbol = "ZERO"; export const getUserLPByBlock = async ( - blocks: BlockData + blocks: BlockData ): Promise => { - const timestamp = blocks.blockTimestamp; - const first = 1000; - const rows: OutputDataSchemaRow[] = []; - - let lastAddress = "0x0000000000000000000000000000000000000000"; - - do { - const query = `{ - tokenBalances( - where: {id_gt: "${lastAddress}", balance_omni_lp_gt: "0"} - first: ${first} - ) { - id - balance_omni_lp - } + const timestamp = blocks.blockTimestamp; + const first = 1000; + const rows: OutputDataSchemaRow[] = []; + + let lastAddress = "0x0000000000000000000000000000000000000000"; + + do { + const query = `{ + tokenBalances( + where: {id_gt: "${lastAddress}", balance_omni_lp_gt: "0"} + first: ${first} + ) { + id + balance_omni_lp + } }`; - const response = await fetch(queryURL, { - method: "POST", - body: JSON.stringify({ query }), - headers: { "Content-Type": "application/json" }, - }); - const batch: IOmniStakingResponse = await response.json(); - - if (!batch.data || batch.data.tokenBalances.length == 0) break; - - batch.data.tokenBalances.forEach((data: IOmniStakingData) => { - - rows.push({ - block_number: blocks.blockNumber, - timestamp, - user_address: data.id, - token_address: tokenAddress, - token_balance: Number(data.balance_omni_lp), - token_symbol: symbol, - usd_price: 0, - }); - - lastAddress = data.id; - }); - - console.log( - `Processed ${rows.length} rows. Last address is ${lastAddress}` - ); - } while (true); - - return rows; + const response = await fetch(queryURL, { + method: "POST", + body: JSON.stringify({ query }), + headers: { "Content-Type": "application/json" }, + }); + const batch: IOmniStakingResponse = await response.json(); + + if (!batch.data || batch.data.tokenBalances.length == 0) break; + + batch.data.tokenBalances.forEach((data: IOmniStakingData) => { + rows.push({ + block_number: blocks.blockNumber, + timestamp, + user_address: data.id, + token_address: tokenAddress, + token_balance: Number(data.balance_omni_lp), + token_symbol: symbol, + usd_price: 0, + }); + + lastAddress = data.id; + }); + + console.log( + `Processed ${rows.length} rows. Last address is ${lastAddress}` + ); + } while (true); + + return rows; }; - diff --git a/adapters/zerolend/src/sdk/stake.ts b/adapters/zerolend/src/sdk/stake.ts index 3b5722b8..14fd12f9 100644 --- a/adapters/zerolend/src/sdk/stake.ts +++ b/adapters/zerolend/src/sdk/stake.ts @@ -1,24 +1,28 @@ -import { BlockData, IOmniStakingData, IOmniStakingResponse, ITVLResponse, OutputDataSchemaRow } from "./types"; - +import { + BlockData, + IOmniStakingData, + IOmniStakingResponse, + ITVLResponse, + OutputDataSchemaRow, +} from "./types"; const queryURL = - "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; - -const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7" //do we need to convert the case + "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; -const symbol = "ZERO" +const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"; //do we need to convert the case +const symbol = "ZERO"; export const getUserStakeByBlock = async ( - blocks: BlockData + blocks: BlockData ): Promise => { - const timestamp = blocks.blockTimestamp; - const first = 1000; - const rows: OutputDataSchemaRow[] = []; + const timestamp = blocks.blockTimestamp; + const first = 1000; + const rows: OutputDataSchemaRow[] = []; - let lastAddress = "0x0000000000000000000000000000000000000000"; + let lastAddress = "0x0000000000000000000000000000000000000000"; - do { - const query = `{ + do { + const query = `{ tokenBalances( where: {id_gt: "${lastAddress}", balance_omni_gt: "0"} first: ${first} @@ -28,35 +32,33 @@ export const getUserStakeByBlock = async ( } }`; - const response = await fetch(queryURL, { - method: "POST", - body: JSON.stringify({ query }), - headers: { "Content-Type": "application/json" }, - }); - const batch: IOmniStakingResponse = await response.json(); + const response = await fetch(queryURL, { + method: "POST", + body: JSON.stringify({ query }), + headers: { "Content-Type": "application/json" }, + }); + const batch: IOmniStakingResponse = await response.json(); - if (!batch.data || batch.data.tokenBalances.length == 0) break; + if (!batch.data || batch.data.tokenBalances.length == 0) break; - batch.data.tokenBalances.forEach((data: IOmniStakingData) => { + batch.data.tokenBalances.forEach((data: IOmniStakingData) => { + rows.push({ + block_number: blocks.blockNumber, + timestamp, + user_address: data.id, + token_address: tokenAddress, + token_balance: Number(data.balance_omni), + token_symbol: symbol, + usd_price: 0, + }); - rows.push({ - block_number: blocks.blockNumber, - timestamp, - user_address: data.id, - token_address: tokenAddress, - token_balance: Number(data.balance_omni), - token_symbol: symbol, - usd_price: 0, - }); + lastAddress = data.id; + }); - lastAddress = data.id; - }); + console.log( + `Processed ${rows.length} rows. Last address is ${lastAddress}` + ); + } while (true); - console.log( - `Processed ${rows.length} rows. Last address is ${lastAddress}` - ); - } while (true); - - return rows; + return rows; }; - diff --git a/adapters/zerolend/src/sdk/tvl.ts b/adapters/zerolend/src/sdk/tvl.ts index 015ba549..23e6af1d 100644 --- a/adapters/zerolend/src/sdk/tvl.ts +++ b/adapters/zerolend/src/sdk/tvl.ts @@ -1,5 +1,9 @@ -import { BlockData, ITVLData, ITVLResponse, OutputDataSchemaRow } from "./types"; - +import { + BlockData, + ITVLData, + ITVLResponse, + OutputDataSchemaRow, +} from "./types"; const queryURL = "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-linea/1.0.0/gn"; diff --git a/adapters/zerolend/src/sdk/types.ts b/adapters/zerolend/src/sdk/types.ts index 76dfdfe1..bf492107 100644 --- a/adapters/zerolend/src/sdk/types.ts +++ b/adapters/zerolend/src/sdk/types.ts @@ -1,47 +1,46 @@ export interface IOmniStakingResponse { - data: { - tokenBalances: IOmniStakingData[]; - }; + data: { + tokenBalances: IOmniStakingData[]; + }; } export interface IOmniStakingData { - id: string, - balance_omni: string - balance_omni_lp: string - + id: string; + balance_omni: string; + balance_omni_lp: string; } export type OutputDataSchemaRow = { - block_number: number; - timestamp: number; - user_address: string; - token_address: string; - token_balance: number; - token_symbol: string; - usd_price: number; + block_number: number; + timestamp: number; + user_address: string; + token_address: string; + token_balance: number; + token_symbol: string; + usd_price: number; }; export interface BlockData { - blockNumber: number; - blockTimestamp: number; + blockNumber: number; + blockTimestamp: number; } export interface ITVLResponse { - data: { - userReserves: ITVLData[]; - }; + data: { + userReserves: ITVLData[]; + }; } export interface ITVLData { - user: { - id: string; - }; - currentTotalDebt: string; - currentATokenBalance: string; - reserve: { - underlyingAsset: string; - symbol: string; - name: string; - }; - liquidityRate: "0"; -} \ No newline at end of file + user: { + id: string; + }; + currentTotalDebt: string; + currentATokenBalance: string; + reserve: { + underlyingAsset: string; + symbol: string; + name: string; + }; + liquidityRate: "0"; +} From 916ba80dc69288c2755dfe6b5a2169266aa4da0c Mon Sep 17 00:00:00 2001 From: Deadshot Ryker Date: Sat, 3 Aug 2024 17:25:47 +0400 Subject: [PATCH 3/3] changed zero address to lowercase --- adapters/zerolend/src/sdk/lp.ts | 2 +- adapters/zerolend/src/sdk/stake.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adapters/zerolend/src/sdk/lp.ts b/adapters/zerolend/src/sdk/lp.ts index 1ecc005a..2427a060 100644 --- a/adapters/zerolend/src/sdk/lp.ts +++ b/adapters/zerolend/src/sdk/lp.ts @@ -8,7 +8,7 @@ import { const queryURL = "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; -const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"; //do we need to convert the case +const tokenAddress = "0x78354f8dccb269a615a7e0a24f9b0718fdc3c7a7"; //do we need to convert the case const symbol = "ZERO"; export const getUserLPByBlock = async ( diff --git a/adapters/zerolend/src/sdk/stake.ts b/adapters/zerolend/src/sdk/stake.ts index 14fd12f9..d11c128a 100644 --- a/adapters/zerolend/src/sdk/stake.ts +++ b/adapters/zerolend/src/sdk/stake.ts @@ -9,7 +9,7 @@ import { const queryURL = "https://api.goldsky.com/api/public/project_clsk1wzatdsls01wchl2e4n0y/subgraphs/zerolend-omnistaking/1.0.2/gn"; -const tokenAddress = "0x78354f8DcCB269a615A7e0a24f9B0718FDC3C7A7"; //do we need to convert the case +const tokenAddress = "0x78354f8dccb269a615a7e0a24f9b0718fdc3c7a7"; //do we need to convert the case const symbol = "ZERO"; export const getUserStakeByBlock = async (