Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
matt5346 committed Apr 21, 2024
1 parent e7a1a7a commit cbd77e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions adapters/overnight/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CHAINS, PROTOCOLS, SNAPSHOTS_BLOCKS, OVN_CONTRACTS, LP_LYNEX, LP_LYNEX_SYMBOL, USD_PLUS_SYMBOL, USD_PLUS_LINEA, USDT_PLUS_SYMBOL, USDT_PLUS_LINEA } from "./sdk/config";
import { Position, getLPValueByUserAndPoolFromPositions, getPositionsForAddressByPoolAtBlock, getRebaseForUsersByPoolAtBlock, getTimestampAtBlock } from "./sdk/subgraphDetails";
import { getLPValueByUserAndPoolFromPositions, getUserTVLByBlock, getRebaseForUsersByPoolAtBlock, getTimestampAtBlock } from "./sdk/subgraphDetails";

(BigInt.prototype as any).toJSON = function () {
return this.toString();
Expand All @@ -22,7 +22,7 @@ const getData = async () => {
const csvRows_rebase: CSVRow[] = [];

for (let block of SNAPSHOTS_BLOCKS) {
const positions = await getPositionsForAddressByPoolAtBlock(
const positions = await getUserTVLByBlock(
block, "", "", CHAINS.LINEA, PROTOCOLS.OVN
);
console.log("Positions: ", positions.length);
Expand Down
4 changes: 2 additions & 2 deletions adapters/overnight/src/sdk/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export const RPC_URLS = {


export const SNAPSHOTS_BLOCKS = [
2361808, 2761808, 3161808
2361808, 2761808, 3161808, 3461808
];

export const CHUNKS_SPLIT = 100;
export const CHUNKS_SPLIT = 10;
export const LINEA_RPC = "https://lb.drpc.org/ogrpc?network=linea&dkey=AsCWb9aYukugqNphr9pEGw5L893HadYR7ooVbrjxQOzW"
export const LP_LYNEX_SYMBOL = "oLYNX";
export const LP_LYNEX = "0x63349BA5E1F71252eCD56E8F950D1A518B400b60"
Expand Down
5 changes: 3 additions & 2 deletions adapters/overnight/src/sdk/subgraphDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ const countNetRebase = async (
const rebased = balanceDiff.minus(val).plus(userRedeem);

// sometimes rebase can be negative
const rebasedChecked = rebased.gt(0) ? rebased.toFixed() : "0"
// const rebasedChecked = rebased.gt(0) ? rebased.toFixed() : "0"
const rebasedChecked = rebased.toFixed()
usersRebaseProfit.set(key, rebasedChecked);
} catch(e) {
console.log(e)
Expand Down Expand Up @@ -229,7 +230,7 @@ export const getRebaseForUsersByPoolAtBlock = async (
// OVN pools
// 0x58aacbccaec30938cb2bb11653cad726e5c4194a usdc/usd+
// 0xc5f4c5c2077bbbac5a8381cf30ecdf18fde42a91 usdt+/usd+
export const getPositionsForAddressByPoolAtBlock = async (
export const getUserTVLByBlock = async (
blockNumber: number,
address: string,
poolId: string,
Expand Down

0 comments on commit cbd77e2

Please sign in to comment.