From b04134c9c5f34da5a7050012d0a8c44540e6a777 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Wed, 1 Dec 2021 02:24:03 -0800 Subject: [PATCH] Switch to a functional implementation Pros: More extensible Cons: Slower than the reactive version --- market-simulator/src/components/Simulator.vue | 78 ++++--------------- market-simulator/src/components/entries.ts | 60 ++++++++++++++ .../components/{orders.ts => sample-bids.ts} | 0 3 files changed, 73 insertions(+), 65 deletions(-) create mode 100644 market-simulator/src/components/entries.ts rename market-simulator/src/components/{orders.ts => sample-bids.ts} (100%) diff --git a/market-simulator/src/components/Simulator.vue b/market-simulator/src/components/Simulator.vue index 63ae8783..20d1e3df 100644 --- a/market-simulator/src/components/Simulator.vue +++ b/market-simulator/src/components/Simulator.vue @@ -6,7 +6,7 @@ type="range" v-model.number="steps" min="1" - :max="allEntries.length" + :max="bids.length" />
@@ -21,9 +21,9 @@ Type Bid Weight - Implied Probability + Probability Payout - Return on win + Return @@ -34,16 +34,16 @@ {{ entry.yesBid }} {{ entry.yesWeight.toFixed(2) }} {{ entry.prob.toFixed(2) }} - {{ entry.yesPayout.value.toFixed(2) }} - {{ (entry.yesReturn.value * 100).toFixed(2) }}% + {{ entry.yesPayout.toFixed(2) }} + {{ (entry.yesReturn * 100).toFixed(2) }}% @@ -55,71 +55,19 @@