From f9c0d6f66261cb33bc40a5a4428e9ab53e8a60db Mon Sep 17 00:00:00 2001 From: dapplion Date: Wed, 14 Aug 2019 15:57:48 +0200 Subject: [PATCH] Apply Jeff's review --- src/App.tsx | 34 +++++++++++++++++++++------------- src/Header.tsx | 27 +++++++++++++++++++-------- src/parametersDescriptions.ts | 12 ++++++++---- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8abdfd6..90d4466 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -385,30 +385,38 @@ export default function App() { x => x + initialHatchFunds ); + const totalInitialHatchFunds = Math.round(d0 * theta); + const totalExitTributes = Math.round(getLast(withdrawFeeTimeseries)); + const totalFunds = totalInitialHatchFunds + totalExitTributes; + const formatFunds = (n: number) => (+n.toPrecision(3)).toLocaleString(); + const resultFields = [ { label: resultParameterDescriptions.totalReserve.name, description: resultParameterDescriptions.totalReserve.text, value: (+totalReserve.toPrecision(3)).toLocaleString() + " DAI" }, - { - label: resultParameterDescriptions.initialHatchFunds.name, - description: resultParameterDescriptions.initialHatchFunds.text, - value: Math.round(d0 * theta).toLocaleString() + " DAI" - }, - { - label: resultParameterDescriptions.exitTributes.name, - description: resultParameterDescriptions.exitTributes.text, - value: - (+getLast(withdrawFeeTimeseries).toPrecision(3)).toLocaleString() + - " DAI", - valueFooter: `From ${withdrawCount} exit txs` - }, { label: resultParameterDescriptions.slippage.name, description: resultParameterDescriptions.slippage.text, value: +(100 * avgSlippage).toFixed(3) + " %", valueFooter: `Avg tx size ${Math.round(avgTxSize).toLocaleString()} DAI` + }, + { + label: resultParameterDescriptions.initialHatchFunds.name, + description: resultParameterDescriptions.initialHatchFunds.text, + value: formatFunds(totalInitialHatchFunds) + " DAI" + }, + { + label: resultParameterDescriptions.exitTributes.name, + description: resultParameterDescriptions.exitTributes.text, + value: formatFunds(totalExitTributes) + " DAI", + valueFooter: `From ${withdrawCount} exit txs` + }, + { + label: resultParameterDescriptions.totalRaised.name, + description: resultParameterDescriptions.totalRaised.text, + value: formatFunds(totalFunds) + " DAI" } ]; diff --git a/src/Header.tsx b/src/Header.tsx index ffa5c97..5f87224 100644 --- a/src/Header.tsx +++ b/src/Header.tsx @@ -4,20 +4,27 @@ import Link from "@material-ui/core/Link"; import Typography from "@material-ui/core/Typography"; const cadCadLink = - "https://medium.com/block-science/cadcad-filling-a-critical-gap-in-open-source-data-science-fcd0d3faa8ed"; + "https://medium.com/giveth/deep-dive-augmented-bonding-curves-3f1f7c1fa751"; const useStyles = makeStyles((theme: Theme) => createStyles({ + container: { + display: "flex", + flexDirection: "column", + alignItems: "center" + }, title: { // color: theme.palette.text.secondary, }, subtitle: { color: theme.palette.text.secondary, - margin: theme.spacing(3, 0, 0) + margin: theme.spacing(3, 0, 0), + maxWidth: theme.spacing(82) }, subsubtitle: { color: theme.palette.text.secondary, - opacity: 0.6 + opacity: 0.6, + maxWidth: theme.spacing(74) }, lightBulb: { verticalAlign: "middle", @@ -47,7 +54,7 @@ const useStyles = makeStyles((theme: Theme) => export default function Header() { const classes = useStyles(); return ( - <> +
logo Commons Stack @@ -58,12 +65,16 @@ export default function Header() { - Experiment and test augmented bonding curves + Experiment with the Commons Stack Augmented Bonding Curve component. + Customize the hatch variables and explore the continuous funding results + for your community. - A narrative showcase of cadCAD - 's capabilities + Read more about the Augmented Bonding Curve{" "} + here. Note that this is a demo for + illustration purposes only, a narrative showcase of cadCAD's + capabilities. - +
); } diff --git a/src/parametersDescriptions.ts b/src/parametersDescriptions.ts index 53cb5c5..39ee3bc 100644 --- a/src/parametersDescriptions.ts +++ b/src/parametersDescriptions.ts @@ -60,6 +60,11 @@ export const resultParameterDescriptions: DescriptionObject = { name: "Collateral pool balance", text: "Total DAI in the collateral pool at the end of the simulated period" }, + slippage: { + name: "Median slippage", + text: + "Median of change in price a user experiences from the current price to the price received for exiting/selling/burning" + }, initialHatchFunds: { name: "Funds generated from Raise Hatch", text: "Funds raised during the Hatch that go directly to the cause" @@ -69,9 +74,8 @@ export const resultParameterDescriptions: DescriptionObject = { text: "Cumulative sum of exit tributes collected from only exit / sell / burn transactions" }, - slippage: { - name: "Median slippage", - text: - "Median of change in price a user experiences from the current price to the price received for exiting/selling/burning" + totalRaised: { + name: "Total funds raised for your community", + text: "Sum of funds from Raise Hatch + funds from exit tributes" } };