liquidity: respect feeppm if set for easyautoloop

pull/595/head
George Tsagkarelis 11 months ago
parent 319a519309
commit 64d2cbe5d6
No known key found for this signature in database
GPG Key ID: 0807D1013F48208A

@ -600,11 +600,21 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
return err
}
// Override our current parameters in order to use the const percent
// limit of easy-autoloop.
// If no fee is set, override our current parameters in order to use the
// default percent limit of easy-autoloop.
easyParams := m.params
easyParams.FeeLimit = &FeePortion{
PartsPerMillion: defaultFeePPM,
switch feeLimit := easyParams.FeeLimit.(type) {
case *FeePortion:
if feeLimit.PartsPerMillion == 0 {
feeLimit = &FeePortion{
PartsPerMillion: defaultFeePPM,
}
}
default:
feeLimit = &FeePortion{
PartsPerMillion: defaultFeePPM,
}
}
// Set the swap outgoing channel to the chosen channel.

Loading…
Cancel
Save