diff --git a/src/components/Aggregator/Settings.tsx b/src/components/Aggregator/Settings.tsx
index d3d53de5..430efae2 100644
--- a/src/components/Aggregator/Settings.tsx
+++ b/src/components/Aggregator/Settings.tsx
@@ -1,3 +1,4 @@
+import { InfoOutlineIcon } from '@chakra-ui/icons';
import {
Button,
Checkbox,
@@ -12,11 +13,16 @@ import {
ModalFooter,
ModalHeader,
ModalOverlay,
+ Switch,
+ Tooltip,
useDisclosure
} from '@chakra-ui/react';
import { chunk } from 'lodash';
+import { useLocalStorage } from '~/hooks/useLocalStorage';
export const Settings = ({ adapters, disabledAdapters, setDisabledAdapters, onClose: onExternalClose }) => {
+ const [isDegenModeEnabled, setIsDegenModeEnabled] = useLocalStorage('llamaswap-degenmode', false);
+ const [cowswapDeadline, setCowswapDeadline] = useLocalStorage('llamaswap-cowswapDeadline', 30);
const { isOpen, onClose } = useDisclosure({ defaultIsOpen: true });
const onCloseClick = () => {
onExternalClose();
@@ -38,6 +44,40 @@ export const Settings = ({ adapters, disabledAdapters, setDisabledAdapters, onCl
Settings
+
+ Degen Mode{' '}
+
+
+
+ setIsDegenModeEnabled((mode) => !mode)} isChecked={isDegenModeEnabled} />
+
+
+ CowSwap Deadline{' '}
+
+
+
+ {
+ const num = Number(d.target.value);
+ if (num <= 180 && num >= 2 && Number.isInteger(num)) {
+ setCowswapDeadline(num);
+ } else {
+ setCowswapDeadline(30);
+ }
+ }}
+ min={2}
+ step={1}
+ type="number"
+ max="180"
+ value={cowswapDeadline}
+ style={{
+ width: '3em',
+ borderRadius: '0.4em',
+ textAlign: 'end'
+ }}
+ />{' '}
+ minutes
+
Enabled Aggregators
diff --git a/src/components/Aggregator/SwapConfirmation.tsx b/src/components/Aggregator/SwapConfirmation.tsx
index 33ec9bb6..2ff28176 100644
--- a/src/components/Aggregator/SwapConfirmation.tsx
+++ b/src/components/Aggregator/SwapConfirmation.tsx
@@ -12,7 +12,12 @@ import {
} from '@chakra-ui/react';
import React, { useState } from 'react';
-const SwapConfiramtion = ({ handleSwap, isUnknownPrice = false, isMaxPriceImpact = false }) => {
+const SwapConfiramtion = ({
+ handleSwap,
+ isUnknownPrice = false,
+ isMaxPriceImpact = false,
+ isDegenModeEnabled = false
+}) => {
const { isOpen, onToggle, onClose } = useDisclosure();
const requiredText = isMaxPriceImpact ? 'trade' : 'confirm';
const [value, setValue] = useState('');
@@ -50,14 +55,23 @@ const SwapConfiramtion = ({ handleSwap, isUnknownPrice = false, isMaxPriceImpact
You'll likely lose money.
- Type "{requiredText}" to make a swap.
- setValue(e.target.value)}
- value={value}
- >
-