diff --git a/README.md b/README.md index 9b5b77304..942e93ec3 100644 --- a/README.md +++ b/README.md @@ -1557,6 +1557,9 @@ yarn start-demo:dev-frontend This spawns a modified version of dev-frontend that automatically signs transactions so you don't need to interact with a browser wallet. It directly uses the local forked RPC node. +You may need to wait a minute or so for your fork mainnet provider to load and cache all the blockchain state at your chosen block number. Refresh the page after 5 minutes. + + #### Build dev-frontend for production In a freshly cloned & installed monorepo, or if you have only modified code inside the dev-frontend package: diff --git a/packages/dev-frontend/src/components/Bonds/views/managing/WithdrawPane.tsx b/packages/dev-frontend/src/components/Bonds/views/managing/WithdrawPane.tsx index 4e16fb024..f8cbf40f1 100644 --- a/packages/dev-frontend/src/components/Bonds/views/managing/WithdrawPane.tsx +++ b/packages/dev-frontend/src/components/Bonds/views/managing/WithdrawPane.tsx @@ -75,9 +75,10 @@ export const WithdrawPane: React.FC = () => { setOutput(checkOutput(e.target.value)); const handleConfirmPressed = () => { + const curveSlippage = 0.001; // Allow mininum of %0.1% slippage due to Curve rounding issues if (output === "both") { - const minBLusdAmount = withdrawal.get(BLusdAmmTokenIndex.BLUSD); - const minLusdAmount = withdrawal.get(BLusdAmmTokenIndex.LUSD); + const minBLusdAmount = withdrawal.get(BLusdAmmTokenIndex.BLUSD)?.mul(1 - curveSlippage); + const minLusdAmount = withdrawal.get(BLusdAmmTokenIndex.LUSD)?.mul(1 - curveSlippage); if (minBLusdAmount === undefined || minBLusdAmount === Decimal.ZERO) return; if (minLusdAmount === undefined || minLusdAmount === Decimal.ZERO) return; @@ -89,7 +90,7 @@ export const WithdrawPane: React.FC = () => { minLusdAmount }); } else { - const minAmount = withdrawal.get(output); + const minAmount = withdrawal.get(output)?.mul(1 - curveSlippage); if (minAmount === undefined || minAmount === Decimal.ZERO) return; @@ -100,7 +101,7 @@ export const WithdrawPane: React.FC = () => { minAmount }); } - }; + } const handleBackPressed = () => { dispatchEvent("BACK_PRESSED"); @@ -235,4 +236,4 @@ export const WithdrawPane: React.FC = () => { ); -}; +};;