Skip to content

Commit

Permalink
[ECO-2245] Bump the processor/broker versions to 0.8.0 and 0.9.0, res…
Browse files Browse the repository at this point in the history
…pectively (#284)

Co-authored-by: alnoki <[email protected]>
  • Loading branch information
xbtmatt and alnoki authored Oct 7, 2024
1 parent e333481 commit d52ae37
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/cloud-formation/deploy-main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
parameters:
BrokerImageVersion: '0.8.0'
BrokerImageVersion: '0.9.0'
DeployAlb: 'true'
DeployAlbDnsRecord: 'true'
DeployBastionHost: 'true'
Expand All @@ -22,7 +22,7 @@ parameters:
EnableWafRulesWebSocket: 'false'
Environment: 'main'
Network: 'testnet'
ProcessorImageVersion: '0.7.0'
ProcessorImageVersion: '0.8.0'
tags: null
template-file-path: 'src/cloud-formation/indexer.cfn.yaml'
...
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// cspell:word unsized
import React from "react";

import { useMatchBreakpoints } from "hooks";

import { Flex, FlexGap } from "@containers";
import { Text, Tr, Td } from "components";

import { type TableRowDesktopProps } from "./types";
import { toCoinDecimalString } from "lib/utils/decimals";

import Popup from "components/popup";
import { Big } from "big.js";
import type { UnsizedDecimalString } from "@sdk/emojicoin_dot_fun";
Expand All @@ -16,7 +13,10 @@ const DAYS_IN_WEEK = 7;
const DAYS_IN_YEAR = 365;

const getXPR = (x: number, tvlPerLpCoinGrowth: UnsizedDecimalString) =>
new Big(tvlPerLpCoinGrowth).pow(x).sub(new Big(1)).mul(new Big(100));
(Big(tvlPerLpCoinGrowth).gte(Big(1)) ? Big(tvlPerLpCoinGrowth) : Big(1))
.pow(x)
.sub(Big(1))
.mul(Big(100));

const formatXPR = (xprIn: Big) => {
const xpr = xprIn.toFixed(4);
Expand Down
18 changes: 6 additions & 12 deletions src/typescript/sdk/src/indexer-v2/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,20 +502,14 @@ export const toLiquidityEventModel = (data: DatabaseJsonType["liquidity_events"]
...GuidGetters.liquidityEvent(data),
});

// Default to 0% DPR. This is to mitigate crashing the entire frontend here if the value of
// `daily_tvl_per_lp_coin_growth` here is `undefined` or "".
// NOTE: Remove the union type and extra check once the new schema is deployed.
// Note that daily TVL defaults to `0` since that's the initial value in the database.
export const toProcessedData = (
data: ProcessedFields & { daily_tvl_per_lp_coin_growth_q64?: string }
) => {
const dailyGrowthWithDefault =
data.daily_tvl_per_lp_coin_growth ?? data.daily_tvl_per_lp_coin_growth_q64 ?? 1;
return {
dailyTvlPerLPCoinGrowth: Big(dailyGrowthWithDefault).toString(),
inBondingCurve: data.in_bonding_curve,
volumeIn1MStateTracker: BigInt(data.volume_in_1m_state_tracker),
};
};
) => ({
dailyTvlPerLPCoinGrowth: Big(data.daily_tvl_per_lp_coin_growth ?? 0).toString(),
inBondingCurve: data.in_bonding_curve,
volumeIn1MStateTracker: BigInt(data.volume_in_1m_state_tracker),
});

export const toMarketLatestStateEventModel = (
data: DatabaseJsonType["market_latest_state_event"]
Expand Down

0 comments on commit d52ae37

Please sign in to comment.