default slippage for DCA's

This commit is contained in:
tim
2024-09-29 21:21:11 -04:00
parent 4228a1dff6
commit dff1a6b635
3 changed files with 9 additions and 8 deletions

View File

@@ -39,7 +39,7 @@
</template>
<script setup>
import {builderDefaults, MIN_EXECUTION_TIME, useChartOrderStore} from "@/orderbuild.js";
import {builderDefaults, DEFAULT_SLIPPAGE, MIN_EXECUTION_TIME, useChartOrderStore} from "@/orderbuild.js";
import {allocationText, VLine} from "@/charts/shape.js";
import {sideColor} from "@/misc.js";
import {useTheme} from "vuetify";
@@ -68,12 +68,12 @@ function computeDefaultColor() {
const defaultColor = computeDefaultColor()
// Fields must be defined in order to be reactive
builderDefaults(props.builder, {
timeA: s.clock, // todo 0
timeA: s.clock, // todo relative 0
timeB: null,
// relative: true,
relative: false, // todo
// relative: true, // todo
relative: false,
slippage: DEFAULT_SLIPPAGE,
rungs: 1,
skew: 0,
color: defaultColor,

View File

@@ -18,7 +18,7 @@
</template>
<script setup>
import {builderDefaults, builderFuncs, useChartOrderStore} from "@/orderbuild.js";
import {builderDefaults, builderFuncs, DEFAULT_SLIPPAGE, useChartOrderStore} from "@/orderbuild.js";
import {computed, onMounted, onUnmounted} from "vue";
import {newTranche} from "@/blockchain/orderlib.js";
@@ -27,7 +27,7 @@ const props = defineProps(['order', 'builder'])
const emit = defineEmits(['update:builder'])
// Fields must be defined in order to be reactive
builderDefaults(props.builder, {valid: true, slippage: 0.0010,})
builderDefaults(props.builder, {valid: true, slippage: DEFAULT_SLIPPAGE,})
// slippage is expressed in % but the underlying builder value is an unadjusted ratio, so we convert by a factor of
// 100 in and out

View File

@@ -8,6 +8,7 @@ import Color from "color";
export const MIN_EXECUTION_TIME = 60 // give at least one full minute for each tranche to trigger
export const DEFAULT_SLIPPAGE = 0.0010;
// Builders are data objects which store a configuration state
@@ -253,4 +254,4 @@ export function weightColors(weights, color) {
export function deleteBuilder(order, builder) {
order.builders = order.builders.filter((b) => b !== builder)
}
} // Fields must be defined in order to be reactive