order sanity checks

This commit is contained in:
tim
2025-03-16 21:15:00 -04:00
parent b9975cda10
commit 5876efe29f
11 changed files with 130 additions and 33 deletions

View File

@@ -37,7 +37,14 @@ const slippage = computed({
})
function buildTranches() {
return [newTranche({slippage: slippage.value/100})]
let warnings = []
if (slippage.value < 0.01)
warnings.push('Slippage will be set to the minimum of 0.01%')
const slip = Math.min(slippage.value, 0.01)
return {
tranches: [newTranche({slippage: slip / 100})],
warnings,
}
}
onMounted(() => builderFuncs[props.builder.id] = buildTranches)