Skip to content

Commit

Permalink
Merge pull request #84 from matt5346/overnight-rebase
Browse files Browse the repository at this point in the history
Overnight scheme fix
  • Loading branch information
nitish-91 authored Apr 30, 2024
2 parents 29970b8 + 9b12712 commit b29cd0e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions adapters/overnight/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ 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: string;
token_balance: bigint;
token_symbol: string;
usd_price?: number;
}

const getData = async () => {
Expand All @@ -39,9 +40,10 @@ const getData = async () => {
user_address: key,
token_address: LP_LYNEX,
token_symbol: LP_LYNEX_SYMBOL,
token_balance: lpValueStr,
block_number: block.toString(),
timestamp
token_balance: BigInt(lpValueStr),
block_number: block,
timestamp: Number(timestamp),
usd_price: 0
});
})
});
Expand Down Expand Up @@ -73,20 +75,22 @@ 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
block_number: block,
timestamp: Number(timestamp),
usd_price: 0
});
});
positionsRebaseUsdt.forEach((value, key) => {
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
block_number: block,
timestamp: Number(timestamp),
usd_price: 0
});
});
}
Expand Down

0 comments on commit b29cd0e

Please sign in to comment.