Skip to content

Commit

Permalink
feat: change AMMV2 contract && change style
Browse files Browse the repository at this point in the history
  • Loading branch information
junjieit committed Dec 3, 2024
1 parent c0ead38 commit de43259
Show file tree
Hide file tree
Showing 17 changed files with 250 additions and 229 deletions.
4 changes: 2 additions & 2 deletions packages/dodoex-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"peerDependencies": {
"@dodoex/contract-request": "^1.2.0",
"@dodoex/dodo-contract-request": "1.5.0",
"@dodoex/dodo-contract-request": "1.6.0-alpha.2",
"bignumber.js": ">=9",
"lodash": ">=4"
},
Expand Down Expand Up @@ -103,4 +103,4 @@
"ts-jest": "^29.0.1",
"typescript": "^5.6.3"
}
}
}
2 changes: 1 addition & 1 deletion packages/dodoex-api/src/services/pool/PoolApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ export class PoolApi {
);
} else if (type === 'AMMV2') {
const result = await fetchUniswapV2PairFeeRate(chainId, poolAddress);
const feeRate = byWei(result.toString(), 18);
const feeRate = byWei(result.toString(), 4);
lpFeeRate = feeRate.times(0.8);
mtFeeRate = feeRate.times(0.2);
} else {
Expand Down
6 changes: 3 additions & 3 deletions packages/dodoex-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dodoex/widgets",
"version": "3.0.1-taiko.8",
"version": "3.0.1-taiko.9",
"description": "DODO Widgets",
"source": "src/index.tsx",
"types": "dist/types/index.d.ts",
Expand Down Expand Up @@ -61,7 +61,7 @@
"@dodoex/api": "3.0.1-taiko.4",
"@dodoex/components": "3.0.1-taiko.3",
"@dodoex/contract-request": "^1.2.0",
"@dodoex/dodo-contract-request": "1.5.0",
"@dodoex/dodo-contract-request": "1.6.0-alpha.2",
"@dodoex/icons": "^2.0.2",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
Expand Down Expand Up @@ -154,4 +154,4 @@
"ts-jest": "^29.0.1",
"typescript": "^5.6.3"
}
}
}
2 changes: 1 addition & 1 deletion packages/dodoex-widgets/src/hooks/useGraphQLRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { GraphQLRequests } from '@dodoex/api';
import { useUserOptions } from '../components/UserOptionsProvider';

export const graphQLRequestsLocal = new GraphQLRequests({
// url: 'https://api.gcp.dxd.ink/frontend-graphql',
url: 'https://api.gcp.dxd.ink/frontend-graphql',
});

