diff --git a/src/components/TimedOrderEntry.vue b/src/components/TimedOrderEntry.vue index 5384a8e..3b499b9 100644 --- a/src/components/TimedOrderEntry.vue +++ b/src/components/TimedOrderEntry.vue @@ -260,8 +260,9 @@ async function placeOrder() { } else { window = duration / n } - const ceil = 10n ** 18n % BigInt(n) ? 1n : 0n - const amtPerTranche = 10n ** 18n / BigInt(n) + ceil + const oneHundredPercent = 65535n // by contract definition of uint16 fraction + const ceil = oneHundredPercent % BigInt(n) ? 1n : 0n + const amtPerTranche = oneHundredPercent / BigInt(n) + ceil duration -= 15 // subtract 15 seconds so the last tranche completes before the deadline for (let i = 0; i < n; i++) { const start = Math.floor(i * (duration / n))