default slippage for DCA's
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 {allocationText, VLine} from "@/charts/shape.js";
|
||||||
import {sideColor} from "@/misc.js";
|
import {sideColor} from "@/misc.js";
|
||||||
import {useTheme} from "vuetify";
|
import {useTheme} from "vuetify";
|
||||||
@@ -68,12 +68,12 @@ function computeDefaultColor() {
|
|||||||
|
|
||||||
const defaultColor = computeDefaultColor()
|
const defaultColor = computeDefaultColor()
|
||||||
|
|
||||||
// Fields must be defined in order to be reactive
|
|
||||||
builderDefaults(props.builder, {
|
builderDefaults(props.builder, {
|
||||||
timeA: s.clock, // todo 0
|
timeA: s.clock, // todo relative 0
|
||||||
timeB: null,
|
timeB: null,
|
||||||
// relative: true,
|
// relative: true, // todo
|
||||||
relative: false, // todo
|
relative: false,
|
||||||
|
slippage: DEFAULT_SLIPPAGE,
|
||||||
rungs: 1,
|
rungs: 1,
|
||||||
skew: 0,
|
skew: 0,
|
||||||
color: defaultColor,
|
color: defaultColor,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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 {computed, onMounted, onUnmounted} from "vue";
|
||||||
import {newTranche} from "@/blockchain/orderlib.js";
|
import {newTranche} from "@/blockchain/orderlib.js";
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ const props = defineProps(['order', 'builder'])
|
|||||||
const emit = defineEmits(['update:builder'])
|
const emit = defineEmits(['update:builder'])
|
||||||
|
|
||||||
// Fields must be defined in order to be reactive
|
// 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
|
// slippage is expressed in % but the underlying builder value is an unadjusted ratio, so we convert by a factor of
|
||||||
// 100 in and out
|
// 100 in and out
|
||||||
|
|||||||
@@ -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 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
|
// Builders are data objects which store a configuration state
|
||||||
@@ -253,4 +254,4 @@ export function weightColors(weights, color) {
|
|||||||
|
|
||||||
export function deleteBuilder(order, builder) {
|
export function deleteBuilder(order, builder) {
|
||||||
order.builders = order.builders.filter((b) => b !== builder)
|
order.builders = order.builders.filter((b) => b !== builder)
|
||||||
}
|
} // Fields must be defined in order to be reactive
|
||||||
|
|||||||
Reference in New Issue
Block a user