Apply Griff content revisions
This commit is contained in:
parent
655c4ea9d0
commit
e95a33ba1f
41
src/App.tsx
41
src/App.tsx
|
|
@ -19,7 +19,9 @@ import HelpText from "./HelpText";
|
|||
import {
|
||||
parameterDescriptions,
|
||||
simulationParameterDescriptions,
|
||||
resultParameterDescriptions
|
||||
resultParameterDescriptions,
|
||||
supplyVsDemandChartDescription,
|
||||
simulationChartDescription
|
||||
} from "./parametersDescriptions";
|
||||
// Utils
|
||||
import { getLast, getAvg, pause } from "./utils";
|
||||
|
|
@ -321,28 +323,36 @@ export default function App() {
|
|||
};
|
||||
}, [simulationActive]);
|
||||
|
||||
// End results computed for chart visualization
|
||||
const initialHatchFunds = d0 * theta;
|
||||
const totalFundsRaisedTimeseries = withdrawFeeTimeseries.map(
|
||||
x => x + initialHatchFunds
|
||||
);
|
||||
|
||||
const resultFields = [
|
||||
{
|
||||
label: `Total reserve`,
|
||||
label: resultParameterDescriptions.totalReserve.name,
|
||||
description: resultParameterDescriptions.totalReserve.text,
|
||||
value: (+totalReserve.toPrecision(3)).toLocaleString() + " DAI"
|
||||
},
|
||||
{
|
||||
label: `Funds generated from initial hatch`,
|
||||
label: resultParameterDescriptions.initialHatchFunds.name,
|
||||
description: resultParameterDescriptions.initialHatchFunds.text,
|
||||
value: Math.round(d0 * theta).toLocaleString() + " DAI"
|
||||
},
|
||||
{
|
||||
label: `Funds generated from exit tributes (${withdrawCount} txs)`,
|
||||
label: `${
|
||||
resultParameterDescriptions.exitTributes.name
|
||||
} (${withdrawCount} txs)`,
|
||||
description: resultParameterDescriptions.exitTributes.text,
|
||||
value:
|
||||
(+getLast(withdrawFeeTimeseries).toPrecision(3)).toLocaleString() +
|
||||
" DAI"
|
||||
},
|
||||
{
|
||||
label: `Average slippage (avg tx size ${Math.round(
|
||||
avgTxSize
|
||||
).toLocaleString()} DAI)`,
|
||||
label: `${
|
||||
resultParameterDescriptions.slippage.name
|
||||
} (avg tx size ${Math.round(avgTxSize).toLocaleString()} DAI)`,
|
||||
description: resultParameterDescriptions.slippage.text,
|
||||
value: +(100 * avgSlippage).toFixed(3) + "%"
|
||||
}
|
||||
|
|
@ -427,12 +437,7 @@ export default function App() {
|
|||
text={
|
||||
<div className={classes.descriptionPadding}>
|
||||
<Typography className={classes.descriptionBody}>
|
||||
Visualization of the token bonding curve analytic
|
||||
function on a specific range of reserve [0, 4 * R0].
|
||||
This result is deterministic given the current set of
|
||||
parameters and will never change regardes of the
|
||||
campaign performance, it only shows how the price will
|
||||
react to reserve changes.
|
||||
{supplyVsDemandChartDescription}
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
|
|
@ -482,13 +487,7 @@ export default function App() {
|
|||
<div className={classes.descriptionContainer}>
|
||||
<div className={classes.descriptionPadding}>
|
||||
<Typography className={classes.descriptionBody}>
|
||||
This chart shows a 52 week simulation of discrete
|
||||
transactions interacting with the token bonding
|
||||
curve. Each transaction adds or substract reserve
|
||||
to the system, modifying the price over time. The
|
||||
frequency, size and direction of each transaction
|
||||
is computed from a set of bounded random
|
||||
functions.
|
||||
{simulationChartDescription}
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
|
|
@ -520,8 +519,8 @@ export default function App() {
|
|||
<Box className={classes.boxChart}>
|
||||
<PriceSimulationChart
|
||||
priceTimeseries={priceTimeseries}
|
||||
withdrawFeeTimeseries={withdrawFeeTimeseries}
|
||||
floorpriceTimeseries={floorpriceTimeseries}
|
||||
totalFundsRaisedTimeseries={totalFundsRaisedTimeseries}
|
||||
p0={p0}
|
||||
p1={p1}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default function CurveDesignInputParams({
|
|||
|
||||
const inputFields: InputFieldInterface[] = [
|
||||
{
|
||||
label: "Allocation to funding pool",
|
||||
label: parameterDescriptions.theta.name,
|
||||
description: parameterDescriptions.theta.text,
|
||||
value: theta,
|
||||
setter: setTheta,
|
||||
|
|
@ -55,7 +55,7 @@ export default function CurveDesignInputParams({
|
|||
toNum: (n: string) => parseFloat(n) * 1e-2
|
||||
},
|
||||
{
|
||||
label: "Hatch price (DAI/token)",
|
||||
label: `${parameterDescriptions.p0.name} (DAI/token)`,
|
||||
description: parameterDescriptions.p0.text,
|
||||
value: p0,
|
||||
setter: _setP0,
|
||||
|
|
@ -67,7 +67,7 @@ export default function CurveDesignInputParams({
|
|||
format: (n: number) => `$${n}`
|
||||
},
|
||||
{
|
||||
label: "Post-hatch price (DAI/token)",
|
||||
label: `${parameterDescriptions.p1.name} (DAI/token)`,
|
||||
description: parameterDescriptions.p1.text,
|
||||
value: p1,
|
||||
setter: setP1,
|
||||
|
|
@ -79,7 +79,7 @@ export default function CurveDesignInputParams({
|
|||
format: (n: number) => `$${n}`
|
||||
},
|
||||
{
|
||||
label: "Exit tribute",
|
||||
label: parameterDescriptions.wFee.name,
|
||||
description: parameterDescriptions.wFee.text,
|
||||
value: wFee,
|
||||
setter: setWFee,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export default function Header() {
|
|||
</div>
|
||||
|
||||
<Typography className={classes.title} variant="h4">
|
||||
Augmented Token Bonding Curve Design
|
||||
Augmented Bonding Curve Design
|
||||
</Typography>
|
||||
|
||||
<Typography className={classes.subtitle}>
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ import { linspace } from "./utils";
|
|||
|
||||
const keyHorizontal = "x";
|
||||
const keyVerticalLeft = "Price (DAI/token)";
|
||||
const keyVerticalRight = "Total exit tributes (DAI)";
|
||||
const keyVerticalLeft2 = "Floor price (DAI/token)";
|
||||
const keyVerticalRight = "Total funds raised (DAI)";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
|
|
@ -32,13 +32,13 @@ const useStyles = makeStyles((theme: Theme) =>
|
|||
|
||||
function PriceSimulationChart({
|
||||
priceTimeseries,
|
||||
withdrawFeeTimeseries,
|
||||
totalFundsRaisedTimeseries,
|
||||
floorpriceTimeseries,
|
||||
p0,
|
||||
p1
|
||||
}: {
|
||||
priceTimeseries: number[];
|
||||
withdrawFeeTimeseries: number[];
|
||||
totalFundsRaisedTimeseries: number[];
|
||||
floorpriceTimeseries: number[];
|
||||
p0: number;
|
||||
p1: number;
|
||||
|
|
@ -55,7 +55,7 @@ function PriceSimulationChart({
|
|||
[keyHorizontal]: t,
|
||||
[keyVerticalLeft]: priceTimeseries[t] || 0,
|
||||
[keyVerticalLeft2]: floorpriceTimeseries[t] || 0,
|
||||
[keyVerticalRight]: withdrawFeeTimeseries[t] || 0
|
||||
[keyVerticalRight]: totalFundsRaisedTimeseries[t] || 0
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -92,8 +92,8 @@ function PriceSimulationChart({
|
|||
const weekNum = label;
|
||||
const toolTipData: string[][] = [
|
||||
["Price", price.toFixed(2), "DAI/tk"],
|
||||
["Floor", floor.toFixed(2), "DAI/tk"],
|
||||
["Exit t.", formatter(exit), "DAI"],
|
||||
["Floor P.", floor.toFixed(2), "DAI/tk"],
|
||||
["Funds R.", formatter(exit), "DAI"],
|
||||
["Week", weekNum, ""]
|
||||
];
|
||||
|
||||
|
|
@ -115,6 +115,10 @@ function PriceSimulationChart({
|
|||
} else return null;
|
||||
}
|
||||
|
||||
const totalFundsMin = totalFundsRaisedTimeseries[0];
|
||||
const totalFundsMax = totalFundsRaisedTimeseries.slice(-1)[0];
|
||||
const totalFundsRange = totalFundsMax - totalFundsMin;
|
||||
|
||||
return (
|
||||
<ResponsiveContainer debounce={1}>
|
||||
<AreaChart
|
||||
|
|
@ -154,7 +158,10 @@ function PriceSimulationChart({
|
|||
{/* Capital collected from withdraw fees - AXIS */}
|
||||
<YAxis
|
||||
yAxisId="right"
|
||||
domain={[0, +(2 * withdrawFeeTimeseries.slice(-1)[0]).toPrecision(1)]}
|
||||
domain={[
|
||||
totalFundsMin.toPrecision(2),
|
||||
+(totalFundsMax + totalFundsRange).toPrecision(2)
|
||||
]}
|
||||
orientation="right"
|
||||
tick={{ fill: theme.palette.text.secondary }}
|
||||
tickFormatter={formatter}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default function CurveDesignInputParams({
|
|||
|
||||
const inputFields: InputFieldInterface[] = [
|
||||
{
|
||||
label: "Initial raise (DAI)",
|
||||
label: `${parameterDescriptions.d0.name} (DAI)`,
|
||||
description: parameterDescriptions.d0.text,
|
||||
value: d0,
|
||||
setter: setD0,
|
||||
|
|
|
|||
|
|
@ -4,31 +4,36 @@ export interface DescriptionObject {
|
|||
|
||||
export const parameterDescriptions: DescriptionObject = {
|
||||
theta: {
|
||||
name: "Allocation to funding pool",
|
||||
name: "Hatch % to funding pool",
|
||||
text:
|
||||
"The percentage of the funds raised in the Hatch sale that go directly into the project funding pool to compensate future work done in the project"
|
||||
"The percentage of the funds raised in the Hatch going directly to funding pool to be used to support the Commons, the rest goes to the collateral pool"
|
||||
},
|
||||
p0: {
|
||||
name: "Hatch price",
|
||||
text:
|
||||
"The price paid per 'ABC token' by community members involved in hatching the project"
|
||||
text: "The price paid per token by when hatching the project"
|
||||
},
|
||||
p1: {
|
||||
name: "Post-hatch price",
|
||||
name: "Post-Hatch price",
|
||||
text:
|
||||
"The price of the 'ABC token' when the curve enters the open phase and is live for public participation"
|
||||
"The price per token after the Hatch ends, the curve is set, and anyone can interact with the bonding curve"
|
||||
},
|
||||
wFee: {
|
||||
name: "Exit tribute",
|
||||
text:
|
||||
"The percentage of funds that are diverted to the project funding pool from community members who exit funds from the project by burning 'ABC tokens' in exchange for collateral"
|
||||
"The percentage that goes to the funding pool when token holders 'sell' by burning their token at the price determined by the bonding curve"
|
||||
},
|
||||
d0: {
|
||||
name: "Initial raise",
|
||||
text: "Total funds raised in the hatch period of the ABC launch"
|
||||
text: "Amount of funds contributed during the hatch period"
|
||||
}
|
||||
};
|
||||
|
||||
export const supplyVsDemandChartDescription =
|
||||
"Visualization of the bonding curve up to 4x the initial size of the Collateral Pool Post-Hatch. This result is deterministic given the curve parameters and the initial raise. It will never change regardless of the campaign's performance, it simply shows how the price will react to changes in the Collateral Pool.";
|
||||
|
||||
export const simulationChartDescription =
|
||||
"This chart shows a 52 week simulation of discrete transactions interacting with the Augmented Bonding Curve. Each transaction adds to or subtracts reserve from the system, modifying the price over time. The frequency, size and direction of each transaction is computed from a set of bounded random functions. This is a NOT a cadCAD simulation, but it showcases the intention behind cadCAD.";
|
||||
|
||||
export const simulationParameterDescriptions: DescriptionObject = {
|
||||
price: {
|
||||
name: "Price",
|
||||
|
|
@ -39,31 +44,29 @@ export const simulationParameterDescriptions: DescriptionObject = {
|
|||
text:
|
||||
"Lower bound of the price guaranteed by the vesting of hatch tokens. It decreases over time as more hatch tokens are allowed to be traded"
|
||||
},
|
||||
exitTributes: {
|
||||
name: "Total exit tributes",
|
||||
text:
|
||||
"Cumulative sum of exit tributes collected from only exit /sell transactions"
|
||||
totalRaised: {
|
||||
name: "Total funds raised",
|
||||
text: "Cumulative sum of the funds sent to the Funding Pool"
|
||||
}
|
||||
};
|
||||
|
||||
export const resultParameterDescriptions: DescriptionObject = {
|
||||
totalReserve: {
|
||||
name: "Total reserve",
|
||||
text:
|
||||
"Total DAI in the smart contract reserve at the end of the simulated period"
|
||||
name: "Collateral pool balance",
|
||||
text: "Total DAI in the collateral pool at the end of the simulated period"
|
||||
},
|
||||
initialHatchFunds: {
|
||||
name: "Funds generated from initial hatch",
|
||||
text:
|
||||
"Fraction of the funds (theta) raised during the hatch that go directly to the cause (analytic result)"
|
||||
name: "Funds generated from initial Hatch",
|
||||
text: "Funds raised during the Hatch that go directly to the cause"
|
||||
},
|
||||
exitTributes: {
|
||||
name: "Funds generated from exit tributes",
|
||||
text: simulationParameterDescriptions.exitTributes.text
|
||||
text:
|
||||
"Cumulative sum of exit tributes collected from only exit / sell / burn transactions"
|
||||
},
|
||||
slippage: {
|
||||
name: "Average slippage",
|
||||
text:
|
||||
"Average of the slippage of each transaction occured during the simulation period"
|
||||
"Average of change in price a user experiences from the current price to the price received for exiting/selling/burning"
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue