Skip to content

Commit

Permalink
excluding router buys
Browse files Browse the repository at this point in the history
  • Loading branch information
mrq1911 committed Feb 6, 2024
1 parent 3b93ca1 commit 2293758
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/handlers/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export function notInRouter({siblings}) {

function routeExecutedHandler({event, siblings}) {
const {who} = siblings.find(({method}) => method === 'TransactionFeePaid').data;
if (isBuy({event, siblings})) return;
const {assetIn, assetOut, amountIn, amountOut} = event.data;
return swapHandler({who, assetIn, assetOut, amountIn, amountOut}, emojify(who));
}

const isBuy = ({event, siblings}) => siblings
.slice(0, siblings.indexOf(event))
.reverse()
.find(({method}) => method === 'BuyExecuted');

0 comments on commit 2293758

Please sign in to comment.