(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:ee*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];r1||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 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