Skip to content

Commit

Permalink
Fix/sorting (#855)
Browse files Browse the repository at this point in the history
* fix sorting

* testnet release 2.14.24

* fix sifchain block explorer url
  • Loading branch information
pgoos authored Dec 12, 2023
1 parent 374b0cd commit 1e0d956
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "2.14.23",
"version": "2.14.24",
"private": true,
"scripts": {
"bump": "bump patch --tag --commit 'testnet release '",
Expand Down
4 changes: 2 additions & 2 deletions app/src/views/PoolPage/PoolItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ export default defineComponent({
"flex items-center justify-end font-mono",
]}
>
{isNil(this.$props.poolStat?.poolApr)
{isNil(this.$props.poolStat?.rewardApr)
? "..."
: `${(Number(this.$props.poolStat?.poolApr) ?? 0).toFixed(2)}%`}
: `${(Number(this.$props.poolStat?.rewardApr) ?? 0).toFixed(2)}%`}
</div>
<div
class={[
Expand Down
12 changes: 9 additions & 3 deletions app/src/views/PoolPage/PoolPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineComponent({
name: "PoolsPage",
data() {
return {
sortBy: "rowanApr" as PoolPageColumnId,
sortBy: "pairedApr" as PoolPageColumnId,
sortReverse: false,
searchQuery: "",
showSmallPools: true,
Expand Down Expand Up @@ -119,14 +119,20 @@ export default defineComponent({
const bAsset = b.pool.externalAmount?.asset.displaySymbol;
return aAsset.localeCompare(bAsset);
}
case "rewardApr":
case "rowanApr":
return (
Number(b.poolStat?.rewardApr) - Number(a.poolStat?.rewardApr)
);
case "pairedApr":
return (
Number(b.poolStat?.pairedApr) - Number(a.poolStat?.pairedApr)
);
case "poolTvl":
return Number(b.poolStat?.poolTVL) - Number(a.poolStat?.poolTVL);
default:
return Number(b.poolStat?.poolApr) - Number(a.poolStat?.poolApr);
return (
Number(b.poolStat?.rewardApr) - Number(a.poolStat?.rewardApr)
);
}
})
// Then sort by balance
Expand Down
1 change: 0 additions & 1 deletion app/src/views/PoolPage/usePoolPageData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export type PoolPageColumnId =
| "pairedApr"
// | "marginapy"
| "gainLoss"
| "rewardApr"
| "poolTvl"
| "userShare"
| "userValue";
Expand Down
6 changes: 3 additions & 3 deletions app/src/views/StatsPage/StatsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineComponent({
props: {},
setup() {
const { res, statsRef, state } = useStatsPageData({
sortBy: "rewardApr",
sortBy: "pairedApr",
sortDirection: "desc",
} as StatsPageState);

Expand Down Expand Up @@ -183,7 +183,7 @@ export default defineComponent({
class="h-[12px] w-[12px] transition-all"
style={{
transform:
state.sortDirection === "asc"
state.sortDirection === "desc"
? "rotate(0deg)"
: "rotate(180deg)",
}}
Expand Down Expand Up @@ -270,7 +270,7 @@ export default defineComponent({
${prettyNumber(item.volume)}
</td>
<td class="text-mono text-right align-middle">
{item.poolApr}%
{item.rewardApr}%
</td>
<td class="text-mono text-right align-middle">
{item.pairedApr}%
Expand Down
4 changes: 1 addition & 3 deletions app/src/views/StatsPage/useStatsPageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export type StatsPageState = {
| "tvl"
| "volume"
| "arbitrage"
| "poolApr"
| "rowanApr"
| "pairedApr"
| "marginApr";
Expand Down Expand Up @@ -44,9 +43,8 @@ export function useStatsPageData(initialState: StatsPageState) {
tvl: pool.poolTVL,
volume: pool.volume ?? 0,
arbitrage: pool.arb == null ? null : pool.arb ?? 0,
poolApr: Number(pool.poolApr).toFixed(2),
pairedApr: Number(pool.pairedApr).toFixed(1),
rewardApr: pool.rewardApr,
rewardApr: Number(pool.rewardApr).toFixed(2),
marginApr: pool.margin_apr,
};

Expand Down
2 changes: 1 addition & 1 deletion core/src/clients/chains/SifchainChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BaseChain } from "./_BaseChain";

export class SifchainChain extends BaseChain implements Chain {
getBlockExplorerUrlForTxHash(hash: string) {
return urlJoin(this.chainConfig.blockExplorerUrl, "txs", hash);
return urlJoin(this.chainConfig.blockExplorerUrl, "tx", hash);
}
getBlockExplorerUrlForAddress(hash: string) {
return urlJoin(this.chainConfig.blockExplorerUrl, "account", hash);
Expand Down
2 changes: 1 addition & 1 deletion core/src/config/chains/sifchain/sifchain-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const SIFCHAIN_MAINNET: IBCChainConfig = {
network: Network.SIFCHAIN,
chainType: "ibc",
displayName: "Sifchain",
blockExplorerUrl: "https://www.mintscan.io/sifchain",
blockExplorerUrl: "https://ping.pub/sifchain",
nativeAssetSymbol: "rowan",
chainId: "sifchain-1",
rpcUrl: "https://proxies.sifchain.finance/api/sifchain-1/rpc",
Expand Down

1 comment on commit 1e0d956

@vercel
Copy link

@vercel vercel bot commented on 1e0d956 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sifchain-ui – ./

dex.sifchain.finance
sifchain-ui-sifchain.vercel.app
sifchain-ui-git-master-sifchain.vercel.app

Please sign in to comment.