From 28b8ebc622a92c7199b5308a998355ba94125092 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Sep 2022 09:50:18 +1200 Subject: [PATCH 01/16] chore: re-enabled margin feature --- app/src/store/modules/flags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/store/modules/flags.ts b/app/src/store/modules/flags.ts index 3fbb86f7a..16fbdddf0 100644 --- a/app/src/store/modules/flags.ts +++ b/app/src/store/modules/flags.ts @@ -66,7 +66,7 @@ export const flagsStore = Vuextra.createStore({ liquidityUnlockCancellation: true, asymmetricPooling: false, lppdRewards: true, - margin: false, + margin: true, remoteFlags: { DISABLE_ETH_BRIDGE: false, }, From 8ae347a863dd9c2f58f1f232821b589ab8067ecc Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Sep 2022 13:53:08 +1200 Subject: [PATCH 02/16] chore: use tokenStatsPMTP endpoint --- app/src/business/services/DataService/DataService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/business/services/DataService/DataService.ts b/app/src/business/services/DataService/DataService.ts index 0c7ec1626..0ba84d53d 100644 --- a/app/src/business/services/DataService/DataService.ts +++ b/app/src/business/services/DataService/DataService.ts @@ -158,7 +158,7 @@ export default class DataService { "tokenStats", () => fetchJSON( - `${this.baseUrl}/beta/asset/tokenStats`, + `${this.baseUrl}/beta/asset/tokenStatsPMTP`, ), 60000 * 5, // cache for 5 minutes ); From bade3c47d7ab9775e3d97ee2916ec1cdd67c6e49 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Sep 2022 13:53:56 +1200 Subject: [PATCH 03/16] refactor: remove proxy lookup as the context is refreshed per request --- app/src/views/PoolPage/PoolItem.tsx | 10 ++++++++++ app/src/views/PoolPage/usePoolPageData.tsx | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/views/PoolPage/PoolItem.tsx b/app/src/views/PoolPage/PoolItem.tsx index a564a45ff..375a5dd08 100644 --- a/app/src/views/PoolPage/PoolItem.tsx +++ b/app/src/views/PoolPage/PoolItem.tsx @@ -389,6 +389,16 @@ export default defineComponent({
+ {!isNil(this.$props.poolStat?.rewardApr) + ? `${(this.$props.poolStat?.rewardApr ?? 0).toFixed(2)}%` + : "..."} +
+
{!isNil(this.$props.poolStat?.poolApr) ? `${(this.$props.poolStat?.poolApr ?? 0).toFixed(2)}%` diff --git a/app/src/views/PoolPage/usePoolPageData.tsx b/app/src/views/PoolPage/usePoolPageData.tsx index 0bada30ee..df8e5f65b 100644 --- a/app/src/views/PoolPage/usePoolPageData.tsx +++ b/app/src/views/PoolPage/usePoolPageData.tsx @@ -29,6 +29,7 @@ export type PoolPageData = ReturnType; export type PoolPageColumnId = | "token" | "apy" + | "marginapy" | "gainLoss" | "rewardApr" | "poolTvl" @@ -69,7 +70,7 @@ export const COLUMNS: PoolPageColumn[] = [ }, { id: "apy", - name: "Pool APR", + name: "Reward APR", class: "w-[128px] text-right justify-end", sortable: true, help: ( @@ -80,6 +81,13 @@ export const COLUMNS: PoolPageColumn[] = [ ), }, + { + id: "marginapy", + name: "Margin APR", + class: "w-[128px] text-right justify-end", + sortable: true, + help: TBD, + }, { id: "userShare", name: "Your Pool Share", From c819eb6f76ed774518878e51c76a9e81545adad1 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Sep 2022 13:59:05 +1200 Subject: [PATCH 04/16] feat: add Charts nav menu item --- app/src/assets/icons/navigation/charts.svg | 4 ++++ app/src/components/AssetIcon.tsx | 1 + app/src/components/NavSidePanel/NavSidePanel.tsx | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 app/src/assets/icons/navigation/charts.svg diff --git a/app/src/assets/icons/navigation/charts.svg b/app/src/assets/icons/navigation/charts.svg new file mode 100644 index 000000000..4b1c25a22 --- /dev/null +++ b/app/src/assets/icons/navigation/charts.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/components/AssetIcon.tsx b/app/src/components/AssetIcon.tsx index 3199172e0..55362fd82 100644 --- a/app/src/components/AssetIcon.tsx +++ b/app/src/components/AssetIcon.tsx @@ -62,6 +62,7 @@ export type NavIconName = | "balances" | "dashboard" | "changelog" + | "charts" | "documents" | "more" | "pool" diff --git a/app/src/components/NavSidePanel/NavSidePanel.tsx b/app/src/components/NavSidePanel/NavSidePanel.tsx index ed4f5655b..af895464f 100644 --- a/app/src/components/NavSidePanel/NavSidePanel.tsx +++ b/app/src/components/NavSidePanel/NavSidePanel.tsx @@ -157,6 +157,11 @@ export default defineComponent({ icon="navigation/stake" href="https://wallet.keplr.app/#/sifchain/stake" /> + { From 40febdaad27e56af47898f90b15c5cd273064f0b Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Sep 2022 14:55:38 +1200 Subject: [PATCH 05/16] chore: update margin_apr field --- app/src/hooks/usePoolStats.ts | 1 + app/src/views/PoolPage/PoolItem.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/hooks/usePoolStats.ts b/app/src/hooks/usePoolStats.ts index 28cf7a7c8..edd20210c 100644 --- a/app/src/hooks/usePoolStats.ts +++ b/app/src/hooks/usePoolStats.ts @@ -34,6 +34,7 @@ export interface PoolStat { tradingApr: number; rewardApr: number; poolApr: number; + margin_apr: number; } export interface Headers { diff --git a/app/src/views/PoolPage/PoolItem.tsx b/app/src/views/PoolPage/PoolItem.tsx index 375a5dd08..c16b15c85 100644 --- a/app/src/views/PoolPage/PoolItem.tsx +++ b/app/src/views/PoolPage/PoolItem.tsx @@ -400,8 +400,8 @@ export default defineComponent({ "flex items-center font-mono", ]} > - {!isNil(this.$props.poolStat?.poolApr) - ? `${(this.$props.poolStat?.poolApr ?? 0).toFixed(2)}%` + {!isNil(this.$props.poolStat?.margin_apr) + ? `${(this.$props.poolStat?.margin_apr ?? 0).toFixed(2)}%` : "..."}
Date: Wed, 14 Sep 2022 21:45:43 +1200 Subject: [PATCH 06/16] fix: handle tokenStatsPMTP breaking changes --- .../services/DataService/DataService.ts | 1 + app/src/hooks/usePoolStats.ts | 44 +++++++++++++------ app/src/views/PoolPage/PoolItem.tsx | 6 +-- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/app/src/business/services/DataService/DataService.ts b/app/src/business/services/DataService/DataService.ts index 0ba84d53d..638e57e83 100644 --- a/app/src/business/services/DataService/DataService.ts +++ b/app/src/business/services/DataService/DataService.ts @@ -162,6 +162,7 @@ export default class DataService { ), 60000 * 5, // cache for 5 minutes ); + return res; } catch (error) { return {} as PoolStatsResponseData; diff --git a/app/src/hooks/usePoolStats.ts b/app/src/hooks/usePoolStats.ts index edd20210c..ad9e9ac63 100644 --- a/app/src/hooks/usePoolStats.ts +++ b/app/src/hooks/usePoolStats.ts @@ -7,34 +7,50 @@ import { useNativeChain } from "./useChains"; import { useCore } from "./useCore"; export interface PoolStatsResponseData { - statusCode: number; - headers: Headers; - body: Body; -} - -interface Body { liqAPY: string; rowanUSD: string; + last_updated: string; pools: PoolStat[]; } export interface PoolStat { symbol: string; priceToken: number; - rowanUSD: number; poolDepth: number; + rowanUSD: string; poolTVL: number; + rowan_24h_lowest: number; + rowan_24h_highest: number; + rowan_24h_average: number; + rowan_24h_change: number; + volume_24h_lowest: number; + volume_24h_highest: number; + volume_24h_average: number; + volume_24h_change: number; + asset_24h_lowest: number; + asset_24h_highest: number; + asset_24h_average: number; + asset_24h_change: number; + tvl_24h_lowest: string; + tvl_24h_highest: string; + tvl_24h_average: string; + tvl_24h_change: string; volume: number; arb: number; dailySwapFees: number; poolBalance: number; - accruedNumSecsRewards: number; + poolBalanceInRowan: number; + accruedNumBlocksRewards: number; rewardPeriodNativeDistributed: number; - secsPerYear: number; - tradingApr: number; + blocksPerYear: number; rewardApr: number; poolApr: number; margin_apr: number; + margin_apr_data_window: number; + health: string; + nativeCustody: string; + nativeLiability: string; + interestRate: string; } export interface Headers { @@ -72,12 +88,12 @@ export function usePoolStats() { if (!poolStatsQuery.data.value) { return; } - const { body: poolData } = poolStatsQuery.data.value; + const poolData = poolStatsQuery.data.value; const response = { poolData, liqAPY: 0, - rowanUsd: poolData.rowanUSD, + rowanUSD: poolData.rowanUSD, }; return response; @@ -130,7 +146,7 @@ export function usePoolStats() { poolStatLookup[asset.symbol] = { ...poolStat, symbol: asset.symbol, - rowanUSD: parseFloat(poolStatsRes.data.value?.rowanUsd ?? "0"), + rowanUSD: parseFloat(String(poolStatsRes.data.value?.rowanUSD) ?? "0"), }; }); @@ -139,7 +155,7 @@ export function usePoolStats() { // exist, then if poolStats doesn't have data default to empty. const pools = Object.values(store.pools).map((pool) => ({ ...pool, - rowanUSD: poolStatsRes.data.value?.rowanUsd || 0, + rowanUSD: poolStatsRes.data.value?.rowanUSD || 0, })); return pools.map((pool) => { const [, externalAssetAmount] = pool.amounts; diff --git a/app/src/views/PoolPage/PoolItem.tsx b/app/src/views/PoolPage/PoolItem.tsx index c16b15c85..eca51f22c 100644 --- a/app/src/views/PoolPage/PoolItem.tsx +++ b/app/src/views/PoolPage/PoolItem.tsx @@ -390,8 +390,8 @@ export default defineComponent({
- {!isNil(this.$props.poolStat?.rewardApr) - ? `${(this.$props.poolStat?.rewardApr ?? 0).toFixed(2)}%` + {!isNil(this.$props.poolStat?.poolApr) + ? `${(this.$props.poolStat?.poolApr ?? 0).toFixed(2)}%` : "..."}
{!isNil(this.$props.poolStat?.margin_apr) - ? `${(this.$props.poolStat?.margin_apr ?? 0).toFixed(2)}%` + ? `${Number(this.$props.poolStat?.margin_apr ?? 0).toFixed(2)}%` : "..."}
Date: Wed, 14 Sep 2022 21:54:25 +1200 Subject: [PATCH 07/16] fix: correct data type --- app/src/hooks/usePoolStats.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/hooks/usePoolStats.ts b/app/src/hooks/usePoolStats.ts index ad9e9ac63..ce17a321f 100644 --- a/app/src/hooks/usePoolStats.ts +++ b/app/src/hooks/usePoolStats.ts @@ -17,7 +17,7 @@ export interface PoolStat { symbol: string; priceToken: number; poolDepth: number; - rowanUSD: string; + rowanUSD?: number; poolTVL: number; rowan_24h_lowest: number; rowan_24h_highest: number; @@ -146,7 +146,7 @@ export function usePoolStats() { poolStatLookup[asset.symbol] = { ...poolStat, symbol: asset.symbol, - rowanUSD: parseFloat(String(poolStatsRes.data.value?.rowanUSD) ?? "0"), + rowanUSD: parseFloat(poolStatsRes.data.value?.rowanUSD ?? "0"), }; }); From 79d4681f14c55909bc327f82ad437d5a47e41942 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Thu, 15 Sep 2022 11:56:24 +1200 Subject: [PATCH 08/16] feature/factor-in-custody-and-liabilities-for-swaps --- app/src/business/usecases/clp/syncPools.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/business/usecases/clp/syncPools.ts b/app/src/business/usecases/clp/syncPools.ts index 1caa4591b..ade4d032a 100644 --- a/app/src/business/usecases/clp/syncPools.ts +++ b/app/src/business/usecases/clp/syncPools.ts @@ -90,9 +90,17 @@ export function SyncPools( const toNativeAmountDerived = (rawAmount: string) => AssetAmount(nativeAsset, rawAmount).toDerived(); + const nativeAssetBalance = Amount(pool.nativeAssetBalance) + .add(pool.nativeCustody) + .add(pool.nativeLiabilities); + + const externalAssetBalance = Amount(pool.externalAssetBalance) + .add(pool.externalCustody) + .add(pool.externalLiabilities); + return new Pool( - AssetAmount(nativeAsset, pool.nativeAssetBalance), - AssetAmount(asset, pool.externalAssetBalance), + AssetAmount(nativeAsset, nativeAssetBalance), + AssetAmount(asset, externalAssetBalance), { poolUnits: Amount(pool.poolUnits), swapPrices: { From 9ec3d2f23251cd0c2be60a3af28341964fe6c397 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Thu, 15 Sep 2022 12:40:26 +1200 Subject: [PATCH 09/16] fix: tvl & rowan price loading --- app/src/components/NavSidePanel/RowanPrice.tsx | 10 ++++------ app/src/hooks/useRowanPrice.ts | 10 +++++----- app/src/hooks/useTVL.ts | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/components/NavSidePanel/RowanPrice.tsx b/app/src/components/NavSidePanel/RowanPrice.tsx index cd61a0431..237096dfb 100644 --- a/app/src/components/NavSidePanel/RowanPrice.tsx +++ b/app/src/components/NavSidePanel/RowanPrice.tsx @@ -1,14 +1,12 @@ -import { computed, defineComponent } from "vue"; -import { usePoolStats } from "@/hooks/usePoolStats"; +import { defineComponent } from "vue"; +import { useRowanPrice } from "@/hooks/useRowanPrice"; + import NavSidePanelItem from "./NavSidePanelItem"; export default defineComponent({ name: "RowanPrice", setup() { - const poolStats = usePoolStats(); - const rowanPrice = computed(() => { - return poolStats.data.value?.rowanUsd; - }); + const { data: rowanPrice } = useRowanPrice(); return () => ( 0; +} + export const useRowanPrice = (params?: { shouldReload: boolean }) => { const { services } = useCore(); const price = useAsyncDataCached("rowanPrice", async () => { - function isNumeric(s: string): boolean { - return Number(s) - 0 === Number(s) && ("" + s).trim().length > 0; - } - - const { body: stats } = await services.data.getTokenStats(); + const stats = await services.data.getTokenStats(); const rowanPriceInUSDT = stats.rowanUSD ?? ""; if (isNumeric(rowanPriceInUSDT)) { diff --git a/app/src/hooks/useTVL.ts b/app/src/hooks/useTVL.ts index 9edf45c6f..379b702a3 100644 --- a/app/src/hooks/useTVL.ts +++ b/app/src/hooks/useTVL.ts @@ -8,7 +8,7 @@ export function useTVL() { const loadTVL = async () => { const tokenStats = await services.data.getTokenStats(); - const pools = tokenStats.body.pools ?? []; + const pools = tokenStats.pools ?? []; const total = pools.reduce( (acc, { poolTVL, poolDepth }) => From 843a41b5bd7e62acf993ff5292dfd85f98ee90fb Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Thu, 15 Sep 2022 12:52:58 +1200 Subject: [PATCH 10/16] fix: handle invalid denom_traces query, ignoring failed asset --- .../wallets/cosmos/CosmosWalletProvider.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/src/clients/wallets/cosmos/CosmosWalletProvider.ts b/core/src/clients/wallets/cosmos/CosmosWalletProvider.ts index edd4aee2a..d714aab21 100644 --- a/core/src/clients/wallets/cosmos/CosmosWalletProvider.ts +++ b/core/src/clients/wallets/cosmos/CosmosWalletProvider.ts @@ -313,7 +313,25 @@ export abstract class CosmosWalletProvider extends WalletProvider // If it's not in the master list of all denom traces, that list may just be outdated... // Newly minted tokens aren't added to the master list immediately. // @ts-ignore - denomTrace = await this.getDenomTraceCached(chain, coin.denom); + try { + const cachedDenomTrace = await this.getDenomTraceCached( + chain, + coin.denom, + ); + + if (cachedDenomTrace) { + denomTrace = cachedDenomTrace; + } + } catch (error) { + console.log( + "failed to get denom_traces for asset, ignoring balance:", + { + chain: chain.chainConfig.chainId, + denom: coin.denom, + }, + ); + // invalid token, ignore + } } if (!denomTrace) { From 4eaed90fbf35d37934a1ffbc1ccab485b3e390da Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Fri, 16 Sep 2022 14:47:15 +1200 Subject: [PATCH 11/16] chore: update changelog --- app/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index 2669460bc..1c750d68e 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,3 +1,9 @@ +## Release 2022.09.16 + +- Margin trading release +- 3rd party charting integration +- Margin APR’s on Pool and Pool Stats pages + ## Release 2022.09.13 - Remove PMTP rate from sidebar From c5dc44a21db537c5f9ab207548f7801b2e07b4a5 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Fri, 16 Sep 2022 14:47:33 +1200 Subject: [PATCH 12/16] chore: add missing margin apr tooltip --- app/src/views/PoolPage/usePoolPageData.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/views/PoolPage/usePoolPageData.tsx b/app/src/views/PoolPage/usePoolPageData.tsx index df8e5f65b..4379e864d 100644 --- a/app/src/views/PoolPage/usePoolPageData.tsx +++ b/app/src/views/PoolPage/usePoolPageData.tsx @@ -86,7 +86,13 @@ export const COLUMNS: PoolPageColumn[] = [ name: "Margin APR", class: "w-[128px] text-right justify-end", sortable: true, - help: TBD, + help: ( + + Margin APR represents the ratio of interest payments to pool balances + over a given time period. The current time period is set as the previous + 600 blocks (≈ 1 hour) of trading activity. + + ), }, { id: "userShare", From c4da9eb15e80b6f84af4614a66f72520bd7cf7c2 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Fri, 16 Sep 2022 15:20:44 +1200 Subject: [PATCH 13/16] testnet release 2.11.0 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 8ab9f9d72..a591e8bdd 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.10.1", + "version": "2.11.0", "private": true, "scripts": { "bump": "bump patch --tag --commit 'testnet release '", diff --git a/package.json b/package.json index 825caf627..f391bee45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sifchain-ui", - "version": "2.10.1", + "version": "2.11.0", "private": true, "license": "UNLICENSED", "packageManager": "yarn@3.2.0", From 8b9380029cb5e6756d1d236ae6bd696ffff94bf4 Mon Sep 17 00:00:00 2001 From: Eduardo Rabelo Date: Sat, 17 Sep 2022 01:57:42 +1200 Subject: [PATCH 14/16] chore: add margin apr to pool stats --- app/src/views/StatsPage/StatsPage.tsx | 16 ++++++++++++++++ app/src/views/StatsPage/useStatsPageData.ts | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/views/StatsPage/StatsPage.tsx b/app/src/views/StatsPage/StatsPage.tsx index 46c513b7d..0c97d2fda 100644 --- a/app/src/views/StatsPage/StatsPage.tsx +++ b/app/src/views/StatsPage/StatsPage.tsx @@ -72,6 +72,19 @@ export default defineComponent({ ), }, + { + name: "Margin APR", + sortBy: "marginApr", + class: "min-w-[100px] text-right", + ref: ref(), + message: ( + + Margin APR represents the ratio of interest payments to pool + balances over a given time period. The current time period is set as + the previous 600 blocks (≈ 1 hour) of trading activity. + + ), + }, ]; const colStyles = computed(() => { return columns.map((col) => { @@ -247,6 +260,9 @@ export default defineComponent({ {item.poolApr}% + + {item.marginApr}% + ); })} diff --git a/app/src/views/StatsPage/useStatsPageData.ts b/app/src/views/StatsPage/useStatsPageData.ts index 8feca38e9..8f289f3d4 100644 --- a/app/src/views/StatsPage/useStatsPageData.ts +++ b/app/src/views/StatsPage/useStatsPageData.ts @@ -13,7 +13,8 @@ export type StatsPageState = { | "volume" | "arbitrage" | "poolApr" - | "rewardApr"; + | "rewardApr" + | "marginApr"; sortDirection: "asc" | "desc"; }; @@ -44,6 +45,7 @@ export function useStatsPageData(initialState: StatsPageState) { arbitrage: pool.arb == null ? null : pool.arb ?? 0, poolApr: pool.poolApr?.toFixed(1), rewardApr: pool.rewardApr, + marginApr: pool.margin_apr, }; return item; From dcacf8939d47cad9610c753ab229320b2805ac47 Mon Sep 17 00:00:00 2001 From: Eduardo Rabelo Date: Sat, 17 Sep 2022 02:24:23 +1200 Subject: [PATCH 15/16] chore: prettyNumberMinMax for Margin APR in Pool nad Pool Stats pages --- app/src/utils/prettyNumber.ts | 7 +++++++ app/src/views/PoolPage/PoolItem.tsx | 4 ++-- app/src/views/StatsPage/StatsPage.tsx | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/utils/prettyNumber.ts b/app/src/utils/prettyNumber.ts index 95dba624d..c2d4da452 100644 --- a/app/src/utils/prettyNumber.ts +++ b/app/src/utils/prettyNumber.ts @@ -9,3 +9,10 @@ export function prettyNumber(n: number, precision = 2) { // if (fraction) final += "." + fraction; // return final; } + +export function prettyNumberMinMax(n: number, min = 0, max = 4) { + return new Intl.NumberFormat("en-us", { + minimumFractionDigits: min, + maximumFractionDigits: max, + }).format(n); +} diff --git a/app/src/views/PoolPage/PoolItem.tsx b/app/src/views/PoolPage/PoolItem.tsx index eca51f22c..912980c4f 100644 --- a/app/src/views/PoolPage/PoolItem.tsx +++ b/app/src/views/PoolPage/PoolItem.tsx @@ -9,7 +9,7 @@ import { useChains, useNativeChain } from "@/hooks/useChains"; import { PoolStat } from "@/hooks/usePoolStats"; import { useRowanPrice } from "@/hooks/useRowanPrice"; import { isNil, isNilOrWhitespace } from "@/utils/assertion"; -import { prettyNumber } from "@/utils/prettyNumber"; +import { prettyNumber, prettyNumberMinMax } from "@/utils/prettyNumber"; import { AssetAmount, IAssetAmount, Network, Pool } from "@sifchain/sdk"; import { LiquidityProviderData } from "@sifchain/sdk/build/typescript/generated/proto/sifnode/clp/v1/types"; import { computed, defineComponent, PropType } from "vue"; @@ -401,7 +401,7 @@ export default defineComponent({ ]} > {!isNil(this.$props.poolStat?.margin_apr) - ? `${Number(this.$props.poolStat?.margin_apr ?? 0).toFixed(2)}%` + ? `${prettyNumberMinMax(this.$props.poolStat?.margin_apr ?? 0)}%` : "..."}
- {item.marginApr}% + {!isNil(item.marginApr) + ? `${prettyNumberMinMax(item.marginApr ?? 0)}%` + : "..."} ); From c8359e78b87abd3c9af2b575db6c7e4e7d50849c Mon Sep 17 00:00:00 2001 From: Eduardo Rabelo Date: Sat, 17 Sep 2022 02:33:50 +1200 Subject: [PATCH 16/16] chore: add change log --- app/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index 2669460bc..7f53decc9 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,3 +1,9 @@ +## Release 2022.09.17 + +- Margin trading release +- 3rd party charting integration +- Margin APR’s on Pool and Pool Stats pages + ## Release 2022.09.13 - Remove PMTP rate from sidebar