APR
-
@@ -66,6 +68,10 @@ export default {
type: Object,
required: true,
},
+ isFarm: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
diff --git a/src/components/pools/table/poolFarms/PoolFarmsTable.vue b/src/components/pools/table/poolFarms/PoolFarmsTable.vue
index 0f05fa330..ba6dff65b 100644
--- a/src/components/pools/table/poolFarms/PoolFarmsTable.vue
+++ b/src/components/pools/table/poolFarms/PoolFarmsTable.vue
@@ -34,6 +34,7 @@
v-for="(pool, index) in poolsToRender"
:key="index"
:pool="pool"
+ :isFarm="true"
/>
@@ -42,6 +43,7 @@
v-for="(pool, index) in poolsToRender"
:key="index"
:pool="pool"
+ :isFarm="true"
/>
@@ -132,15 +134,15 @@ export default {
},
showDeprecatedButton() {
- const hasDeprecatedPool = this.poolsToRender.some(
- (pool: MagicLPInfo) => pool.settings.isDeprecated
+ const hasDeprecatedPool = this.pools.some(
+ (pool: MagicLPInfo) => pool.settings.isDeprecatedFarm
);
return this.poolsToRender.length && hasDeprecatedPool;
},
deprecatedButtonText() {
- if (this.showActivePools) return " Show Deprecated pools";
- return "Hide Deprecated pools";
+ if (this.showActivePools) return "Show Deprecated Farms";
+ return "Hide Deprecated Farms";
},
},
@@ -191,7 +193,7 @@ export default {
filterByActivepools(pools: MagicLPInfo[]) {
if (this.showActivePools) {
return pools.filter((pool) => {
- return !pool.settings.isDeprecated;
+ return !pool.settings.isDeprecatedFarm;
});
}
@@ -199,7 +201,8 @@ export default {
const settingsA = a?.settings;
const settingsB = b?.settings;
if (settingsA || settingsB) {
- return +settingsA?.isDeprecated - +settingsB?.isDeprecated;
+ // @ts-ignore
+ return +settingsA?.isDeprecatedFarm - +settingsB?.isDeprecatedFarm;
}
return 1;
diff --git a/src/components/pools/table/poolFarms/PoolFarmsTableItem.vue b/src/components/pools/table/poolFarms/PoolFarmsTableItem.vue
index 3345b7414..160420000 100644
--- a/src/components/pools/table/poolFarms/PoolFarmsTableItem.vue
+++ b/src/components/pools/table/poolFarms/PoolFarmsTableItem.vue
@@ -6,7 +6,7 @@
>
{{ poolLabel }}
-
+
${{ tvl }}
@@ -18,7 +18,7 @@
name
v-if="rewardPointsType"
/>
-
@@ -35,7 +36,8 @@
multiplier
v-if="rewardPointsType"
/>
-
{{ poolApr }}
+
{{ poolApr }}
+
-
@@ -53,6 +55,10 @@ export default {
type: Object as PropType
,
required: true,
},
+ isFarm: {
+ type: Boolean,
+ default: false,
+ },
},
computed: {
diff --git a/src/configs/pools/blastPools.ts b/src/configs/pools/blastPools.ts
index ed6887663..b258b5e31 100644
--- a/src/configs/pools/blastPools.ts
+++ b/src/configs/pools/blastPools.ts
@@ -44,6 +44,8 @@ const blastPools: Array = [
isDeprecated: false,
isMim: true,
isPointsLogic: true,
+ isLockAsStake: true,
+ isDeprecatedFarm: true,
},
initialParameters: {
I: 1000000000000000000n,
diff --git a/src/configs/pools/types.ts b/src/configs/pools/types.ts
index f30a27207..281439c2d 100644
--- a/src/configs/pools/types.ts
+++ b/src/configs/pools/types.ts
@@ -27,6 +27,8 @@ export type AdditionalPoolConfig = {
isDeprecated: boolean;
isMim: boolean;
rewardPointsType?: RewardPointsTypes;
+ isLockAsStake?: boolean;
+ isDeprecatedFarm?: boolean;
};
stakeContract?: ContractInfo;
};
@@ -38,6 +40,8 @@ type PoolSettings = {
isMim: boolean;
isPointsLogic?: boolean;
rewardPointsType?: RewardPointsTypes;
+ isLockAsStake?: boolean;
+ isDeprecatedFarm?: boolean;
};
type InitialParameters = {
diff --git a/src/helpers/pools/getPoolInfo.ts b/src/helpers/pools/getPoolInfo.ts
index 1c36f4d05..36b442c71 100644
--- a/src/helpers/pools/getPoolInfo.ts
+++ b/src/helpers/pools/getPoolInfo.ts
@@ -44,8 +44,12 @@ export const getPoolInfo = async (
swapRouter: getSwapRouterByChain(Number(poolChainId)),
};
- if (account && poolConfig.lockContract)
+ if (account && poolConfig.lockContract) {
poolInfo.lockInfo = await getLockInfo(account, poolChainId, poolConfig);
+ poolInfo.stakeInfo = parseLockAsStake(poolInfo.lockInfo);
+ poolInfo.stakeContract = poolConfig.lockContract;
+ }
+
if (poolConfig.stakeContract)
poolInfo.poolAPR = await getPoolApr(poolChainId, poolInfo, tokensPrices);
@@ -204,6 +208,15 @@ export const getStakeInfo = async (
};
};
+export const parseLockAsStake = (lockInfo: any) => {
+ return {
+ balance: lockInfo.balances.unlocked,
+ allowance: lockInfo.allowance,
+ earned: 0,
+ earnedInfo: [],
+ };
+}
+
export const getUserLocks = async (
account: Address,
chainId: number,
diff --git a/src/helpers/pools/swap/magicLp.ts b/src/helpers/pools/swap/magicLp.ts
index 48f599c64..f744e2d9d 100644
--- a/src/helpers/pools/swap/magicLp.ts
+++ b/src/helpers/pools/swap/magicLp.ts
@@ -140,6 +140,25 @@ export const getLpInfo = async (
});
}
+ //
+ if (lp.lockContract?.address) {
+ const lockedSupply = await publicClient.readContract({
+ address: lp.lockContract.address,
+ abi: lp.lockContract.abi as any,
+ functionName: "lockedSupply",
+ args: [],
+ });
+
+ const unlockedSupply = await publicClient.readContract({
+ address: lp.lockContract.address,
+ abi: lp.lockContract.abi as any,
+ functionName: "unlockedSupply",
+ args: [],
+ });
+
+ stakedTotalSupply = lockedSupply + unlockedSupply;
+ }
+
const userInfo = await getUserLpInfo(
lp.contract.address,
getSwapRouterByChain(chainId),
diff --git a/src/views/pool/PoolFarms.vue b/src/views/pool/PoolFarms.vue
index b3369b967..f187a11e8 100644
--- a/src/views/pool/PoolFarms.vue
+++ b/src/views/pool/PoolFarms.vue
@@ -66,7 +66,7 @@ export default {
}),
poolFarmsConfigs() {
- return this.poolConfigs.filter(({ stakeContract }) => stakeContract);
+ return this.poolConfigs.filter(({ stakeContract, lockContract }) => stakeContract || lockContract);
},
},