augmented-tbc-design/static/js/main.0bbff1ff.chunk.js

2 lines
23 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{225:function(e,t,a){e.exports=a(421)},420:function(e,t,a){},421:function(e,t,a){"use strict";a.r(t);var n=a(1),r=a.n(n),i=a(13),o=a.n(i),c=a(462),l=a(461),s=a(64),m=a.n(s),u=a(117),d=a(14),p=a(422),f=a(467),h=a(460),g=a(423),b=a(464),x=a(459),v=a(458),E=a(466),y=a(457),k="https://medium.com/block-science/cadcad-filling-a-critical-gap-in-open-source-data-science-fcd0d3faa8ed",j=Object(p.a)(function(e){return Object(f.a)({title:{},subtitle:{color:e.palette.text.secondary,margin:e.spacing(3,0,0)},subsubtitle:{color:e.palette.text.secondary,opacity:.6},lightBulb:{verticalAlign:"middle",marginRight:e.spacing(1)},link:{color:e.palette.primary.main},logoContainer:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:e.spacing(4)},logo:{width:"25px",marginRight:"4px"},logoText:{display:"inline",fontSize:"1.1rem",fontWeight:500}})});function O(){var e=j();return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:e.logoContainer},r.a.createElement("img",{src:"./favicon.ico",className:e.logo,alt:"logo"}),r.a.createElement(g.a,{className:e.logoText},"Commons Stack")),r.a.createElement(g.a,{className:e.title,variant:"h4"},"Augmented Token Bonding Curve Design"),r.a.createElement(g.a,{className:e.subtitle},"Experiment and test augmented token bonding curves"),r.a.createElement(g.a,{className:e.subsubtitle},"A narrative showcase of ",r.a.createElement(y.a,{href:k},"cadCAD"),"'s capabilities"))}var C=a(83),N=a(192),w=a(463),A=a(175),B=a.n(A),F=a(7),S=a(468),R=Object(F.a)({root:{height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor",marginTop:-8,marginLeft:-12,"&:focus,&:hover,&$active":{boxShadow:"inherit"}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:8,borderRadius:4},rail:{height:8,borderRadius:4},markLabel:{top:30}})(S.a),M=Object(p.a)(function(e){return Object(f.a)({root:{margin:e.spacing(6,0,3)},lightBulb:{verticalAlign:"middle",marginRight:e.spacing(1)},leftContainer:{color:e.palette.text.secondary},centerContainer:{},listBoxContainer:{"& > div:not(:last-child)":{paddingBottom:"12px",marginBottom:"12px",borderBottom:"1px solid #313d47"}},listBox:{"& > div":{display:"flex",alignItems:"center","& p":{marginBottom:0}},"& > div:not(:last-child)":{paddingRight:"12px"}},slider:{color:e.palette.primary.main},secondaryColor:{color:e.palette.secondary.light}})});function I(e){var t=e.inputRef,a=e.onChange,n=e.prefix,i=e.suffix,o=Object(N.a)(e,["inputRef","onChange","prefix","suffix"]);return r.a.createElement(B.a,Object.assign({},o,{getInputRef:t,onValueChange:function(e){a({target:{value:e.value}})},thousandSeparator:!0,prefix:n,suffix:i}))}function T(e){var t=e.inputFields,a=e.onChangeCommited,n=M();return r.a.createElement("div",{className:n.listBoxContainer},t.map(function(e){var t=e.label,i=e.value,o=e.setter,c=e.min,l=e.max,s=e.step,m=e.prefix,u=e.suffix,d=e.secondaryColor,p=e.format,f=e.toText,h=e.toNum;function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;isNaN(e)&&(e=0),e>l?e=l:e<c&&(e=c),o(e)}return r.a.createElement(v.a,{key:t,container:!0,spacing:0,className:n.listBox},r.a.createElement(v.a,{item:!0,xs:6,className:n.leftContainer},r.a.createElement(g.a,{id:t,gutterBottom:!0},t)),r.a.createElement(v.a,{item:!0,xs:2,className:n.centerContainer},r.a.createElement(w.a,{onChange:function(e){b(h?h(e.target.value):parseFloat(e.target.value)),a()},InputProps:{inputComponent:I,disableUnderline:!0,inputProps:{prefix:m,suffix:u}},value:f?f(i):i})),r.a.createElement(v.a,{item:!0,xs:4},r.a.createElement(R,{className:"".concat(n.slider," ").concat(d?n.secondaryColor:""),valueLabelDisplay:"auto","aria-label":t,defaultValue:i,onChange:function(e,t){return b(Number(t))},onChangeCommitted:a,value:i,min:c,max:l,step:s,valueLabelFormat:function(e){return p(e).replace("$","")}})))}))}function P(e){var t=e.curveParams,a=e.setCurveParams,i=Object(n.useState)(.35),o=Object(d.a)(i,2),c=o[0],l=o[1],s=Object(n.useState)(.1),m=Object(d.a)(s,2),u=m[0],p=m[1],f=Object(n.useState)(.3),h=Object(d.a)(f,2),g=h[0],b=h[1],x=Object(n.useState)(.05),v=Object(d.a)(x,2),E=v[0],y=v[1];Object(n.useEffect)(function(){l(t.theta),p(t.p0),b(t.p1),y(t.wFee)},[t]);var k=10,j=[{label:"Allocation to funding pool",value:c,setter:l,min:0,max:.9,step:.01,suffix:"%",format:function(e){return"".concat(Math.round(100*e),"%")},toText:function(e){return String(+(100*e).toFixed(0))},toNum:function(e){return.01*parseFloat(e)}},{label:"Hatch price (DAI/token)",value:u,setter:function(e){p(e),g<e?b(e):g>e*k&&b(e*k)},min:.01,max:1,step:.01,toText:function(e){return String(+e.toFixed(2))},toNum:function(e){return parseFloat(e)},format:function(e){return"$".concat(e)}},{label:"Post-hatch price (DAI/token)",value:g,setter:b,min:u||.1,max:Number((k*u).toFixed(2)),step:.01,toText:function(e){return String(+e.toFixed(2))},toNum:function(e){return parseFloat(e)},format:function(e){return"$".concat(e)}},{label:"Exit tribute",value:E,setter:y,min:0,max:.1,step:.001,suffix:"%",format:function(e){return"".concat(+(100*e).toFixed(1),"%")},toText:function(e){return String(+(100*e).toFixed(1))},toNum:function(e){return.01*parseFloat(e)}}];return r.a.createElement(T,{inputFields:j,onChangeCommited:function(){a(function(e){return Object(C.a)({},e,{theta:c,p0:u,p1:g,wFee:E})})}})}function D(e){var t=e.curveParams,a=e.setCurveParams,i=Object(n.useState)(3e6),o=Object(d.a)(i,2),c=o[0],l=o[1];Object(n.useEffect)(function(){l(t.d0)},[t]);var s=[{label:"Initial raise (DAI)",value:c,setter:l,min:1e5,max:1e7,step:1e5,suffix:"M",format:function(e){return"$".concat(+(1e-6*e).toFixed(1),"M")},toText:function(e){return String(+(1e-6*e).toFixed(1))},toNum:function(e){return Math.floor(1e6*parseFloat(e))},secondaryColor:!0}];return r.a.createElement(T,{inputFields:s,onChangeCommited:function(){a(function(e){return Object(C.a)({},e,{d0:c})})}})}var H=a(26),L=a(16);function V(e){for(var t=e.from,a=void 0===t?0:t,n=e.to,r=e.steps,i=[],o=a;o<=n;o+=(n-a)/r)i.push(o);return i}function W(e,t){for(var a=[],n=(e[e.length-1]-e[0])/t,r=e[0];r<e[e.length-1];r+=n)a.push(r);return a.length<t+1&&a.push(e[e.length-1]),a}function z(e){return e[e.length-1]}function K(e){return e.reduce(function(e,t){return e+Math.abs(t)},0)/e.length}function $(e){return new Promise(function(t){return setTimeout(t,e)})}function q(e){var t=e.d0,a=e.theta,n=e.p0,r=e.p1/n/(1-a),i=(1-a)*t,o=t/n;return{k:r,R0:i,S0:o,V0:Math.pow(o,r)/i}}function G(e){var t=e.R,a=e.V0,n=e.k;return n*Math.pow(t,(n-1)/n)/Math.pow(a,1/n)}function J(e){var t=e.R,a=e.deltaR,n=e.V0,r=e.k,i=Math.pow(n*t,1/r),o=a/(Math.pow(n*(t+a),1/r)-i),c=G({R:t,V0:n,k:r});return Math.abs(o-c)/c}function U(e){var t=e.R,a=e.k,n=e.priceGrowth;return-t+Math.pow(n*Math.pow(t,1-1/a),a/(-1+a))}function Q(e){for(var t=e.sum,a=e.num,n=t/a,r=4*n,i=[],o=0;o<a;o++)i[o]=Y(n-r,n+r);return i}function X(e,t){return Math.random()*(t-e)+e}function Y(e,t){for(var a=0,n=0;0===a;)a=Math.random();for(;0===n;)n=Math.random();var r=Math.sqrt(-2*Math.log(a))*Math.cos(2*Math.PI*n);return((r=r/10+.5)>1||r<0)&&(r=Y(e,t)),r*=t-e,r+=e}var Z=a(193),_="x",ee="Supply (tokens) / Reserve (DAI)",te=Object(p.a)(function(e){return Object(f.a)({tooltip:{border:"1px solid #313d47",backgroundColor:"#384b59",padding:e.spacing(1),color:"#c7ccd2"}})});var ae=function(e){for(var t=e.theta,a=q({d0:e.d0,theta:t,p0:e.p0,p1:e.p1}),n=a.k,i=a.R0,o=a.S0,c=a.V0,l=Math.round(i),s=function(e){return o*Math.pow(e/l,1/n)},m=4*l,u=Math.round((m-0)/100),p=Math.max(m,s(m)),f=p>5e8?[1e9,"B"]:p>5e5?[1e6,"M"]:p>500?[1e3,"K"]:[1,""],h=Object(d.a)(f,2),g=h[0],b=h[1],x=[],v=0;v<101;v++){var E,y=Math.round(0+u*v);x.push((E={},Object(H.a)(E,_,y),Object(H.a)(E,ee,s(y)),E))}var k=Object(Z.a)(),j=te(),O=function(e){return(+(e/g).toPrecision(2)).toLocaleString()};return r.a.createElement(L.f,{debounce:1},r.a.createElement(L.b,{width:0,height:400,data:x,margin:{top:10,right:30,left:0,bottom:0}},r.a.createElement(L.c,{strokeDasharray:"3 3"}),r.a.createElement(L.h,{interval:24,dataKey:_,tickFormatter:O,unit:b,tick:{fill:k.palette.text.secondary},stroke:k.palette.text.secondary}),r.a.createElement(L.i,{interval:"preserveStartEnd",ticks:W(x.map(function(e){return e[ee]}),3),tickFormatter:O,unit:b,tick:{fill:k.palette.text.secondary},domain:[0,s(m)],stroke:k.palette.text.secondary}),r.a.createElement(L.g,{content:r.a.createElement(function(e){var t=e.active,a=e.payload,i=e.label;if(t){var o=a[0].value,l=i,s=G({R:l,V0:c,k:n}),m=[["Supply",O(o)+b,"tokens"],["Reserve",O(l)+b,"DAI"],["Price",s.toFixed(2),"DAI/token"]];return r.a.createElement("div",{className:j.tooltip},r.a.createElement("table",null,r.a.createElement("tbody",null,m.map(function(e){var t=Object(d.a)(e,3),a=t[0],n=t[1],i=t[2];return r.a.createElement("tr",{key:a},r.a.createElement("td",null,a),r.a.createElement("td",null,n),r.a.createElement("td",null,i))}))))}return null},null)}),r.a.createElement(L.a,{isAnimationActive:!1,type:"monotone",dataKey:ee,stroke:k.palette.primary.main,fill:k.palette.primary.main}),r.a.createElement(L.e,{x:l,stroke:k.palette.primary.main,strokeDasharray:"9 0",label:r.a.createElement(function(e){var t=e.textAnchor,a=e.viewBox;return r.a.createElement("text",{x:a.x+10,y:30,fill:k.palette.text.secondary,textAnchor:t},"Initial value")},null)}),r.a.createElement(L.d,{formatter:function(e){return r.a.createElement("span",{style:{color:k.palette.text.secondary}},e)}})))},ne=Object(p.a)(function(e){return Object(f.a)({root:{margin:e.spacing(6,0,3)},lightBulb:{verticalAlign:"middle",marginRight:e.spacing(1)},leftContainer:{color:e.palette.text.secondary},centerContainer:{},listBoxContainer:{"& > div:not(:last-child)":{marginBottom:"12px",borderBottom:"1px solid #313d47"}},listBox:{paddingBottom:"12px","& > div":{display:"flex",alignItems:"center","& p":{marginBottom:0}},"& > div:not(:last-child)":{paddingRight:"12px"}}})});function re(e){var t=e.resultFields,a=ne();return r.a.createElement("div",{className:a.listBoxContainer},t.map(function(e){var t=e.label,n=e.value;return r.a.createElement(v.a,{key:t,container:!0,spacing:0,className:a.listBox},r.a.createElement(v.a,{item:!0,xs:8,className:a.leftContainer},r.a.createElement(g.a,{id:t,gutterBottom:!0},t)),r.a.createElement(v.a,{item:!0,xs:4,className:a.centerContainer},r.a.createElement(g.a,{gutterBottom:!0},n)))}))}var ie=a(121),oe="x",ce="Price (DAI/token)",le="Total exit tributes (DAI)",se=Object(p.a)(function(e){return Object(f.a)({tooltip:{border:"1px solid #313d47",backgroundColor:"#384b59",padding:e.spacing(1),color:"#c7ccd2"}})});var me=function(e){for(var t=e.priceTimeseries,a=e.withdrawFeeTimeseries,n=e.p0,i=e.p1,o=[],c=0;c<t.length;c++){var l;o.push((l={},Object(H.a)(l,oe,c),Object(H.a)(l,ce,t[c]||0),Object(H.a)(l,le,a[c]||0),l))}var s=Object(Z.a)(),m=se(),u=function(e){return(+e.toPrecision(3)).toLocaleString()};function p(e){var t=e.textAnchor,a=e.viewBox,n=e.text;return r.a.createElement("text",{x:a.x+10,y:a.y-10,fill:s.palette.text.secondary,textAnchor:t},n)}return r.a.createElement(L.f,{debounce:1},r.a.createElement(L.b,{width:0,height:400,data:o,margin:{top:10,right:30,left:0,bottom:0}},r.a.createElement(L.c,{strokeDasharray:"3 3"}),r.a.createElement(L.h,{dataKey:oe,tick:{fill:s.palette.text.secondary},stroke:s.palette.text.secondary,ticks:[].concat(Object(ie.a)(V({to:t.length,steps:4}).map(Math.floor)),[t.length-1])}),r.a.createElement(L.i,{yAxisId:"left",domain:[0,Math.max.apply(Math,Object(ie.a)(t).concat([1.25*i]))],tickFormatter:u,tick:{fill:s.palette.text.secondary},stroke:s.palette.text.secondary}),r.a.createElement(L.i,{yAxisId:"right",orientation:"right",tick:{fill:s.palette.text.secondary},stroke:s.palette.text.secondary}),r.a.createElement(L.g,{content:r.a.createElement(function(e){var t=e.active,a=e.payload,n=e.label;if(t){var i=a[0].value,o=a[1].value,c=n,l=[["Price",i.toFixed(2),"DAI/tk"],["Exit t.",u(o),"DAI"],["Week",c,""]];return r.a.createElement("div",{className:m.tooltip},r.a.createElement("table",null,r.a.createElement("tbody",null,l.map(function(e){var t=Object(d.a)(e,3),a=t[0],n=t[1],i=t[2];return r.a.createElement("tr",{key:a},r.a.createElement("td",null,a),r.a.createElement("td",null,n),r.a.createElement("td",null,i))}))))}return null},null)}),r.a.createElement(L.a,{isAnimationActive:!1,yAxisId:"left",type:"monotone",dataKey:ce,stroke:s.palette.primary.main,fill:s.palette.primary.main}),r.a.createElement(L.e,{y:n,yAxisId:"left",stroke:s.palette.primary.main,strokeDasharray:"9 0",label:r.a.createElement(p,{text:"Hatch sale price"})}),r.a.createElement(L.e,{y:i,yAxisId:"left",stroke:s.palette.primary.main,strokeDasharray:"9 0",label:r.a.createElement(p,{text:"After hatch price"})}),r.a.createElement(L.a,{isAnimationActive:!1,yAxisId:"right",type:"monotone",dataKey:le,stroke:s.palette.secondary.dark,fill:s.palette.secondary.dark,fillOpacity:"0.8"}),r.a.createElement(L.d,{formatter:function(e){return r.a.createElement("span",{style:{color:s.palette.text.secondary}},e)}})))},ue=a(465),de=a(185),pe=a.n(de),fe=Object(p.a)(function(e){return{container:{display:"flex",marginLeft:"6px",fontSize:"0.9rem",cursor:"pointer",transition:"opacity ease 150ms",opacity:.2,"&:hover":{opacity:.85}},popoverContainer:{padding:e.spacing(2)},paper:Object(H.a)({backgroundColor:"#384b59",maxWidth:.9*e.breakpoints.values.md},"@media screen and (max-width: ".concat(e.breakpoints.values.md,"px)"),{maxWidth:"90vw"})}});function he(e){var t=e.text,a=fe(),n=r.a.useState(null),i=Object(d.a)(n,2),o=i[0],c=i[1];function l(){c(null)}var s=Boolean(o),m=s?"simple-popover":void 0;return r.a.createElement("div",{className:a.container},r.a.createElement(pe.a,{onClick:function(e){c(e.currentTarget)}}),r.a.createElement(ue.a,{PaperProps:{className:a.paper},id:m,open:s,anchorEl:o,onClose:l,onClick:l,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},r.a.createElement(b.a,{className:a.popoverContainer},t)))}var ge=a(189),be=(a(420),Object(p.a)(function(e){return Object(f.a)({mainContainer:{"& > div:not(:last-child)":{paddingBottom:e.spacing(3)},"& > div":{"& > div":{paddingTop:"0 !important"}},paddingBottom:e.spacing(9)},simulationContainer:{minHeight:"442px"},paper:{width:"100%",height:"100%",minHeight:310,backgroundColor:"#293640"},box:{padding:e.spacing(3,3)},boxButton:{padding:e.spacing(3,3)},boxHeader:{padding:e.spacing(3,3),height:e.spacing(10),display:"flex",alignItems:"center",borderBottom:"1px solid #313d47"},boxBorderBottom:{borderBottom:"1px solid #313d47"},initialRaise:{justifyContent:"space-between"},boxChart:{width:"100%",height:"100%",minHeight:310,maxHeight:350,padding:e.spacing(3,3),paddingRight:"5px",paddingLeft:"5px"},boxPlaceholder:{padding:e.spacing(3,3),display:"flex",height:"100%",alignItems:"center",justifyContent:"center",color:e.palette.text.secondary,opacity:.4},header:{backgroundColor:"#0b1216",color:"#f8f8f8",textAlign:"center",padding:e.spacing(3,0,16),marginBottom:-e.spacing(10)},button:{background:"linear-gradient(290deg, #1880e0, #3873d8)",color:"white"},descriptionContainer:{"& > div:not(:last-child)":{paddingBottom:e.spacing(1),marginBottom:e.spacing(1),borderBottom:"1px solid #3f5463"},"& td":{verticalAlign:"top",padding:e.spacing(.5)}},descriptionTitle:{fontWeight:e.typography.fontWeightBold,padding:e.spacing(.5)},descriptionName:{fontWeight:e.typography.fontWeightBold}})})),xe=[{name:"Initial raise",text:"Total funds raised in the hatch period of the ABC launch"},{name:"Allocation 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"},{name:"Hatch price",text:"The price paid per 'ABC token' by community members involved in hatching the project"},{name:"Post-hatch price",text:"The price of the 'ABC token' when the curve enters the open phase and is live for public participation"},{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"}],ve=[{name:"Total reserve",text:"Total DAI in the smart contract reserve at the end of the simulated period"},{name:"Funds generated from initial hatch",text:"Fraction of the funds (theta) raised during the hatch that go directly to the cause"},{name:"Funds generated from exit tributes",text:"Cumulative amount of exit tributes collected from only exit /sell transactions"},{name:"Average slippage",text:"Average of the slippage of each transaction occured during the simulation period"}];var Ee=a(190),ye=a.n(Ee),ke=a(191),je=Object(ke.a)({palette:{type:"dark",primary:{main:"#2ecd79"},secondary:{main:"#116be0",light:"#0f8bff",dark:"#116be0"},error:{main:ye.a.A400},background:{default:"#fff",paper:"#293640"},text:{primary:"#fff",secondary:"#9aa3ad"}},typography:{h6:{fontWeight:400}}});console.log(je);var Oe=je;o.a.render(r.a.createElement(l.a,{theme:Oe},r.a.createElement(c.a,null),r.a.createElement(function(){var e=Object(n.useState)({theta:.35,p0:.1,p1:.3,wFee:.05,d0:3e6}),t=Object(d.a)(e,2),a=t[0],i=t[1],o=a.d0,c=a.theta,l=a.p0,s=a.p1,p=a.wFee,f=Object(n.useMemo)(function(){return Object(ge.throttle)(i,250)},[]),y=q({d0:o,theta:c,p0:l,p1:s}),k=y.k,j=y.R0,C=y.V0,N=Object(n.useState)([0]),w=Object(d.a)(N,2),A=w[0],B=w[1],F=Object(n.useState)([0]),S=Object(d.a)(F,2),R=S[0],M=S[1],I=Object(n.useState)(j),T=Object(d.a)(I,2),H=T[0],L=T[1],V=Object(n.useState)(0),W=Object(d.a)(V,2),Y=W[0],Z=W[1],_=Object(n.useState)(0),ee=Object(d.a)(_,2),te=ee[0],ne=ee[1],ie=Object(n.useState)(0),oe=Object(d.a)(ie,2),ce=oe[0],le=oe[1],se=Object(n.useState)(!1),ue=Object(d.a)(se,2),de=ue[0],pe=ue[1],fe=Object(n.useState)(!1),Ee=Object(d.a)(fe,2),ye=Ee[0],ke=Ee[1];function je(){return(je=Object(u.a)(m.a.mark(function e(){return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return pe(!1),Z(0),B([0]),M([0]),ne(0),e.next=3,$(0);case 3:pe(!0);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}Object(n.useEffect)(function(){pe(!1)},[a]),Object(n.useEffect)(function(){var e=!0;function t(){return(t=Object(u.a)(m.a.mark(function t(){var a,n,r,i,o,c,l,s;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=[j],n=[G({R:j,V0:C,k:k})],r=[0],i=[],o=[],c=52,ke(!0),l=function(t){var c=Math.ceil(t<5?X(0,5):X(5,2*t)),l=X(.99,1.03),s=z(a),m=U({R:s,k:k,priceGrowth:l}),u=s+m,d=Q({sum:m,num:c}),f=K(d.map(function(e){return J({R:s,deltaR:e,V0:C,k:k})})),h=d.filter(function(e){return e<0}),g=-p*h.reduce(function(e,t){return e+t},0),b=d.reduce(function(e,t){return e+Math.abs(t)},0)/d.length;if(a.push(u),n.push(G({R:u,V0:C,k:k})),i.push(f),o.push(b),r.push(z(r)+g),Z(function(e){return e+h.length}),!de||!e)return"break"},s=0;case 9:if(!(s<c)){t.next=16;break}if("break"!==l(s)){t.next=13;break}return t.abrupt("break",16);case 13:s++,t.next=9;break;case 16:B(n),M(r),ne(K(i)),le(K(o)),L(z(a)),ke(!1);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}return de&&function(){t.apply(this,arguments)}(),function(){e=!1}},[de]);var Oe=[{label:"Total reserve",value:(+H.toPrecision(3)).toLocaleString()+" DAI"},{label:"Funds generated from initial hatch",value:Math.round(o*c).toLocaleString()+" DAI"},{label:"Funds generated from exit tributes (".concat(Y," txs)"),value:(+z(R).toPrecision(3)).toLocaleString()+" DAI"},{label:"Average slippage (avg tx size ".concat(Math.round(ce).toLocaleString()," DAI)"),value:+(100*te).toFixed(3)+"%"}],Ce=be();return r.a.createElement(r.a.Fragment,null,r.a.createElement("header",{className:Ce.header},r.a.createElement(h.a,{fixed:!0},r.a.createElement(O,null))),r.a.createElement(h.a,{fixed:!0,className:Ce.mainContainer},r.a.createElement(v.a,{container:!0,spacing:3},r.a.createElement(v.a,{item:!0,xs:12,sm:12,md:6,lg:4},r.a.createElement(x.a,{className:Ce.paper},r.a.createElement(b.a,{className:Ce.boxHeader},r.a.createElement(g.a,{variant:"h6"},"Curve Design"),r.a.createElement(he,{text:r.a.createElement("div",{className:Ce.descriptionContainer},r.a.createElement("div",null,r.a.createElement(g.a,{className:Ce.descriptionTitle},"Parameters description:")),r.a.createElement("table",null,r.a.createElement("tbody",null,xe.map(function(e){var t=e.name,a=e.text;return r.a.createElement("tr",{key:t},r.a.createElement("td",null,r.a.createElement(g.a,{className:Ce.descriptionName},t)),r.a.createElement("td",null,r.a.createElement(g.a,null,a)))}))))})),r.a.createElement(b.a,{className:"".concat(Ce.box," ").concat(Ce.boxBorderBottom)},r.a.createElement(P,{curveParams:a,setCurveParams:f})),r.a.createElement(b.a,{className:"".concat(Ce.boxHeader," ").concat(Ce.initialRaise)},r.a.createElement(g.a,{variant:"h6"},"Run parameters")),r.a.createElement(b.a,{className:Ce.box},r.a.createElement(D,{curveParams:a,setCurveParams:f})))),r.a.createElement(v.a,{item:!0,xs:12,sm:12,md:6,lg:8},r.a.createElement(x.a,{className:Ce.paper},r.a.createElement(b.a,{className:Ce.boxHeader},r.a.createElement(g.a,{variant:"h6"},"Preview"),r.a.createElement(he,{text:r.a.createElement(g.a,null,"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.")})),r.a.createElement(b.a,{className:Ce.boxChart},r.a.createElement(ae,{theta:c,d0:o,p0:l,p1:s}))))),r.a.createElement(v.a,{container:!0,spacing:3},r.a.createElement(v.a,{item:!0,xs:12,md:12},r.a.createElement(x.a,null,r.a.createElement(b.a,{className:Ce.boxHeader},r.a.createElement(v.a,{container:!0,direction:"row",justify:"center",alignItems:"center"},r.a.createElement(E.a,{variant:"contained",className:Ce.button,onClick:function(){return je.apply(this,arguments)},disabled:ye},"Run simulation")))))),r.a.createElement(v.a,{container:!0,spacing:3,className:Ce.simulationContainer},de?r.a.createElement(r.a.Fragment,null,r.a.createElement(v.a,{item:!0,xs:12,sm:12,md:6,lg:8},r.a.createElement(x.a,{className:Ce.paper},r.a.createElement(b.a,{className:Ce.boxHeader},r.a.createElement(g.a,{variant:"h6"},"Simulation"),r.a.createElement(he,{text:r.a.createElement(g.a,null,"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.")})),r.a.createElement(b.a,{className:Ce.boxChart},r.a.createElement(me,{priceTimeseries:A,withdrawFeeTimeseries:R,p0:l,p1:s})))),r.a.createElement(v.a,{item:!0,xs:12,sm:12,md:6,lg:4},r.a.createElement(x.a,{className:Ce.paper},r.a.createElement(b.a,{className:Ce.boxHeader},r.a.createElement(g.a,{variant:"h6"},"Results"),r.a.createElement(he,{text:r.a.createElement("div",{className:Ce.descriptionContainer},r.a.createElement("div",null,r.a.createElement(g.a,{className:Ce.descriptionTitle},"Result parameters description:")),r.a.createElement("table",null,r.a.createElement("tbody",null,ve.map(function(e){var t=e.name,a=e.text;return r.a.createElement("tr",{key:t},r.a.createElement("td",null,r.a.createElement(g.a,{className:Ce.descriptionName},t)),r.a.createElement("td",null,r.a.createElement(g.a,null,a)))}))))})),r.a.createElement(b.a,{className:Ce.box},r.a.createElement(re,{resultFields:Oe}))))):r.a.createElement(v.a,{item:!0,xs:12},r.a.createElement(x.a,{className:Ce.paper},r.a.createElement(b.a,{className:Ce.boxPlaceholder},r.a.createElement(g.a,{variant:"h6"},"Run a simulation to see results")))))))},null)),document.querySelector("#root"))}},[[225,1,2]]]);
//# sourceMappingURL=main.0bbff1ff.chunk.js.map