diff --git a/market-simulator/src/components/Simulator.vue b/market-simulator/src/components/Simulator.vue index b9575c73..6cca3374 100644 --- a/market-simulator/src/components/Simulator.vue +++ b/market-simulator/src/components/Simulator.vue @@ -20,6 +20,8 @@ Implied Probability Yes Payout No Payout + Yes Return + No Return @@ -29,9 +31,11 @@ {{ entry.noBid || '' }} {{ entry.yesWeight.toFixed(2) || '' }} {{ entry.noWeight.toFixed(2) || '' }} - {{ entry.prob.toFixed(2) }} - {{ entry.yesPayout.value.toFixed(2) }} - {{ entry.noPayout.value.toFixed(2) }} + {{ entry.prob.toFixed(2) || '' }} + {{ entry.yesPayout.value.toFixed(2) || '' }} + {{ entry.noPayout.value.toFixed(2) || '' }} + {{ (entry.yesReturn.value * 100).toFixed(2) || '' }}% + {{ (entry.noReturn.value * 100).toFixed(2) || '' }}% @@ -87,6 +91,9 @@ for (const bid of bids) { () => noBid + (noWeight / noWeightsC.value) * (yesPotC.value - YES_SEED) ) + const yesReturn = computed(() => (yesPayout.value - yesBid) / yesBid) + const noReturn = computed(() => (noPayout.value - noBid) / noBid) + entries.push({ yesBid, noBid, @@ -94,9 +101,10 @@ for (const bid of bids) { yesWeight: yesWeight, noWeight: noWeight, prob: prob, - // These are reactive, so fix decimal places in HTML template yesPayout, noPayout, + yesReturn, + noReturn, }) }