Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish to prod #1495

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading