tranche tweaks
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:expanded-row="{item}">
|
<template v-slot:expanded-row="{item}">
|
||||||
<tr>
|
<tr>
|
||||||
|
<td> </td>
|
||||||
<td colspan="100">
|
<td colspan="100">
|
||||||
<v-table>
|
<v-table>
|
||||||
<!--
|
<!--
|
||||||
@@ -50,8 +51,8 @@
|
|||||||
-->
|
-->
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(t, i) in item.order.tranches">
|
<tr v-for="(t, i) in item.order.tranches">
|
||||||
<td>Tranche {{ i + 1 }}</td>
|
<td class="text-right">Tranche {{ i + 1 }}</td>
|
||||||
<td>
|
<td class="text-center w-33">
|
||||||
<suspense>
|
<suspense>
|
||||||
<span>
|
<span>
|
||||||
<token-amount :addr="item.amountToken" :amount="item.trancheFilled[i]" :raw="true"/>
|
<token-amount :addr="item.amountToken" :amount="item.trancheFilled[i]" :raw="true"/>
|
||||||
@@ -60,10 +61,11 @@
|
|||||||
</span>
|
</span>
|
||||||
</suspense>
|
</suspense>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td class="text-left">
|
||||||
{{describeTrancheTime(item,t)}}
|
<span class="mx-3">{{ describeTrancheTime(item, true, t) }}</span>
|
||||||
{{describeTrancheLine(item,true,t.minIntercept,t.minSlope)}}
|
<span class="mx-3">{{ describeTrancheTime(item, false, t) }}</span>
|
||||||
{{describeTrancheLine(item,false,t.maxIntercept,t.maxSlope)}}
|
<span class="mx-3">{{ describeTrancheLine(item, true, t.minIntercept, t.minSlope) }}</span>
|
||||||
|
<span class="mx-3">{{ describeTrancheLine(item, false, t.maxIntercept, t.maxSlope) }}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -225,22 +227,20 @@ const orders = computed(()=>{
|
|||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
function describeTrancheTime(st, t) {
|
function describeTrancheTime(st, isStart, t) {
|
||||||
let result = ''
|
let result = ''
|
||||||
if( t.minIsBarrier || t.maxIsBarrier )
|
if( t.minIsBarrier || t.maxIsBarrier )
|
||||||
return 'barrier'
|
return 'barrier'
|
||||||
if( t.startTime > 0 ) {
|
if( isStart && t.startTime > 0 ) {
|
||||||
const started = t.startTimeIsRelative ? st.start + t.startTime : t.startTime
|
const started = t.startTimeIsRelative ? st.start + t.startTime : t.startTime
|
||||||
console.log('started', started, st.start, t.startTime)
|
|
||||||
result += started*1000 < Date.now() ? 'Activated ' : 'Activates '
|
result += started*1000 < Date.now() ? 'Activated ' : 'Activates '
|
||||||
result += dateString(started) + ' '
|
result += dateString(started) + ' '
|
||||||
}
|
}
|
||||||
if( t.endTime < 4294967295 ) {
|
if( !isStart && t.endTime < 4294967295 ) {
|
||||||
const ended = t.endTimeIsRelative ? st.start + t.endTime : t.endTime
|
const ended = t.endTimeIsRelative ? st.start + t.endTime : t.endTime
|
||||||
result += ended*1000 < Date.now() ? 'Expired ' : 'Expires '
|
result += ended*1000 < Date.now() ? 'Expired ' : 'Expires '
|
||||||
result += dateString(ended)
|
result += dateString(ended)
|
||||||
}
|
}
|
||||||
console.log('tt', st, t)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ export function timesliceTranches() {
|
|||||||
} else {
|
} else {
|
||||||
window = Math.round(duration / n)
|
window = Math.round(duration / n)
|
||||||
}
|
}
|
||||||
|
if( window < 60 )
|
||||||
|
window = 60
|
||||||
const amtPerTranche = Math.ceil(MAX_FRACTION / n)
|
const amtPerTranche = Math.ceil(MAX_FRACTION / n)
|
||||||
duration -= 15 // subtract 15 seconds so the last tranche completes before the deadline
|
duration -= 15 // subtract 15 seconds so the last tranche completes before the deadline
|
||||||
for (let i = 0; i < n; i++) {
|
for (let i = 0; i < n; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user