Skip to content

Commit 64d2cbe

Browse files
committed
liquidity: respect feeppm if set for easyautoloop
1 parent 319a519 commit 64d2cbe

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

liquidity/liquidity.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,21 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
600600
return err
601601
}
602602

603-
// Override our current parameters in order to use the const percent
604-
// limit of easy-autoloop.
603+
// If no fee is set, override our current parameters in order to use the
604+
// default percent limit of easy-autoloop.
605605
easyParams := m.params
606-
easyParams.FeeLimit = &FeePortion{
607-
PartsPerMillion: defaultFeePPM,
606+
607+
switch feeLimit := easyParams.FeeLimit.(type) {
608+
case *FeePortion:
609+
if feeLimit.PartsPerMillion == 0 {
610+
feeLimit = &FeePortion{
611+
PartsPerMillion: defaultFeePPM,
612+
}
613+
}
614+
default:
615+
feeLimit = &FeePortion{
616+
PartsPerMillion: defaultFeePPM,
617+
}
608618
}
609619

610620
// Set the swap outgoing channel to the chosen channel.

0 commit comments

Comments
 (0)