From f35f95bd94861478f909a55f0fae7ec4875416bf Mon Sep 17 00:00:00 2001 From: matveyb Date: Tue, 30 Apr 2024 12:28:48 +0200 Subject: [PATCH 1/3] fix scheme --- adapters/overnight/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/adapters/overnight/src/index.ts b/adapters/overnight/src/index.ts index b0bf3bc7..56298c43 100644 --- a/adapters/overnight/src/index.ts +++ b/adapters/overnight/src/index.ts @@ -14,8 +14,9 @@ interface CSVRow { timestamp: string; user_address: string; token_address: string; - token_balance: string; + token_balance: bigint; token_symbol: string; + usd_price?: number; } const getData = async () => { @@ -39,7 +40,7 @@ const getData = async () => { user_address: key, token_address: LP_LYNEX, token_symbol: LP_LYNEX_SYMBOL, - token_balance: lpValueStr, + token_balance: BigInt(lpValueStr), block_number: block.toString(), timestamp }); @@ -73,7 +74,7 @@ const getData = async () => { csvRows.push({ user_address: key, token_symbol: USD_PLUS_SYMBOL, - token_balance: value, + token_balance: BigInt(value), token_address: USD_PLUS_LINEA, block_number: block.toString(), timestamp @@ -83,7 +84,7 @@ const getData = async () => { csvRows.push({ user_address: key, token_symbol: USDT_PLUS_SYMBOL, - token_balance: value, + token_balance: BigInt(value), token_address: USDT_PLUS_LINEA, block_number: block.toString(), timestamp From 6c5291b01f9c83da3eb5d28fa0c8a27f55989c2e Mon Sep 17 00:00:00 2001 From: matveyb Date: Tue, 30 Apr 2024 12:56:23 +0200 Subject: [PATCH 2/3] fix types --- adapters/overnight/src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/adapters/overnight/src/index.ts b/adapters/overnight/src/index.ts index 56298c43..751a2dba 100644 --- a/adapters/overnight/src/index.ts +++ b/adapters/overnight/src/index.ts @@ -10,8 +10,8 @@ import { write } from 'fast-csv'; import csv from 'csv-parser'; interface CSVRow { - block_number: string; - timestamp: string; + block_number: number; + timestamp: number; user_address: string; token_address: string; token_balance: bigint; @@ -41,8 +41,8 @@ const getData = async () => { token_address: LP_LYNEX, token_symbol: LP_LYNEX_SYMBOL, token_balance: BigInt(lpValueStr), - block_number: block.toString(), - timestamp + block_number: block, + timestamp: Number(timestamp) }); }) }); @@ -76,8 +76,8 @@ const getData = async () => { token_symbol: USD_PLUS_SYMBOL, token_balance: BigInt(value), token_address: USD_PLUS_LINEA, - block_number: block.toString(), - timestamp + block_number: block, + timestamp: Number(timestamp) }); }); positionsRebaseUsdt.forEach((value, key) => { @@ -86,8 +86,8 @@ const getData = async () => { token_symbol: USDT_PLUS_SYMBOL, token_balance: BigInt(value), token_address: USDT_PLUS_LINEA, - block_number: block.toString(), - timestamp + block_number: block, + timestamp: Number(timestamp) }); }); } From 9b127125e537b076d7642cbc45f3c2d84f8ed181 Mon Sep 17 00:00:00 2001 From: matveyb Date: Tue, 30 Apr 2024 12:56:57 +0200 Subject: [PATCH 3/3] 0 usdprice --- adapters/overnight/src/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adapters/overnight/src/index.ts b/adapters/overnight/src/index.ts index 751a2dba..7a3e0726 100644 --- a/adapters/overnight/src/index.ts +++ b/adapters/overnight/src/index.ts @@ -42,7 +42,8 @@ const getData = async () => { token_symbol: LP_LYNEX_SYMBOL, token_balance: BigInt(lpValueStr), block_number: block, - timestamp: Number(timestamp) + timestamp: Number(timestamp), + usd_price: 0 }); }) }); @@ -77,7 +78,8 @@ const getData = async () => { token_balance: BigInt(value), token_address: USD_PLUS_LINEA, block_number: block, - timestamp: Number(timestamp) + timestamp: Number(timestamp), + usd_price: 0 }); }); positionsRebaseUsdt.forEach((value, key) => { @@ -87,7 +89,8 @@ const getData = async () => { token_balance: BigInt(value), token_address: USDT_PLUS_LINEA, block_number: block, - timestamp: Number(timestamp) + timestamp: Number(timestamp), + usd_price: 0 }); }); }