export function useGraphQLRequests() {
Expand Down
80 changes: 40 additions & 40 deletions packages/dodoex-widgets/src/locales/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ msgstr "{0} pending"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:442
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:342
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:702
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:701
msgid "Removing"
msgstr "Removing"

Expand All @@ -90,7 +90,7 @@ msgstr "The start time cannot be in the past"
msgid "Staking Rules"
msgstr "Staking Rules"

#: src/widgets/PoolWidget/PoolOperate/components/OperateBtn.tsx:73
#: src/widgets/PoolWidget/PoolOperate/components/OperateBtn.tsx:76
msgid "Loading info..."
msgstr "Loading info..."

Expand All @@ -111,7 +111,7 @@ msgstr "{tokenB} per {tokenA}"
msgid "Create Liquidity Mining"
msgstr "Create Liquidity Mining"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:315
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:335
#: src/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.tsx:336
msgid "By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity."
msgstr "By adding liquidity you’ll earn <0>{0}</0> of all trades on this pair proportional to your share of the pool. Fees are added to the pool, accrue in real time and can be claimed by withdrawing your liquidity."
Expand Down Expand Up @@ -141,7 +141,7 @@ msgstr "Unstaking"

#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:445
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:345
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:705
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:704
msgid "Adding"
msgstr "Adding"

Expand Down Expand Up @@ -338,7 +338,7 @@ msgstr "Fee includes: Cross Chain fees + Swap fees. Gas fee not included."
#: src/components/SwitchChainDialog/index.tsx:139
#: src/components/WidgetConfirm.tsx:130
#: src/widgets/MiningWidget/MiningCreate/components/StepTitle.tsx:50
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:275
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:256
#: src/widgets/PoolWidget/PoolCreate/components/ConfirmInfoDialog.tsx:199
#: src/widgets/PoolWidget/PoolCreate/operate-widgets/SlippageCoefficientSetting.tsx:240
#: src/widgets/PoolWidget/PoolModify/operate-widgets/BottomButtonGroup.tsx:74
Expand Down Expand Up @@ -431,7 +431,7 @@ msgstr "APR = Reward Token Value per Year / TVL"
msgid "Active"
msgstr "Active"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:75
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:56
msgid "You will receive"
msgstr "You will receive"

Expand Down Expand Up @@ -581,7 +581,7 @@ msgstr "Added successful"
msgid "Add Initial Liquidity"
msgstr "Add Initial Liquidity"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:181
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:201
#: src/widgets/PoolWidget/AMMV3/AddLiquidityV3.tsx:251
#: src/widgets/PoolWidget/AMMV3/AddLiquidityV3.tsx:330
#: src/widgets/PoolWidget/AMMV3/AMMV3PositionManage.tsx:302
Expand All @@ -597,11 +597,11 @@ msgstr "Add liquidity"
msgid "Min price"
msgstr "Min price"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:247
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:228
msgid "Pool address"
msgstr "Pool address"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:216
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:197
#: src/widgets/PoolWidget/AMMV3/components/FeeSelector.tsx:52
#: src/widgets/PoolWidget/AMMV3/components/PositionPreview.tsx:123
msgid "Fee tier"
Expand Down Expand Up @@ -810,8 +810,8 @@ msgstr "End release time before adjustment"
msgid "Stake"
msgstr "Stake"

#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:243
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:560
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:264
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:563
msgid "Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO."
msgstr "Price discrepancy {lqAndDodoCompareText} between liquidity pool and the quote price on DODO."

Expand Down Expand Up @@ -924,7 +924,7 @@ msgstr "Owner"
msgid "The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."
msgstr "The pegged exchange rate refers to the exchange rate between two token assets where one's value is pegged/fixed by the other. For example, the pegged exchange rate between the US Dollar and USDT is 1."

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:250
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:270
#: src/widgets/PoolWidget/AMMV3/AddLiquidityV3.tsx:561
msgid "Deposit amounts"
msgstr "Deposit amounts"
Expand Down Expand Up @@ -991,12 +991,12 @@ msgstr "No LP pools match your criteria"
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:216
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:540
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:256
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:796
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:795
msgid "Fee rate"
msgstr "Fee rate"

#: src/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.ts:25
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:115
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:120
msgid "Add Liquidity"
msgstr "Add Liquidity"

Expand Down Expand Up @@ -1112,7 +1112,7 @@ msgstr "You will also claim all rewards from this pool."
msgid "The creator of the liquidity pool can adjust the liquidity distribution by modifying the market-making price parameters. <0>Learn more</0>"
msgstr "The creator of the liquidity pool can adjust the liquidity distribution by modifying the market-making price parameters. <0>Learn more</0>"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:360
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:380
#: src/widgets/PoolWidget/AMMV3/hooks/useV3DerivedMintInfo.tsx:523
msgid "Invalid pair"
msgstr "Invalid pair"
Expand Down Expand Up @@ -1160,7 +1160,7 @@ msgstr "Single"
msgid "Review Cross Chain"
msgstr "Review Cross Chain"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:243
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:224
#: src/widgets/PoolWidget/AMMV2Create/Ratio.tsx:213
msgid "Share of pool"
msgstr "Share of pool"
Expand All @@ -1187,7 +1187,7 @@ msgstr "Start Time"
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:172
#: src/widgets/PoolWidget/PoolList/AddLiquidity.tsx:588
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:212
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:975
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:847
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOrMiningTabs.ts:20
msgid "Mining"
msgstr "Mining"
Expand Down Expand Up @@ -1268,7 +1268,7 @@ msgstr "Trader"
msgid "Details"
msgstr "Details"

#: src/widgets/PoolWidget/PoolOperate/components/OperateBtn.tsx:66
#: src/widgets/PoolWidget/PoolOperate/components/OperateBtn.tsx:69
msgid "Pending"
msgstr "Pending"

Expand Down Expand Up @@ -1365,20 +1365,20 @@ msgid "You are making changes to the liquidity of a private pool. This is a high
msgstr "You are making changes to the liquidity of a private pool. This is a highly discretionary operation that may cause substantial inflows/outflows of funds and changes in market prices. Please make sure you are fully aware of the implications of each parameter modification."

#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:511
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:606
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:611
msgid "Price Range"
msgstr "Price Range"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:172
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:195
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:153
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:176
msgid "{0} deposited"
msgstr "{0} deposited"

#: src/widgets/PoolWidget/AMMV2Create/MyLiqidity.tsx:64
#: src/widgets/PoolWidget/AMMV3/components/PositionAmountPreview.tsx:222
#: src/widgets/PoolWidget/PoolList/hooks/usePoolListTabs.ts:28
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:448
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:601
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:606
#: src/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.tsx:430
msgid "My Liquidity"
msgstr "My Liquidity"
Expand Down Expand Up @@ -1463,7 +1463,7 @@ msgstr "Price"
msgid "The price of this pool is within your selected range. Your position is currently earning fees."
msgstr "The price of this pool is within your selected range. Your position is currently earning fees."

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:77
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:58
msgid "You are creating a pool"
msgstr "You are creating a pool"

Expand Down Expand Up @@ -1496,8 +1496,8 @@ msgstr "per"
msgid "Suitable for stablecoins with price fluctuations within 10%"
msgstr "Suitable for stablecoins with price fluctuations within 10%"

#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:237
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:554
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:258
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:557
msgid "Confirm submission"
msgstr "Confirm submission"

Expand All @@ -1509,8 +1509,8 @@ msgstr "Select pool by tokens"
msgid "Asset"
msgstr "Asset"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:362
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:100
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:382
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:106
msgid "Supply"
msgstr "Supply"

Expand Down Expand Up @@ -1594,7 +1594,7 @@ msgstr "I have read, understand, and agree to the <0>Terms of Service</0>."
msgid "Modify Confirmation"
msgstr "Modify Confirmation"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:313
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:333
#: src/widgets/PoolWidget/PoolOperate/components/LiquidityInfo.tsx:334
msgid "Tips:"
msgstr "Tips:"
Expand Down Expand Up @@ -1662,7 +1662,7 @@ msgid "Approve {0}"
msgstr "Approve {0}"

#: src/components/Swap/SwapOrderHistory/index.tsx:105
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:222
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:203
msgid "Rate"
msgstr "Rate"

Expand Down Expand Up @@ -1873,7 +1873,7 @@ msgstr "My Staked"
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:268
#: src/widgets/PoolWidget/PoolList/MyCreated.tsx:553
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:1065
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:100
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:106
#: src/widgets/PoolWidget/PoolOperate/hooks/usePoolOperateTabs.ts:15
msgid "Add"
msgstr "Add"
Expand Down Expand Up @@ -1923,7 +1923,7 @@ msgstr "No matching pool found"
msgid "Low"
msgstr "Low"

#: src/widgets/PoolWidget/AMMV2Create/index.tsx:199
#: src/widgets/PoolWidget/AMMV2Create/index.tsx:219
#: src/widgets/PoolWidget/AMMV3/AddLiquidityV3.tsx:366
msgid "Select pair"
msgstr "Select pair"
Expand All @@ -1946,7 +1946,7 @@ msgstr "Do not select non-standard ERC20 tokens as this may lead to unknown erro
msgid "Create Pool"
msgstr "Create Pool"

#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:698
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:697
msgid "Managing"
msgstr "Managing"

Expand Down Expand Up @@ -1985,7 +1985,7 @@ msgstr "Current Market Price:"
msgid "{0}-{1} is not supported. Please select another pair."
msgstr "{0}-{1} is not supported. Please select another pair."

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:273
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:254
msgid "Confirming..."
msgstr "Confirming..."

Expand Down Expand Up @@ -2034,7 +2034,7 @@ msgstr "End Time"
msgid "There is no liquidity data."
msgstr "There is no liquidity data."

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:152
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:133
msgid "Output is estimated. If the price changes by more than {0} your transaction will revert."
msgstr "Output is estimated. If the price changes by more than {0} your transaction will revert."

Expand All @@ -2048,11 +2048,11 @@ msgstr "Detail"
#: src/widgets/PoolWidget/PoolList/components/LoadingCard.tsx:57
#: src/widgets/PoolWidget/PoolList/components/TokenListPoolItem.tsx:102
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:309
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:612
#: src/widgets/PoolWidget/PoolList/MyLiquidity.tsx:602
msgid "APY"
msgstr "APY"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:139
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:120
msgid "AMM V2"
msgstr "AMM V2"

Expand Down Expand Up @@ -2098,7 +2098,7 @@ msgstr "Slippage Coefficient"
msgid "Advanced"
msgstr "Advanced"

#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:125
#: src/widgets/PoolWidget/AMMV2Create/ConfirmDialog.tsx:106
msgid "{0}/{1} Pool Tokens"
msgstr "{0}/{1} Pool Tokens"

Expand Down Expand Up @@ -2203,8 +2203,8 @@ msgstr "Hide"
msgid "In range"
msgstr "In range"

#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:246
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:563
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:267
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:566
msgid "There is risk of being arbitraged if adding this liquidity."
msgstr "There is risk of being arbitraged if adding this liquidity."

Expand Down Expand Up @@ -2337,7 +2337,7 @@ msgstr "Total Rewards=Daily Rewards*Duration"

#: src/components/Swap/index.tsx:766
#: src/components/TokenStatusButton.tsx:18
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:102
#: src/widgets/PoolWidget/PoolOperate/AddPoolOperate.tsx:108
#: src/widgets/PoolWidget/PoolOperate/RemovePoolOperate.tsx:228
msgid "Insufficient balance"
msgstr "Insufficient balance"
Expand Down
Loading

0 comments on commit de43259

Please sign in to comment.