From 14402118bf14069d4a1ef15127d7eab0f27e425c Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 30 Nov 2021 17:49:34 -0800 Subject: [PATCH] Calculate weights, probs, and payoffs --- market-simulator/src/components/Simulator.vue | 54 ++++++++++++++++--- market-simulator/src/components/orders.ts | 3 +- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/market-simulator/src/components/Simulator.vue b/market-simulator/src/components/Simulator.vue index 77312b51..8d61dee8 100644 --- a/market-simulator/src/components/Simulator.vue +++ b/market-simulator/src/components/Simulator.vue @@ -6,17 +6,23 @@ Order # Yes bid No Bid + Yes Weight + No Weight Implied Probability - Payout + Yes Payout + No Payout - {{ i }} + {{ i + 1 }} {{ entry.yesBid || '' }} {{ entry.noBid || '' }} + {{ entry.yesWeight || '' }} + {{ entry.noWeight || '' }} {{ entry.prob }} - {{ entry.payout }} + {{ entry.yesPayout }} + {{ entry.noPayout }} @@ -26,9 +32,41 @@ diff --git a/market-simulator/src/components/orders.ts b/market-simulator/src/components/orders.ts index d11c5651..8ef39962 100644 --- a/market-simulator/src/components/orders.ts +++ b/market-simulator/src/components/orders.ts @@ -43,8 +43,7 @@ const data = `1,9 10, ,10 10, -,10 -` +,10` // Parse data into Yes/No orders // E.g. `8,\n,1\n1,` =>