Skip to content

Commit

Permalink
fix: remove hardcoded max trade size
Browse files Browse the repository at this point in the history
  • Loading branch information
nvtaveras committed Apr 25, 2024
1 parent f19eba5 commit f77af81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions src/config/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export const SIGN_OPERATION_TIMEOUT = 90000 // 90 seconds
export const STALE_TOKEN_PRICE_TIME = 900000 // 15 minutes
export const MAX_TOKEN_PRICE_NUM_DAYS = 14 // 14 days

export const MAX_EXCHANGE_TOKEN_SIZE = '100000000000000000000000' // 100,000 Tokens

export const MAX_FEE_SIZE = '1000000000000000000' // 1 Token
export const MAX_GAS_PRICE = '5000000000' // 5 Gwei
export const MAX_GAS_LIMIT = '10000000' // 10 million
Expand Down
6 changes: 1 addition & 5 deletions src/features/swap/SwapConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import mentoLoaderBlue from 'src/animations/Mentoloader_blue.json'
import mentoLoaderGreen from 'src/animations/Mentoloader_green.json'
import { toastToYourSuccess } from 'src/components/TxSuccessToast'
import { Button3D } from 'src/components/buttons/3DButton'
import { MAX_EXCHANGE_RATE, MAX_EXCHANGE_TOKEN_SIZE, MIN_EXCHANGE_RATE } from 'src/config/consts'
import { MAX_EXCHANGE_RATE, MIN_EXCHANGE_RATE } from 'src/config/consts'
import { TokenId, Tokens } from 'src/config/tokens'
import { useAppDispatch, useAppSelector } from 'src/features/store/hooks'
import { setFormValues } from 'src/features/swap/swapSlice'
Expand Down Expand Up @@ -106,10 +106,6 @@ export function SwapConfirmCard({ formValues }: Props) {

const onSubmit = async () => {
if (!rate || !amountWei || !address || !isConnected) return
if (new BigNumber(amountWei).gt(MAX_EXCHANGE_TOKEN_SIZE)) {
toast.error('Amount exceeds limit')
return
}
const rateBN = new BigNumber(rate)

// ignore eXOF for now until we have a better way to handle it
Expand Down

0 comments on commit f77af81

Please sign in to comment.