Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
feat(swapper): update default slippage to .2% (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Feb 23, 2023
1 parent 9286cf2 commit fc9eade
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('getLimit', () => {
buyAssetTradeFeeUsd: '6.2049517907881932',
}
const limit = await getLimit(getLimitArgs)
expect(limit).toBe('574407')
expect(limit).toBe('592056')
})

it('should get limit when buy asset is EVM non-fee asset and sell asset is a UTXO', async () => {
Expand All @@ -71,7 +71,7 @@ describe('getLimit', () => {
buyAssetTradeFeeUsd: '6.2049517907881932',
}
const limit = await getLimit(getLimitArgs)
expect(limit).toBe('56613')
expect(limit).toBe('59316')
})

it('should get limit when buy asset is RUNE and sell asset is not', async () => {
Expand All @@ -91,7 +91,7 @@ describe('getLimit', () => {
buyAssetTradeFeeUsd: '0.0318228582',
}
const limit = await getLimit(getLimitArgs)
expect(limit).toBe('2388981500')
expect(limit).toBe('2459464864')
})

it('should get limit when sell asset is RUNE and buy asset is not', async () => {
Expand All @@ -113,6 +113,6 @@ describe('getLimit', () => {
buyAssetTradeFeeUsd: '0.0000000026',
}
const limit = await getLimit(getLimitArgs)
expect(limit).toBe('35991584136')
expect(limit).toBe('37051458730')
})
})
2 changes: 1 addition & 1 deletion packages/swapper/src/swappers/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const APPROVAL_GAS_LIMIT = '100000' // Most approvals are around 40k, we've seen 72k in the wild, so 100000 for safety.
export const DEFAULT_SLIPPAGE = '0.03' // 3%
export const DEFAULT_SLIPPAGE = '0.002' // .2%
export const ALLOWABLE_MARKET_MOVEMENT = '0.01' // 1%

0 comments on commit fc9eade

Please sign in to comment.