Skip to content

Commit

Permalink
Merge pull request #788 from Sifchain/staging
Browse files Browse the repository at this point in the history
[hotfix] 2.12.3
  • Loading branch information
alanrsoares authored Sep 30, 2022
2 parents 016fdf3 + 3421cc1 commit d83304b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 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.12.2",
"version": "2.12.3",
"private": true,
"scripts": {
"bump": "bump patch --tag --commit 'testnet release '",
Expand Down
14 changes: 9 additions & 5 deletions app/src/business/calculators/swapCalculatorPMTP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,16 @@ export function useSwapCalculator(input: {

const { data: liquidityProtectionParams } = useLiquidityProtectionParams();

const currentRowanLiquidityThreshold = computed(() => {
const currentAssetLiquidityThreshold = computed(() => {
const value =
liquidityProtectionParams.value?.rateParams
?.currentRowanLiquidityThreshold;

return AssetAmount("rowan", value ?? "0");
return AssetAmount(
liquidityProtectionParams.value?.params
?.maxRowanLiquidityThresholdAsset ?? "rowan",
value ?? "0",
);
});

// Derive state
Expand Down Expand Up @@ -410,12 +414,12 @@ export function useSwapCalculator(input: {
if (
fromField.value.asset?.symbol === "rowan" &&
fromField.value.fieldAmount.greaterThanOrEqual(
currentRowanLiquidityThreshold.value,
currentAssetLiquidityThreshold.value,
)
) {
if (process.env.NODE_ENV !== "production") {
console.log({
currentRowanLiquidityThreshold: currentRowanLiquidityThreshold.value
currentRowanLiquidityThreshold: currentAssetLiquidityThreshold.value
.toDerived()
.toNumber(),
});
Expand Down Expand Up @@ -453,6 +457,6 @@ export function useSwapCalculator(input: {
swapResult,
reverseSwapResult,
priceRatio,
currentRowanLiquidityThreshold,
currentAssetLiquidityThreshold,
};
}
4 changes: 2 additions & 2 deletions app/src/views/SwapPage/useSwapPageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const useSwapPageData = () => {
providerFee,
minimumReceived,
effectiveMinimumReceived,
currentRowanLiquidityThreshold,
currentAssetLiquidityThreshold,
} = useSwapCalculator({
balances: computed(() => store.wallet.get(Network.SIFCHAIN).balances),
fromAmount,
Expand Down Expand Up @@ -293,7 +293,7 @@ export const useSwapPageData = () => {
});

const formattedCurrentLiquidityThreshold = computed(() =>
currentRowanLiquidityThreshold.value
currentAssetLiquidityThreshold.value
.toDerived()
.toNumber()
.toLocaleString("en", {
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": "sifchain-ui",
"version": "2.12.2",
"version": "2.12.3",
"private": true,
"license": "UNLICENSED",
"packageManager": "[email protected]",
Expand Down

1 comment on commit d83304b

@vercel
Copy link

@vercel vercel bot commented on d83304b Sep 30, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.