Skip to content

Commit acbdb55

Browse files
chore: dont call swap if source and to tokens are the same
1 parent a2a8e6b commit acbdb55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/core/src/controllers/SwapController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export const SwapController = {
171171
const invalidSourceToken =
172172
!state.sourceToken?.address ||
173173
!state.sourceToken?.decimals ||
174+
state.sourceToken.address === state.toToken?.address ||
174175
!NumberUtil.bigNumber(state.sourceTokenAmount).isGreaterThan(0);
175176
const invalidSourceTokenAmount = !state.sourceTokenAmount;
176177

0 commit comments

Comments
 (0)