diff --git a/src/components/DiagonalOrder.vue b/src/components/DiagonalOrder.vue
index ec94301..baed84a 100644
--- a/src/components/DiagonalOrder.vue
+++ b/src/components/DiagonalOrder.vue
@@ -4,31 +4,43 @@
Line Point A
-
+
Line Point B
-
- Backend support for diagonal lines is coming soon...
+
+
+
+
+ Current line value {{curLimit ? curLimit.toPrecision(5) : curLimit}}
+
+
+ Current price
+
+
+
+ {{os.limitIsMinimum}}
diff --git a/src/components/Orders.vue b/src/components/Orders.vue
index 9d1930b..c4cb47b 100644
--- a/src/components/Orders.vue
+++ b/src/components/Orders.vue
@@ -24,8 +24,8 @@
- {{ pairPrice(item.order.tokenIn, item.order.tokenOut, vaultAddr, item.avg) }}
-
{{ pair(item.order.tokenIn, item.order.tokenOut, vaultAddr, item.index) }}
@@ -117,7 +117,7 @@ const inverted = reactive({})
// todo create a Price component that keeps inversion flags in the store and defaults to stablecoins as the quote
-function pairPrice(inTokenAddr, outTokenAddr, vaultAddr, price) {
+function pairPrice(inTokenAddr, outTokenAddr, price) {
if( price === null )
return ''
const inToken = token(inTokenAddr)
@@ -125,7 +125,7 @@ function pairPrice(inTokenAddr, outTokenAddr, vaultAddr, price) {
if( !inToken || !outToken )
return ''
- const decimals = outToken.decimals-inToken.decimals
+ const decimals = inToken.decimals-outToken.decimals
if( decimals > 0 )
price /= 10 ** decimals
else
@@ -268,11 +268,14 @@ function describeTrancheTime(st, isStart, t) {
}
function describeTrancheLine(st, isMin, b, m) {
- if( b===0 && m===0 ) return ''
- // todo slopes
- console.log('tranche line', isMin, b, m)
// todo make this a PairPrice
- return (isMin === st.order.amountIsInput ? 'dont-chase ' : 'limit ') + pairPrice(st.order.tokenIn, st.order.tokenOut, s.vault, b)
+ if( b===0 && m===0 ) return ''
+ // console.log('tranche line', isMin, b, m)
+ if( m !== 0 ) {
+ const limit = b + m * s.time
+ return 'diagonal ' + pairPrice(st.order.tokenIn, st.order.tokenOut, limit)
+ }
+ return (isMin === st.order.amountIsInput ? 'dont-chase ' : 'limit ') + pairPrice(st.order.tokenIn, st.order.tokenOut, b)
}
diff --git a/src/components/PairPrice.vue b/src/components/PairPrice.vue
new file mode 100644
index 0000000..8ef4760
--- /dev/null
+++ b/src/components/PairPrice.vue
@@ -0,0 +1,45 @@
+
+ {{adjValue}}
+
+
+
+
+
+
diff --git a/src/components/RoutePrice.vue b/src/components/RoutePrice.vue
index 10aec7a..5209364 100644
--- a/src/components/RoutePrice.vue
+++ b/src/components/RoutePrice.vue
@@ -3,24 +3,27 @@