MarketBuilder slippage fix

This commit is contained in:
tim
2025-03-28 19:59:22 -04:00
parent e86fbfa8e9
commit 7626504480

View File

@@ -36,11 +36,13 @@ const slippage = computed({
set(v) {props.builder.slippage=v/100; emit('update:builder', props.builder)}
})
const MIN_SLIPPAGE = 0.01;
function buildTranches() {
let warnings = []
if (slippage.value < 0.01)
if (slippage.value < MIN_SLIPPAGE)
warnings.push('Slippage will be set to the minimum of 0.01%')
const slip = Math.min(slippage.value, 0.01)
const slip = Math.max(slippage.value, MIN_SLIPPAGE)
return {
tranches: [newTranche({slippage: slip / 100})],
warnings,