-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support position manager defiedge vault (#8363)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at bd957dc</samp> ### Summary 🧮🌐🚀 <!-- 1. 🧮 - This emoji represents the use of BigNumber for more precise calculations and the performance improvements of the token ratio query. 2. 🌐 - This emoji represents the support for new chains, such as Ethereum and Arbitrum One, and the localization of the strategy names. 3. 🚀 - This emoji represents the support for new vault managers and strategies, such as RANGE and DEFIEDGE, and the improved UI for the vault cards. --> This pull request adds support for two new third-party vault managers, `RANGE` and `DEFIEDGE`, on the Ethereum and Arbitrum One chains, and improves the UI and logic for displaying and interacting with the vaults. It updates the `position-managers` package with new constants, types, and vault configurations, and the `localization` package with new translations. It also refactors the `PCSVaultCard` and `VaultCards` components to handle different vault managers and strategies, and uses BigNumber for more accurate calculations in the `AddLiquidity` component. > _We're adding new vaults and chains to the code_ > _We're using BigNumber and React Query to lighten the load_ > _We're heaving away on the count of three_ > _We're the finest position managers on the sea_ ### Walkthrough * Rename `PCSVaultCard` component to `ThirdPartyVaultCard` and use BigNumber for ratio calculations ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-55dc4bd66468bf4ad92108e9920f2418ca27b683159f65a6fc435cff8cf3bcdfL1-R19), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-55dc4bd66468bf4ad92108e9920f2418ca27b683159f65a6fc435cff8cf3bcdfL28-R29), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-55dc4bd66468bf4ad92108e9920f2418ca27b683159f65a6fc435cff8cf3bcdfL59-R72)) * Update `VaultCards` component to import and use `ThirdPartyVaultCard` and `isThirdPartyVaultConfig` ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-28a90ac2b30d48c9aaabd08cbfbd4517a167eec04b03d41524eedac25e4e4bceL2-R2), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-28a90ac2b30d48c9aaabd08cbfbd4517a167eec04b03d41524eedac25e4e4bceL15-R15), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-28a90ac2b30d48c9aaabd08cbfbd4517a167eec04b03d41524eedac25e4e4bceL67-R69)) * Modify `AddLiquidity` component to use BigNumber for value changes and add currency decimals as dependencies ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-e2172cb44fb49510cc48b8b246d1ee1e65a184fd8008146c2216d719a5ae5bfbL138-R144)) * Adjust font size and alignment of vault name text in `CardTitle` component ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-e13d3c8b99ea19f9b73d928874e3d7143f17f4999bfcfd11e8d79f65674aa10fL52-R56)) * Add `ACTIVE`, `PASSIVE`, and `PEGGED` strategies to `getStrategyName` function and translations.json file ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-6bfbdfb10e99bf7d75c70a03c8e438ef930522c0b7c95889de1be7693c77a54dR10-R15), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-eb2ab983e2cefc22516cb7814c86346f4b2bd2b971980952868173095d48f459L2835-R2837)) * Add `RANGE` and `DEFIEDGE` managers to `MANAGER` enum and `MANAGERS_CONFIG` object ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-60ad90bd2d936600778ebc9fd0a8c9217b920833b4a9d26ec6053dd52c67dfdeR4-R5), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-60ad90bd2d936600778ebc9fd0a8c9217b920833b4a9d26ec6053dd52c67dfdeR24-R29)) * Add `ETHEREUM` and `ARBITRUM_ONE` chains to `SUPPORTED_CHAIN_IDS` array ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-e349e2e4d8f12a0b7cf06dddf1cf8a7d1ef03071789521e8fe58cb8c5ef1b61eL3-R3)) * Add vault configurations for `RANGE` manager on Ethereum and BSC chains and `DEFIEDGE` manager on Arbitrum One chain ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-a4755333e11111e38a01ff85584a3460c3dc101834572e9d7d895b56f3e62ce8L1-R61), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-c7eafa19538c1186cf38555f3c41f7cf7ef9b781701119dc190ad1a712b7c64aL3), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-c7eafa19538c1186cf38555f3c41f7cf7ef9b781701119dc190ad1a712b7c64aR119-R190), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-89cf6d54f12457c4cd264ae8fa32521b9e6b85de27423dc74c502e6098d00eb7R1-R25)) * Add vaults array for Arbitrum One chain to `VAULTS_CONFIG_BY_CHAIN` object and update `isThirdPartyVaultConfig` and `isPCSVaultConfig` functions ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-32a8dc64ed39e91853f42347e76c4384effe82bece9b6930e4f0306cdab618a6R7), [link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-32a8dc64ed39e91853f42347e76c4384effe82bece9b6930e4f0306cdab618a6L16-R26)) * Add `ACTIVE`, `PASSIVE`, and `PEGGED` strategies to `Strategy` enum ([link](https://github.com/pancakeswap/pancake-frontend/pull/8363/files?diff=unified&w=0#diff-815703f49c5369d61cb9201e297ff5e612d0f3c986fdc1fa1e7e79883a9c15ffR16-R18))
- Loading branch information
Showing
19 changed files
with
206 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ jobs: | |
- name: Set up node@18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: 18 | ||
cache: "pnpm" | ||
node-version: 18.18.2 | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
|
@@ -66,7 +66,7 @@ jobs: | |
uses: chefjackson/[email protected] | ||
if: steps.files.outputs.changed == 'true' | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
use-check: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { ChainId } from '@pancakeswap/chains' | ||
|
||
export const SUPPORTED_CHAIN_IDS = [ChainId.BSC, ChainId.BSC_TESTNET, ChainId.ETHEREUM] as const | ||
export const SUPPORTED_CHAIN_IDS = [ | ||
ChainId.BSC, | ||
ChainId.BSC_TESTNET, | ||
ChainId.ETHEREUM, | ||
ChainId.ARBITRUM_ONE, | ||
ChainId.BASE, | ||
// ChainId.POLYGON_ZKEVM, | ||
ChainId.ZKSYNC, | ||
] as const | ||
|
||
export type SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { arbitrumTokens } from '@pancakeswap/tokens' | ||
import { FeeAmount } from '@pancakeswap/v3-sdk' | ||
import { Strategy, VaultConfig } from '../../types' | ||
import { MANAGER } from '../managers' | ||
|
||
export const vaults: VaultConfig[] = [ | ||
{ | ||
id: 1, | ||
idByManager: 1, | ||
name: 'DEFIEDGE', | ||
address: '0x4fa0c6FC2d0d7b6cDa4215Ff09e8ed444F87dDB3', | ||
adapterAddress: '0xaCAbb974b3c97f8F521634AcaC6ce1D9A1557BFb', | ||
currencyA: arbitrumTokens.weth, | ||
currencyB: arbitrumTokens.arb, | ||
earningToken: arbitrumTokens.cake, | ||
feeTier: FeeAmount.LOW, | ||
strategy: Strategy.ALO, | ||
manager: MANAGER.DEFIEDGE, | ||
isSingleDepositToken: false, | ||
allowDepositToken0: true, | ||
allowDepositToken1: true, | ||
managerInfoUrl: 'https://www.defiedge.io/', | ||
strategyInfoUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
learnMoreAboutUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { baseTokens } from '@pancakeswap/tokens' | ||
import { FeeAmount } from '@pancakeswap/v3-sdk' | ||
import { Strategy, VaultConfig } from '../../types' | ||
import { MANAGER } from '../managers' | ||
|
||
export const vaults: VaultConfig[] = [ | ||
{ | ||
id: 1, | ||
idByManager: 1, | ||
name: 'DEFIEDGE', | ||
address: '0x5fF47dE6F96937eB24d1Ae1A9036b5963418208b', | ||
adapterAddress: '0xFB90a3F1822fa3Da84C984272a6266Cf336A1807', | ||
currencyA: baseTokens.usdc, | ||
currencyB: baseTokens.usdbc, | ||
earningToken: baseTokens.cake, | ||
feeTier: FeeAmount.LOWEST, | ||
strategy: Strategy.ALO, | ||
manager: MANAGER.DEFIEDGE, | ||
isSingleDepositToken: false, | ||
allowDepositToken0: true, | ||
allowDepositToken1: true, | ||
managerInfoUrl: 'https://www.defiedge.io/', | ||
strategyInfoUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
learnMoreAboutUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { VaultConfig } from '../../types' | ||
|
||
export const vaults: VaultConfig[] = [ | ||
// { | ||
// id: 1, | ||
// idByManager: 1, | ||
// name: 'DEFIEDGE', | ||
// address: '0xf018553be929c0B4Bd16360d1FB9c523Ec1F9612', | ||
// adapterAddress: '0x656D34cc7602b08dA12A4C6bA80c9172Dcd8dF6c', | ||
// currencyA: polygonZkEvmTokens.weth, | ||
// currencyB: polygonZkEvmTokens.usdc, | ||
// earningToken: polygonZkEvmTokens.matic, | ||
// feeTier: FeeAmount.LOW, | ||
// strategy: Strategy.ALO, | ||
// manager: MANAGER.DEFIEDGE, | ||
// isSingleDepositToken: false, | ||
// allowDepositToken0: true, | ||
// allowDepositToken1: true, | ||
// managerInfoUrl: 'https://www.defiedge.io/', | ||
// strategyInfoUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
// learnMoreAboutUrl: 'https://docs.defiedge.io/category/strategy-manager', | ||
// }, | ||
] |
Oops, something went wrong.
567d230
There was a problem hiding this comment.
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:
uikit – ./packages/uikit
uikit-git-develop.pancake.run
uikit.pancake.run
567d230
There was a problem hiding this comment.
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:
web – ./apps/web
pancakeswap.finance
web-git-develop.pancake.run
web2.pancake.run
pancake-prod.vercel.app
www.pancakeswap.finance
web.pancake.run