Skip to content

Commit

Permalink
Merge pull request #1495 from balancer/v3-canary
Browse files Browse the repository at this point in the history
publish to prod
  • Loading branch information
franzns authored Jan 15, 2025
2 parents 6563761 + 64f33bc commit 4dc84e9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# backend

## 1.28.2

### Patch Changes

- 3b3ba2c: fix liquidity 24hrs ago, fix price for data studio for beets

## 1.28.1

### Patch Changes
Expand Down
7 changes: 0 additions & 7 deletions modules/beets/beets.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { FbeetsService } from './lib/fbeets.service';
import { tokenService } from '../token/token.service';
import { networkContext } from '../network/network-context.service';

export class BeetsService {
constructor(private readonly fBeetsService: FbeetsService) {}
Expand All @@ -12,11 +10,6 @@ export class BeetsService {
public async syncFbeetsRatio(): Promise<void> {
return this.fBeetsService.syncRatio();
}

public async getBeetsPrice(): Promise<string> {
const tokenPrices = await tokenService.getTokenPrices('FANTOM');
return tokenService.getPriceForToken(tokenPrices, networkContext.data.beets!.address, 'FANTOM').toString();
}
}

export const beetsService = new BeetsService(new FbeetsService());
11 changes: 8 additions & 3 deletions modules/datastudio/datastudio.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isComposableStablePool, isWeightedPoolV2 } from '../pool/lib/pool-utils
import { networkContext } from '../network/network-context.service';
import { DeploymentEnv } from '../network/network-config-types';
import { Chain } from '@prisma/client';
import { AllNetworkConfigsKeyedOnChain } from '../network/network-config';

export class DatastudioService {
constructor(private readonly secretsManager: SecretsManager, private readonly jwtClientHelper: GoogleJwtClient) {}
Expand Down Expand Up @@ -240,10 +241,14 @@ export class DatastudioService {
for (const stake of pool.staking) {
const blocksPerDay = await blocksSubgraphService.getBlocksPerDay();
const tokenPrices = await tokenService.getTokenPrices(stake.chain);
const beetsPrice = stake.farm || stake.reliquary ? await beetsService.getBeetsPrice() : '0';
const beetsPrice = tokenService.getPriceForToken(
tokenPrices,
AllNetworkConfigsKeyedOnChain[chain].data.beets!.address,
chain,
);
if (stake.farm) {
const beetsPerDay = parseFloat(stake.farm.beetsPerBlock) * blocksPerDay;
const beetsValuePerDay = parseFloat(beetsPrice) * beetsPerDay;
const beetsValuePerDay = beetsPrice * beetsPerDay;
if (beetsPerDay > 0) {
allEmissionDataRows.push([
endOfYesterday.format('DD MMM YYYY'),
Expand Down Expand Up @@ -287,7 +292,7 @@ export class DatastudioService {
}
if (stake.reliquary) {
const beetsPerDay = parseFloat(stake.reliquary.beetsPerSecond) * secondsPerDay;
const beetsValuePerDay = parseFloat(beetsPrice) * beetsPerDay;
const beetsValuePerDay = beetsPrice * beetsPerDay;
if (beetsPerDay > 0) {
allEmissionDataRows.push([
endOfYesterday.format('DD MMM YYYY'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const getLiquidityAndSharesAtTimestamp = async (
in: tokenAddresses,
},
timestamp: roundedTimestamp,
chain: vaultClient.chain,
},
});

Expand Down
1 change: 1 addition & 0 deletions modules/sources/subgraphs/balancer-v3-vault/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function getVaultSubgraphClient(url: string, chain: Chain) {

return {
...sdk,
chain: chain,
async getMetadata() {
return sdk.Metadata().then((response) => {
if (response && response.meta) {
Expand Down
1 change: 1 addition & 0 deletions modules/subgraphs/balancer-subgraph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function getV2SubgraphClient(url: string, chain: Chain) {

return {
...sdk,
chain: chain,
legacyService,
getMetadata: legacyService.getMetadata.bind(legacyService),
getAllPoolSnapshots: legacyService.getAllPoolSnapshots.bind(legacyService),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "1.28.1",
"version": "1.28.2",
"description": "Backend service for Beethoven X and Balancer",
"repository": "https://github.com/balancer/backend",
"author": "Beethoven X",
Expand Down

0 comments on commit 4dc84e9

Please sign in to comment.