Skip to content

Commit

Permalink
Disable price calc
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpolman committed Jun 26, 2024
1 parent 1ca33fd commit f00850e
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions apps/api/src/app/services/BalancerService.ts
Original file line number Diff line number Diff line change
@@ -99,23 +99,26 @@ class BalancerService {
}

async updatePricesJob() {
const pool = await this.balancer.pools.find(BALANCER_POOL_ID);
const [usdc, thx] = pool.tokens as unknown as {
symbol: string;
balance: number;
token: { latestUSDPrice: number };
}[];
const totalShares = pool.totalShares as unknown as number;
const thxValue = thx.balance * thx.token.latestUSDPrice;
const usdcValue = usdc.balance * usdc.token.latestUSDPrice;
const btpPrice = (thxValue + usdcValue) / totalShares;
// const pool = await this.balancer.pools.find(BALANCER_POOL_ID);
// const [usdc, thx] = pool.tokens as unknown as {
// symbol: string;
// balance: number;
// token: { latestUSDPrice: number };
// }[];
// const totalShares = pool.totalShares as unknown as number;
// const thxValue = thx.balance * thx.token.latestUSDPrice;
// const usdcValue = usdc.balance * usdc.token.latestUSDPrice;
// const btpPrice = (thxValue + usdcValue) / totalShares;
const balPrice = await this.fetchPrice('BAL', 'USDC');

this.pricing = {
'20USDC-80THX': btpPrice,
'BAL': Number(balPrice),
'USDC': Number(usdc.token.latestUSDPrice),
'THX': Number(thx.token.latestUSDPrice),
'20USDC-80THX': 0,
'USDC': 0,
'THX': 0,
// '20USDC-80THX': btpPrice,
// 'USDC': Number(usdc.token.latestUSDPrice),
// 'THX': Number(thx.token.latestUSDPrice),
};
}

0 comments on commit f00850e

Please sign in to comment.