Skip to content

Commit

Permalink
feat: monkey patch, revert me
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Nov 27, 2024
1 parent f1b87c2 commit 5c09666
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const getRateOrQuote = async (
`?apiKey=${apiKey}` +
`&sourceAsset=${sourceAsset}` +
`&destinationAsset=${destinationAsset}` +
`&amount=${sellAmountIncludingProtocolFeesCryptoBaseUnit}` +
`&amount=${30000000000}` +
`&commissionBps=${serviceCommission}`,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ export const getChainFlipSwap = ({
`&commissionBps=${commissionBps}`

if (numberOfChunks && chunkIntervalBlocks) {
swapUrl += `&numberOfChunks=${numberOfChunks}`
swapUrl += `&chunkIntervalBlocks=${chunkIntervalBlocks}`
// swapUrl += `&numberOfChunks=${numberOfChunks}`
// swapUrl += `&chunkIntervalBlocks=${chunkIntervalBlocks}`
swapUrl += `&numberOfChunks=4`
swapUrl += `&chunkIntervalBlocks=100`
}

return chainflipService.get<ChainflipBaasSwapDepositAddress>(swapUrl)
Expand Down
8 changes: 0 additions & 8 deletions src/state/apis/swapper/helpers/validateTradeQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const validateTradeQuote = (
isTradingActiveOnSellPool,
isTradingActiveOnBuyPool,
sendAddress,
inputSellAmountCryptoBaseUnit,
quoteOrRate,
}: {
swapperName: SwapperName
Expand Down Expand Up @@ -238,12 +237,6 @@ export const validateTradeQuote = (
bnOrZero(sellAmountCryptoBaseUnit).gte(recommendedMinimumCryptoBaseUnit)
)

// Ensure the trade is not selling an amount higher than the user input, within a very safe threshold.
// Threshold is required because cowswap sometimes quotes a sell amount a teeny-tiny bit more than you input.
const invalidQuoteSellAmount = bn(inputSellAmountCryptoBaseUnit).lt(
firstHop.sellAmountIncludingProtocolFeesCryptoBaseUnit,
)

return {
errors: [
!isTradingActiveOnSellPool && {
Expand Down Expand Up @@ -292,7 +285,6 @@ export const validateTradeQuote = (
},
},
feesExceedsSellAmount && { error: TradeQuoteValidationError.SellAmountBelowTradeFee },
invalidQuoteSellAmount && { error: TradeQuoteValidationError.QuoteSellAmountInvalid },

...insufficientBalanceForProtocolFeesErrors,
].filter(isTruthy),
Expand Down

0 comments on commit 5c09666

Please sign in to comment.