From 4c13c3f4a51d762ed51b4a40be47e7683abb7b16 Mon Sep 17 00:00:00 2001 From: dapplion Date: Fri, 9 Aug 2019 22:12:05 +0200 Subject: [PATCH] Clean useless functions --- src/App.tsx | 1 - src/math.ts | 27 --------------------------- 2 files changed, 28 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b21fb1c..037cd8e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,7 +20,6 @@ import { getLast, getAvg, pause } from "./utils"; import { getInitialParams, getPriceR, - getRandomDeltas, getSlippage, getTxDistribution, getDeltaR_priceGrowth, diff --git a/src/math.ts b/src/math.ts index 71d8edf..957959e 100644 --- a/src/math.ts +++ b/src/math.ts @@ -55,33 +55,6 @@ export function getSlippage({ // Price walk utils -/** - * Generate a random delta given three components: - * 1. Climbing sin - * 2. Oscilating sin - * 3. Random component - */ -export function getRandomDeltas({ - numSteps, - avgTxSize -}: { - numSteps: number; - avgTxSize: number; -}) { - const deltaR_t: number[] = []; - for (let i = 0; i < numSteps; i++) { - const rand = 1 - 2 * Math.random(); - const sin = Math.sin((1 / 20) * (i / numSteps)); - const ascending = Math.sin((Math.PI / 1) * (i / numSteps)); - const deltaR = 1e5 * rand + 1e5 * sin + 2e4 * ascending; - deltaR_t.push(deltaR); - } - - // Normalize random deltas with the average transaction size - const deltaR_avg = getAvg(deltaR_t); - return deltaR_t.map((deltaR: number) => (avgTxSize * deltaR) / deltaR_avg); -} - /** * Get deltaR for a given price growth factor */