(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(65),m=a.n(s),u=a(118),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(84),N=a(192),w=a(463),A=a(175),B=a.n(A),S=a(7),F=a(468),R=Object(S.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}})(F.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 V=a(23),H=a(15);function L(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=ae(e,t)),r*=t-e,r+=e}function ne(e){var t=Math.floor(e.length/2),a=Object(q.a)(e).sort(function(e,t){return e-t});return e.length%2!==0?a[t]:(a[t-1]+a[t])/2}var re=a(193),ie="x",oe="Supply (tokens) / Reserve (DAI)",ce=Object(p.a)(function(e){return Object(f.a)({tooltip:{border:"1px solid #313d47",backgroundColor:"#384b59",padding:e.spacing(1),color:"#c7ccd2"}})});var le=function(e){for(var t=e.theta,a=G({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(V.a)(E,ie,y),Object(V.a)(E,oe,s(y)),E))}var k=Object(re.a)(),j=ce(),O=function(e){return(+(e/g).toPrecision(2)).toLocaleString()};return r.a.createElement(H.f,{debounce:1},r.a.createElement(H.b,{width:0,height:400,data:x,margin:{top:10,right:30,left:0,bottom:0}},r.a.createElement(H.c,{strokeDasharray:"3 3"}),r.a.createElement(H.h,{interval:24,dataKey:ie,tickFormatter:O,unit:b,tick:{fill:k.palette.text.secondary},stroke:k.palette.text.secondary}),r.a.createElement(H.i,{interval:"preserveStartEnd",ticks:W(x.map(function(e){return e[oe]}),3),tickFormatter:O,unit:b,tick:{fill:k.palette.text.secondary},domain:[0,s(m)],stroke:k.palette.text.secondary}),r.a.createElement(H.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=X({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(H.a,{isAnimationActive:!1,type:"monotone",dataKey:oe,stroke:k.palette.primary.main,fill:k.palette.primary.main,fillOpacity:.3,strokeWidth:2}),r.a.createElement(H.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(H.d,{formatter:function(e){return r.a.createElement("span",{style:{color:k.palette.text.secondary}},e)}})))},se=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 me(e){var t=e.resultFields,a=se();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 ue="x",de="Price (DAI/token)",pe="Total exit tributes (DAI)",fe="Floor price (DAI/token)",he=Object(p.a)(function(e){return Object(f.a)({tooltip:{border:"1px solid #313d47",backgroundColor:"#384b59",padding:e.spacing(1),color:"#c7ccd2"}})});var ge=function(e){for(var t=e.priceTimeseries,a=e.withdrawFeeTimeseries,n=e.floorpriceTimeseries,i=e.p0,o=e.p1,c=[],l=0;l 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},descriptionPadding:{padding:e.spacing(.5)}})})),Oe=[{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"}],Ce=[{name:"Price",text:"Price of the token over time."},{name:"Floor price",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"},{name:"Total exit tributes",text:"Cumulative sum of exit tributes collected from only exit /sell transactions"}],Ne=[{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 (analytic result)"},{name:"Funds generated from exit tributes",text:"Cumulative sum 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 we=a(190),Ae=a.n(we),Be=a(191),Se=Object(Be.a)({palette:{type:"dark",primary:{main:"#2ecd79"},secondary:{main:"#116be0",light:"#0f8bff",dark:"#116be0"},error:{main:Ae.a.A400},background:{default:"#fff",paper:"#293640"},text:{primary:"#fff",secondary:"#9aa3ad"}},typography:{h6:{fontWeight:400}}});console.log(Se);var Fe=Se;o.a.render(r.a.createElement(l.a,{theme:Fe},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(ke.throttle)(i,250)},[]),y=G({d0:o,theta:c,p0:l,p1:s}),k=y.k,j=y.R0,C=y.S0,N=y.V0,w=Object(n.useState)([0]),A=Object(d.a)(w,2),B=A[0],S=A[1],F=Object(n.useState)([0]),R=Object(d.a)(F,2),M=R[0],I=R[1],T=Object(n.useState)([0]),V=Object(d.a)(T,2),H=V[0],L=V[1],W=Object(n.useState)(j),q=Object(d.a)(W,2),ae=q[0],re=q[1],ie=Object(n.useState)(0),oe=Object(d.a)(ie,2),ce=oe[0],se=oe[1],ue=Object(n.useState)(0),de=Object(d.a)(ue,2),pe=de[0],fe=de[1],he=Object(n.useState)(0),be=Object(d.a)(he,2),xe=be[0],ve=be[1],Ee=Object(n.useState)(!1),we=Object(d.a)(Ee,2),Ae=we[0],Be=we[1],Se=Object(n.useState)(!1),Fe=Object(d.a)(Se,2),Re=Fe[0],Me=Fe[1];function Ie(){return(Ie=Object(u.a)(m.a.mark(function e(){return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Be(!1),se(0),S([0]),I([0]),fe(0),e.next=3,$(0);case 3:Be(!0);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}Object(n.useEffect)(function(){Be(!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,u,d,f;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=[j],n=[C],r=[X({R:j,V0:N,k:k})],i=[0],o=[],c=[],l=[C],s=[],u=52,Me(!0),d=function(t){var m=te(5,2*t+5),u=z(a),d=z(n),f=z(l),h=void 0;if(f>d)h=1;else{var g=J({S:d-f,V0:N,k:k})/u;h=Math.max(1-g,.97)}var b=te(h,1.04),x=Z({R:u,k:k,priceGrowth:b}),v=u+x,E=_({sum:x,num:m,spread:10}),y=ne(E.map(function(e){return Y({R:u,deltaR:e,V0:N,k:k})})),j=E.filter(function(e){return e<0}),O=-p*j.reduce(function(e,t){return e+t},0),w=f-ee({week:t,H:f,halflife:52,cliff:8}),A=U({R:u,V0:N,k:k}),B=Q({S:A,H:C-w,V0:N,k:k}),S=ne(j);if(a.push(v),n.push(A),l.push(w),r.push(X({R:v,V0:N,k:k})),o.push(y),c.push(S),i.push(z(i)+O),s.push(B),se(function(e){return e+j.length}),!Ae||!e)return"break"},f=0;case 17:if(!(f