(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[988],{1077:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/defichain/dtoken-stats",function(){return t(3243)}])},6745:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var o=t(5893),r=(t(9085),t(5430));function l(e){var n=e.disabled,t=e.chartData,l=e.small;return(0,o.jsx)("div",{className:"flex flex-col gap-8 items-center ".concat(l?"w-32":"w-64"),children:(0,o.jsx)(r.$I,{className:"self-center",data:function(){var e=t;return n&&(e.datasets=e.datasets.map((function(e){return e.backgroundColor=["#333"],e}))),e}(),options:{cutout:"66%",elements:{arc:{borderWidth:0}},plugins:{legend:{display:!1,labels:{color:"#fff",usePointStyle:!0}}},resizeDelay:500,events:n?[]:void 0}})})}},5:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var o=t(5893);function r(e){var n=e.item,t=e.isSelected,r=e.onClick,l=e.big,a=e.nonSelectedBg;return(0,o.jsx)("button",{type:"button",onClick:r,className:"".concat(l?"rounded-md flex-grow":"gap-2 rounded-lg items-center"," ").concat(t?"bg-main":null!==a&&void 0!==a?a:"bg-light"),children:(0,o.jsx)("p",{className:l?"text-center":"text-white px-2 py-1 text-sm",children:n})})}function l(e){var n=e.items,t=e.onChanged,l=e.selectedItem,a=e.border;return(0,o.jsx)("div",{className:"flex flex-row flex-wrap gap-2 ".concat(a?"justify-evenly p-1 rounded-lg border border-white":"justify-start"),children:n.map((function(e,n){return(0,o.jsx)(r,{item:e,isSelected:e===l,onClick:function(){return function(e){t(e)}(e)},big:a,nonSelectedBg:a?"bg-none":"bg-light"},n)}))})}},564:function(e,n,t){"use strict";t.d(n,{j:function(){return a}});var o=t(5893),r=t(7814),l=t(9417);function a(e){var n=e.type,t=e.text,a=e.add,i=e.variableHeight,u=e.children,d=function(){switch(n){case"info":return l.DBf;case"warn":return l.ik8;case"add":return l.EQ8;default:return l.Psp}},s=function(){switch(n){case"info":return"#40869b";case"warn":return"#cca300";case"add":return"#ff00af";default:return"#fff"}},c="add"!==n?i?"gap-4 md:flex-nowrap":"gap-4 md:flex-nowrap md:h-12":"",f=i||"wrapper"===n||"wrapper-between"===n?"":"pr-9",p="wrapper"===n?"justify-center flex-wrap":"wrapper-between"===n?"justify-between flex-wrap":"";return(0,o.jsx)("div",{className:"w-full ".concat(f),children:(0,o.jsx)("div",{className:"".concat(function(){switch(n){case"info":return"bg-infoOld-base";case"warn":return"bg-warnOld-base";case"wrapper":case"wrapper-between":return"bg-light";default:return""}}()," ").concat(function(){switch(n){case"info":case"warn":return"outline outline-light outline-1";case"add":return"outline-dashed outline-light outline-2";default:return""}}()," flex flex-row rounded-lg items-center py-4 px-2 ").concat(c," ").concat(p),children:"wrapper"===n||"wrapper-between"===n?u:(0,o.jsx)(o.Fragment,{children:"add"===n?(0,o.jsx)("button",{className:"w-full",onClick:a,children:(0,o.jsx)(r.G,{icon:d(),size:"xl",color:s()})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.G,{className:"ml-3",icon:d(),size:"xl",color:s()}),(0,o.jsx)("p",{className:"text-light mx-auto",children:t})]})})})})}},3492:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var o=t(6042),r=t(9396),l=t(5893),a=(t(9085),t(7294)),i=t(5430),u=t(6652),d=t(4288),s=t(7814);function c(e){var n=e.item,t=e.isSelected,o=e.onClick;return(0,l.jsxs)("button",{type:"button",onClick:o,className:"flex flex-row gap-2 items-center",children:[(0,l.jsx)(s.G,{className:"pt-0.5",icon:t?d.W3K:d.diR,size:"sm",color:"#ff00af"}),(0,l.jsx)("p",{children:n.label})]})}function f(e){var n=e.items,t=e.onChanged,o=e.preselectIndex,r=(0,a.useState)(o),i=r[0],u=r[1];return(0,l.jsx)("div",{className:"flex flex-col gap-2 justify-start",children:n.map((function(e,n){return(0,l.jsx)(c,{item:e,isSelected:n===i,onClick:function(){return function(e){u(e),t(e)}(n)}},n)}))})}var p=t(5);function m(e){var n=e.history,t=e.items,o=e.toLineChartData,r=e.toScales,d=e.additionalHistory,s=(e.showZeroLine,(0,a.useState)(t[0])),c=s[0],m=s[1],v=(0,a.useState)(u.Gk.ALL),h=v[0],D=v[1];return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-2 md:pl-14",children:[(0,l.jsx)("p",{children:"Shown time frame:"}),(0,l.jsx)(p.Z,{items:Object.values(u.Gk),onChanged:function(e){return D(e)},selectedItem:h})]}),(0,l.jsxs)("div",{className:"flex flex-row flex-wrap items-start justify-between",children:[(0,l.jsx)(i.x1,{className:"self-center",data:o(n,{type:c.type,timeFrame:h},d),options:b(r(c.type),c.showZeroLine)}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 pl-10",children:[(0,l.jsx)("h3",{className:"text-white",children:"History of"}),(0,l.jsx)(f,{items:t,onChanged:function(e){return m(t[e])},preselectIndex:0})]})]})]})}function b(e,n){var t={responsive:!0,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,color:"#fff"}},annotation:{}},scales:e};return n&&(t=(0,r.Z)((0,o.Z)({},t),{plugins:(0,r.Z)((0,o.Z)({},t.plugins),{annotation:{annotations:{zeroLine:{type:"line",yMin:0,yMax:0,borderColor:"rgb(255, 255, 255)",borderWidth:1}}}})})),t}},3230:function(e,n,t){"use strict";t.d(n,{S:function(){return r}});var o=t(5893);function r(e){var n=e.entry,t=e.index,r=e.labels,l=e.percentages,a=e.colors,i=e.isLast,u=e.showPercentage;return(0,o.jsxs)("div",{className:"table-row",children:[(0,o.jsx)("div",{className:"table-cell text-left py-1".concat(i?"":" border-b border-b-light").concat(t>0?" border-r border-r-light":""),children:(0,o.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[0!==t&&(0,o.jsx)("div",{className:"w-1 h-4",style:{backgroundColor:a[t]}}),r[t]]})}),u&&(0,o.jsx)("div",{className:"table-cell text-center align-middle".concat(i?"":" border-b border-b-light").concat(t>0?" border-r border-r-light":""),children:t>0&&l[t].length>0?"".concat(l[t],"%"):""}),(0,o.jsx)("div",{className:"table-cell text-right align-middle".concat(i?"":" border-b border-b-light"),children:n})]})}},1853:function(e,n,t){"use strict";function o(e){switch(e){case"DFI":return"#ff00af";case"BTC":return"#F7931A";case"ETH":return"#627EEA";case"BCH":return"#0AC18E";case"LTC":return"#345D9D";case"DOGE":return"#F3EDD6";case"DUSD":return"#FFCCEF";case"USDC":return"#2775CA";case"USDT":return"#26A17B";case"EUROC":return"#F5F5F5";case"DOT":return"#E6007A";case"MATIC":return"#8247E5";case"SOL":return"#9945FF";case"SUI":return"#4CA2FF";case"XCHF":return"#CE0E2D";case"Unused":return"#222";default:return"#444444"}}function r(e,n){return"#"+e.replace(/^#/,"").replace(/../g,(function(e){return("0"+Math.min(255,Math.max(0,parseInt(e,16)+n)).toString(16)).slice(-2)}))}t.d(n,{R:function(){return r},m:function(){return o}})},3243:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return g},default:function(){return y}});var o,r,l=t(5893),a=t(5952),i=t(794),u=t(6652),d=t(1853),s=t(381),c=t.n(s);function f(e){return e?e.minted.chainReported-e.minted.loans-e.openinterest-e.burn.futureswap-e.burn.other:0}!function(e){e.DISTRIBUTION="DISTRIBUTION",e.FUTURESWAP="FUTURESWAP",e.ALGO="ALGO",e.BACKED="BACKED",e.RATIO="RATIO",e.ALGO_NUMBER="ALGO NUMBER",e.ALGO_NUMBER_TO_VALUE="ALGO NUMBER TO VALUE"}(o||(o={})),function(e){e.VOLUME="VOLUME",e.CIRCULATING_SUPPLY="CIRCULATING SUPPLY",e.DISTRIBUTION="DUSD DISTRIBUTION"}(r||(r={}));var p={light:{mint:"#00eeee",burn:"#ff2e22"},dark:{mint:"#00aaaa",burn:"#cc241b"},collateral:"#0dacde",gatewayPools:"#cd0c60",yieldVault:"#6a5df2",stakeX:"#76ff03",stakeXLoop:"#00d0e8",bond1Y:"#FDDC5C",bond2Y:"#f5bf03",dmc:"#0964F4"};function m(e,n){var t=n.type,l=n.timeFrame,a=(0,u.cD)(function(e,n){return e}(e),l),s=[];switch(t){case r.CIRCULATING_SUPPLY:var m,v,h,D;s.push({label:"Algo DUSD",data:a.map((function(e){return f(b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))})),color:(0,d.m)("dToken")}),s.push({label:"Backed DUSD",data:a.map((function(e){var n,t;return(null!==(m=null===(n=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.minted.loans)&&void 0!==m?m:0)+(null!==(v=null===(t=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===t?void 0:t.openinterest)&&void 0!==v?v:0)})),color:(0,d.m)("DUSD")}),s.push({label:"Total DUSD",data:a.map((function(e){var n,t;return f(b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))+(null!==(h=null===(n=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.minted.loans)&&void 0!==h?h:0)+(null!==(D=null===(t=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===t?void 0:t.openinterest)&&void 0!==D?D:0)})),color:"#fff"});break;case o.ALGO:s.push({label:"Algo DUSD",data:a.map((function(e){return f(b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))})),color:(0,d.m)("DUSD")}),s.push({label:"Algo dToken",data:a.map((function(e){return b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0)})),color:(0,d.m)("dToken")}),s.push({label:"Algo combined",data:a.map((function(e){return b(e,l).dTokens.map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0)})),color:"#fff"});break;case o.BACKED:var w,k;s.push({label:"Backed DUSD",data:a.map((function(e){var n,t;return(null!==(w=null===(n=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.minted.loans)&&void 0!==w?w:0)+(null!==(k=null===(t=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===t?void 0:t.openinterest)&&void 0!==k?k:0)})),color:(0,d.m)("DUSD")}),s.push({label:"Backed dToken",data:a.map((function(e){return b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return(e.minted.loans+e.openinterest)*e.price})).reduce((function(e,n){return e+n}),0)})),color:(0,d.m)("dToken")}),s.push({label:"Backed combined",data:a.map((function(e){return b(e,l).dTokens.map((function(e){return(e.minted.loans+e.openinterest)*e.price})).reduce((function(e,n){return e+n}),0)})),color:"#fff"});break;case o.RATIO:s.push({label:"DUSD",data:a.map((function(e){var n,t,o=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})),r=f(o),a=(null!==(n=null===o||void 0===o?void 0:o.minted.loans)&&void 0!==n?n:0)+(null!==(t=null===o||void 0===o?void 0:o.openinterest)&&void 0!==t?t:0);return new i.Z(r).dividedBy(r+a).multipliedBy(100).decimalPlaces(2).toNumber()})),color:(0,d.m)("DUSD")}),s.push({label:"dToken",data:a.map((function(e){var n=b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})),t=n.map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0),o=n.map((function(e){return(e.minted.loans+e.openinterest)*e.price})).reduce((function(e,n){return e+n}),0);return new i.Z(t).dividedBy(t+o).multipliedBy(100).decimalPlaces(2).toNumber()})),color:(0,d.m)("dToken")}),s.push({label:"Combined",data:a.map((function(e){var n=b(e,l).dTokens.map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0),t=b(e,l).dTokens.map((function(e){return(e.minted.loans+e.openinterest)*e.price})).reduce((function(e,n){return e+n}),0);return new i.Z(n).dividedBy(n+t).multipliedBy(100).decimalPlaces(2).toNumber()})),color:"#fff"});break;case o.FUTURESWAP:var g,y;s.push({label:"Minted DUSD",data:a.map((function(e){var n;return null!==(g=null===(n=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.minted.futureswap)&&void 0!==g?g:0})),color:p.light.mint}),s.push({label:"Minted dToken",data:a.map((function(e){return b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return e.minted.futureswap*e.price})).reduce((function(e,n){return e+n}),0)})),color:p.dark.mint}),s.push({label:"Burned DUSD",data:a.map((function(e){var n;return null!==(y=null===(n=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.burn.futureswap)&&void 0!==y?y:0})),color:p.light.burn}),s.push({label:"Burned dToken",data:a.map((function(e){return b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return e.burn.futureswap*e.price})).reduce((function(e,n){return e+n}),0)})),color:p.dark.burn}),s.push({label:"Delta",data:a.map((function(e){var n,t,o=b(e,l).dTokens.find((function(e){return"DUSD"===e.key})),r=b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return e.minted.futureswap*e.price})).reduce((function(e,n){return e+n}),0),a=b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return e.burn.futureswap*e.price})).reduce((function(e,n){return e+n}),0);return(null!==(n=null===o||void 0===o?void 0:o.minted.futureswap)&&void 0!==n?n:0)+r-(null!==(t=null===o||void 0===o?void 0:o.burn.futureswap)&&void 0!==t?t:0)-a})),color:"#fff"}),s.push({label:"dUSD delta",data:a.map((function(e){var n,t,o=b(e,l).dTokens.find((function(e){return"DUSD"===e.key}));return(null!==(n=null===o||void 0===o?void 0:o.minted.futureswap)&&void 0!==n?n:0)-(null!==(t=null===o||void 0===o?void 0:o.burn.futureswap)&&void 0!==t?t:0)})),color:"#999"});break;case o.ALGO_NUMBER:s.push({label:"# Algo dToken",data:a.map((function(e){return b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return f(e)})).reduce((function(e,n){return e+n}),0)})),color:(0,d.m)("dToken")});break;case o.ALGO_NUMBER_TO_VALUE:s.push({label:"Ratio",data:a.map((function(e){var n=f(b(e,l).dTokens.find((function(e){return"DUSD"===e.key}))),t=b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return f(e)})).reduce((function(e,n){return e+n}),0),o=b(e,l).dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0),r=new i.Z(n).plus(t),a=new i.Z(n).plus(o);return r.dividedBy(a).toNumber()})),color:"#fff"});break;case r.VOLUME:var S,T,U,x,N,L,j;s.push({label:"Buys",data:null!==(S=null===a||void 0===a?void 0:a.map((function(e){return new i.Z(b(e,l).dusdVolume.organic.buying).plus(b(e,l).dusdVolume.bots.buying).decimalPlaces(2).toNumber()})))&&void 0!==S?S:[],color:p.light.mint}),s.push({label:"Sells (effective)",data:null!==(U=null===a||void 0===a?void 0:a.map((function(e){return new i.Z(b(e,l).dusdVolume.organic.selling).plus(b(e,l).dusdVolume.bots.selling).multipliedBy(new i.Z(1).minus(null!==(T=b(e,l).dusdVolume.fee)&&void 0!==T?T:.3)).negated().decimalPlaces(2).toNumber()})))&&void 0!==U?U:[],color:p.light.burn}),s.push({label:"DEX fee",data:null!==(N=null===a||void 0===a?void 0:a.map((function(e){return new i.Z(b(e,l).dusdVolume.organic.selling).plus(b(e,l).dusdVolume.bots.selling).multipliedBy(null!==(x=b(e,l).dusdVolume.fee)&&void 0!==x?x:.3).negated().decimalPlaces(2).toNumber()})))&&void 0!==N?N:[],color:p.dark.burn}),s.push({label:"Effective delta",data:null!==(j=null===a||void 0===a?void 0:a.map((function(e){return new i.Z(b(e,l).dusdVolume.organic.buying).plus(b(e,l).dusdVolume.bots.buying).minus(new i.Z(b(e,l).dusdVolume.organic.selling).plus(b(e,l).dusdVolume.bots.selling).multipliedBy(new i.Z(1).minus(null!==(L=b(e,l).dusdVolume.fee)&&void 0!==L?L:.3))).decimalPlaces(2).toNumber()})))&&void 0!==j?j:[],color:"#fff"});break;case r.DISTRIBUTION:var I,A,B,C,O,Z,E,V,P,R;s.push({label:"Collateral",data:null!==(A=null===a||void 0===a?void 0:a.map((function(e){var n,t;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.collateral).plus(null!==(I=null===(t=b(e,l).dusdDistribution)||void 0===t?void 0:t.stakeXLoop)&&void 0!==I?I:0).toNumber()})))&&void 0!==A?A:[],color:p.collateral}),s.push({label:"StakeX TVL",data:null!==(B=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.stakeXTVL).toNumber()})))&&void 0!==B?B:[],color:p.stakeX}),s.push({label:"DMC",data:null!==(C=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.otherOnDMC).toNumber()})))&&void 0!==C?C:[],color:p.dmc}),s.push({label:"Bond 1Y TVL",data:null!==(O=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.tvlBond1).toNumber()})))&&void 0!==O?O:[],color:p.bond1Y}),s.push({label:"Bond 2Y TVL",data:null!==(Z=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.tvlBond2).toNumber()})))&&void 0!==Z?Z:[],color:p.bond2Y}),s.push({label:"Gateway pools",data:null!==(E=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.gatewayPools).toNumber()})))&&void 0!==E?E:[],color:p.gatewayPools}),s.push({label:"dToken pools",data:null!==(V=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.dTokenPools).toNumber()})))&&void 0!==V?V:[],color:(0,d.m)("dToken")}),s.push({label:"YieldVault addresses",data:null!==(P=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.yieldVault).toNumber()})))&&void 0!==P?P:[],color:p.yieldVault}),s.push({label:"Free (approx.)",data:null!==(R=null===a||void 0===a?void 0:a.map((function(e){var n;return new i.Z(null===(n=b(e,l).dusdDistribution)||void 0===n?void 0:n.free).toNumber()})))&&void 0!==R?R:[],color:(0,d.m)("DUSD")})}return{labels:a.map((function(e){return c()(e.meta.tstamp).utc().format("DD-MM-YYYY")})),datasets:s.map((function(e){return{label:e.label,data:e.data.map((function(e){return 0!==(n=e)?n:NaN;var n})),borderColor:[e.color],backgroundColor:[e.color],hoverOffset:4}}))}}function b(e,n){return!e.avg7days||n!==u.Gk.ALL&&n!==u.Gk.THREE_MONTHS?e:e.avg7days}function v(e){}var h=t(6745),D=t(564),w=t(3492),k=t(3230),g=!0,y=function(e){var n,t,s=e.statistics,c=e.history,b=[{title:"Distribution",type:o.DISTRIBUTION,inDollar:!1,sort:!1,customAlgo:!0,showOverlay:!0,showTotal:!1,showLine:!1,calculateDelta:!1,keywords:["algo","backed"],customDeltaLabel:void 0,specialDusdDelta:!1},{title:"FutureSwap",type:o.FUTURESWAP,inDollar:!1,sort:!1,customAlgo:!1,showOverlay:!1,showTotal:!1,showLine:!0,calculateDelta:!0,keywords:["Mint","Burn"],customDeltaLabel:void 0,specialDusdDelta:!0},{title:"dUSD Volume",type:r.VOLUME,inDollar:!1,sort:!1,customAlgo:!1,showOverlay:!1,showTotal:!1,showLine:!0,calculateDelta:!0,keywords:["Buys","Sells"],customDeltaLabel:"Effective delta",specialDusdDelta:!1},{title:"dUSD circulating supply",type:r.CIRCULATING_SUPPLY,inDollar:!1,sort:!1,customAlgo:!1,showOverlay:!1,showTotal:!0,showLine:!1,calculateDelta:!1,keywords:[],customDeltaLabel:void 0,specialDusdDelta:!1},{title:"dUSD distribution",type:r.DISTRIBUTION,inDollar:!1,sort:!0,customAlgo:!1,showOverlay:!1,showTotal:!0,showLine:!1,calculateDelta:!1,keywords:[],customDeltaLabel:void 0,specialDusdDelta:!1}],g=[{label:"Algo",type:o.ALGO},{label:"Backed",type:o.BACKED},{label:"Algo Ratio",type:o.RATIO},{label:"FutureSwap",type:o.FUTURESWAP},{label:"# of Algo dTokens",type:o.ALGO_NUMBER},{label:"dUSD Volume",type:r.VOLUME,showZeroLine:!0},{label:"dUSD Supply",type:r.CIRCULATING_SUPPLY},{label:"dUSD Distribution",type:r.DISTRIBUTION}],y="Displayed values were taken at block ".concat(s.meta.analysedAt,". Shown values are measured in respective oracles prices (1 DUSD = 1$). Displayed future swap prices are current oracle prices and not at the time where the mint or burn occurred. If delta is positive for FutureSwap it means that it created (minted) additional tokens. If delta is negative it means that it destroyed (burned) additional tokens. Additional the dUSD volume was gathered between blocks ").concat(s.meta.startHeight," and ").concat(s.meta.endHeight,". Disclaimer: No warranty of displayed data.");return(0,l.jsxs)(a.Z,{page:"dToken stats",full:!0,maxWidth:!0,withoutSupport:!0,children:[(0,l.jsx)("h1",{children:"dToken stats"}),(0,l.jsxs)("div",{className:"flex flex-row flex-wrap py-8 gap-16 flex-grow justify-center items-start w-full",children:[(0,l.jsxs)("div",{className:"max-w-lg flex flex-col gap-2",children:[(0,l.jsx)("p",{children:"As a short explanation on how we as a community and blockchain drifted into such a situation with such high algo ratios."}),(0,l.jsx)("p",{children:"In the beginning of the dToken system we had a big premium of 25 to 50% on dUSD and dToken. In order to reduce this premium, the community decided via Twitter Spaces that we should use DFI to payback dUSD loans. DFI at this time was between 3 and 5$."}),(0,l.jsxs)("p",{children:["Those DFI got burned and created the first algo dUSD. Total created dUSD via this mechanism were"," ",(0,u.uf)(null!==(t=null===(n=s.dTokens.find((function(e){return"DUSD"===e.key})))||void 0===n?void 0:n.minted.dfipayback)&&void 0!==t?t:0),". This mechanism got turned off."]}),(0,l.jsx)("p",{children:"To keep the dToken premium within a range of +/-5%, the FutureSwap (FS) was created which swaps dUSD to dToken and back. Since this could create algo dUSD (more dUSD minted than burned) over time, we created this page to show the current state."}),(0,l.jsx)("p",{children:"In the following graphs if the delta of FS shows a positive number it means it created more algo tokens than it burned. If the delta of FS shows a negative number it means it burned more token than it created."})]}),(0,l.jsx)(D.j,{type:"info",text:y,variableHeight:!0}),b.map((function(e,n){var t=function(e,n){var t=n.type,l=n.sort,a=[];switch(t){case o.DISTRIBUTION:var u,s,c=e.dTokens.find((function(e){return"DUSD"===e.key})),m=f(c),b=(null!==(u=null===c||void 0===c?void 0:c.minted.loans)&&void 0!==u?u:0)+(null!==(s=null===c||void 0===c?void 0:c.openinterest)&&void 0!==s?s:0),v=e.dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return f(e)*e.price})).reduce((function(e,n){return e+n}),0),h=e.dTokens.filter((function(e){return"DUSD"!==e.key})).map((function(e){return(e.minted.loans+e.openinterest)*e.price})).reduce((function(e,n){return e+n}),0);a.push({label:"algo DUSD",data:m,color:(0,d.m)("DUSD")}),a.push({label:"algo dToken",data:v,color:(0,d.m)("dToken")}),a.push({label:"",data:Math.abs(m+v-(b+h)),color:"#111"}),a.push({label:"backed dToken",data:h,color:(0,d.m)("dToken")}),a.push({label:"backed DUSD",data:b,color:(0,d.m)("DUSD")});break;case o.FUTURESWAP:var D,w,k=e.dTokens.find((function(e){return"DUSD"===e.key})),g=e.dTokens.filter((function(e){return"DUSD"!==e.key}));a.push({label:"Minted dUSD",data:null!==(D=null===k||void 0===k?void 0:k.minted.futureswap)&&void 0!==D?D:0,color:p.light.mint}),a.push({label:"Minted dToken",data:g.map((function(e){return e.minted.futureswap*e.price})).reduce((function(e,n){return e+n}),0),color:p.dark.mint}),a.push({label:"Burned dUSD",data:null!==(w=null===k||void 0===k?void 0:k.burn.futureswap)&&void 0!==w?w:0,color:p.light.burn}),a.push({label:"Burned dToken",data:g.map((function(e){return e.burn.futureswap*e.price})).reduce((function(e,n){return e+n}),0),color:p.dark.burn});break;case r.VOLUME:var y,S;a.push({label:"Buys",data:new i.Z(e.dusdVolume.organic.buying).plus(e.dusdVolume.bots.buying).decimalPlaces(2).toNumber(),color:p.light.mint}),a.push({label:"",data:new i.Z(e.dusdVolume.organic.buying).plus(e.dusdVolume.bots.buying).minus(e.dusdVolume.organic.selling).minus(e.dusdVolume.bots.selling).abs().decimalPlaces(2).toNumber(),color:"#111"}),a.push({label:"DEX fee",data:new i.Z(e.dusdVolume.organic.selling).plus(e.dusdVolume.bots.selling).multipliedBy(null!==(y=e.dusdVolume.fee)&&void 0!==y?y:.3).decimalPlaces(2).toNumber(),color:p.dark.burn}),a.push({label:"Sells (effective)",data:new i.Z(e.dusdVolume.organic.selling).plus(e.dusdVolume.bots.selling).multipliedBy(new i.Z(1).minus(null!==(S=e.dusdVolume.fee)&&void 0!==S?S:.3)).decimalPlaces(2).toNumber(),color:p.light.burn});break;case r.CIRCULATING_SUPPLY:var T,U,x=e.dTokens.find((function(e){return"DUSD"===e.key})),N=f(x),L=(null!==(T=null===x||void 0===x?void 0:x.minted.loans)&&void 0!==T?T:0)+(null!==(U=null===x||void 0===x?void 0:x.openinterest)&&void 0!==U?U:0);a.push({label:"backed DUSD",data:L,color:(0,d.m)("DUSD")}),a.push({label:"algo DUSD",data:N,color:(0,d.m)("dToken")});break;case r.DISTRIBUTION:a.push({label:"Collateral",data:new i.Z(e.dusdDistribution.collateral).plus(e.dusdDistribution.stakeXLoop).toNumber(),color:p.collateral}),a.push({label:"StakeX TVL",data:new i.Z(e.dusdDistribution.stakeXTVL).toNumber(),color:p.stakeX}),a.push({label:"DMC",data:new i.Z(e.dusdDistribution.otherOnDMC).toNumber(),color:p.dmc}),a.push({label:"Bond 1Y TVL",data:new i.Z(e.dusdDistribution.tvlBond1).toNumber(),color:p.bond1Y}),a.push({label:"Bond 2Y TVL",data:new i.Z(e.dusdDistribution.tvlBond2).toNumber(),color:p.bond2Y}),a.push({label:"Gateway pools",data:new i.Z(e.dusdDistribution.gatewayPools).toNumber(),color:p.gatewayPools}),a.push({label:"dToken pools",data:new i.Z(e.dusdDistribution.dTokenPools).toNumber(),color:(0,d.m)("dToken")}),a.push({label:"YieldVault addresses",data:new i.Z(e.dusdDistribution.yieldVault).toNumber(),color:p.yieldVault}),a.push({label:"Free (approx.)",data:new i.Z(e.dusdDistribution.free).toNumber(),color:(0,d.m)("DUSD")})}return l&&(a=a.sort((function(e,n){return n.data-e.data}))),{labels:a.map((function(e){return e.label})),datasets:[{data:a.map((function(e){return e.data})),backgroundColor:a.map((function(e){return e.color})),hoverOffset:4}]}}(s,e),a=(0,u.JD)(t,e,e.showTotal,e.customAlgo,e.calculateDelta,e.keywords,void 0,e.customDeltaLabel,e.specialDusdDelta),c=a.content,m=a.labels,b=a.percentages,v=a.colors;return(0,l.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,l.jsx)("h3",{children:e.title}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(h.Z,{chartData:t}),e.showOverlay&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"absolute top-28 right-[8.5rem] text-end",children:e.keywords[1]}),(0,l.jsx)("div",{className:"bg-white w-[1px] absolute inset-0 left-32"}),(0,l.jsx)("p",{className:"absolute top-28 left-36 text-start",children:e.keywords[0]})]}),e.showLine&&(0,l.jsx)("div",{className:"bg-white w-[1px] absolute inset-0 left-32"})]}),(0,l.jsx)("div",{className:"table table-fixed min-w-full",children:c.map((function(n,t){return m[t].length>0?(0,l.jsx)(k.S,{entry:n,index:t,labels:m,percentages:b,colors:v,isLast:t===c.length-1,showPercentage:e.type!==r.VOLUME},t):null}))})]},n)}))]}),(0,l.jsx)(w.Z,{history:c,items:g,toLineChartData:m,toScales:v})]})}},9815:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var o=t(943);var r=t(3375);var l=t(1566);function a(e){return function(e){if(Array.isArray(e))return(0,o.Z)(e)}(e)||(0,r.Z)(e)||(0,l.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}},function(e){e.O(0,[976,885,423,176,403,953,615,774,888,179],(function(){return n=1077,e(e.s=n);var n}));var n=e.O();_N_E=n}]);