1import{d as I,l as le,j as k,p as S,h as e,t as g,i as r,g as m,C as be,c as w,B as G,n as T,k as n,F as Q,m as L,o as _,D as _e,y as ne,r as P,z as O,w as ie,e as re,E as te,u as de,f as ce,G as oe,H as xe,b as we,I as ye,J as Ce}from"./index-Bj3vgeR-.js";import{A as ue}from"./index-CsEUjGLx.js";import{_ as Z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{g as ke,a as Ae,b as Ve}from"./list-CeaV56uO.js";import{f as N,a as D}from"./number-xmwlMPIx.js";import{u as $e}from"./index-DEr5q7uJ.js";import"./index-BktAFO9J.js";import"./analytics-x9xoHKuU.js";import"./client-7GJ3M953.js";const pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAkBJREFUeAGNVdFR20AQ3T1rcD75yoDtD7mCyBVEriCTCgIVBFeAlAZwKsB0kFSA6UCpAH1gxORLn3gSbrPvdIqFkAw7czOnvdt3b/f2nZg6LExuD7c0PCGhj/oZweWXch2ZYftzk0xWXbHcdoyT4kRELoTokPZbrsBpG9g0P47P7y+syKUDY1oL86mOaZGOGMNwMIMPa2BtxVwippOhXzhTR2nZLh56UqrtSDMxu0yWeuDiPyDSBDOAMQfzTfI+80EhV/7IB4J1+pAcr6u435HI32usafqnSJ89u1ukIOpsMqv9zJRpUKmXFMOvoPMaFExxqE7LIW+nBuyousV1E0w3VsEi6X0ymhXJaM4saVV4G9f7FHjla+o6I9CAT9Wp9qpZI89gihbaFdzkojTbZoivLEmsKLGRqs9oQAcZdVieTMu6nlrnc7gsmVVzzxM5hmD1wfh0qb6ILvOXc82u+MFnZZ+3sqm/w4DeYEyu6KF1l9Z/MAwM85pFL6C4spR9vTlO7iI/VfWoNjEb0FPcB2iZoZAZ9dog8if/MsJ044LEfOndThTvPZDExWoH/DBD2qK7cZPxUVq8AJ1oP0JF0G1XWVwfVw2foyQGbaEpVTq0soScmgEBPaIkOcY7eiyfg0F64h4H7WPX9LvHIblbkpivOi1Vl4vNK4/DWLMRJeA0LvZ78W1y9gywBQpbG6eeg6zu0VBT/qOl0RKgNLHb1QB7AQjzYociQtpjfc8c9wU4YFKdS+sXwK7NbnCZtSyb9g/VzDU1HHm5UQAAAABJRU5ErkJggg==",Le=["aria-label"],Pe={class:"category-dropdown-btn__text"},Se=I({__name:"index",props:{modelValue:{},options:{default:()=>[{label:"All Categories",value:""},{label:"Politics",value:"POLITICS"},{label:"Sports",value:"SPORTS"},{label:"Crypto",value:"CRYPTO"},{label:"Culture",value:"CULTURE"},{label:"Mentions",value:"MENTIONS"},{label:"Weather",value:"WEATHER"},{label:"Economics",value:"ECONOMICS"},{label:"Tech",value:"TECH"},{label:"Finance",value:"FINANCE"}]}},emits:["update:modelValue","change"],setup(p,{emit:u}){const x=p,V=u,d=L(()=>{var v;return((v=x.options.find(h=>h.value===x.modelValue))==null?void 0:v.label)??"All Categories"}),a=v=>{if(v!==x.modelValue){V("update:modelValue",v),V("change",v);return}V("update:modelValue",v)};return(v,h)=>{const s=S("el-icon"),$=S("el-dropdown-item"),y=S("el-dropdown-menu"),c=S("el-dropdown");return _(),le(c,{trigger:"click",onCommand:a,"popper-class":"category-dropdown-popper"},{dropdown:k(()=>[r(y,{class:"category-dropdown-menu","popper-class":"customPoperClass"},{default:k(()=>[(_(!0),w(Q,null,G(p.options,C=>(_(),le($,{key:C.value,command:C.value,class:T({"is-selected":C.value===p.modelValue})},{default:k(()=>[n(g(C.label),1)]),_:2},1032,["command","class"]))),128))]),_:1})]),default:k(()=>[e("button",{type:"button",class:"category-dropdown-btn","aria-label":`Category: ${d.value}`},[e("span",Pe,g(d.value),1),r(s,{class:"category-dropdown-btn__icon"},{default:k(()=>[r(m(be))]),_:1})],8,Le)]),_:1})}}}),Te=Z(Se,[["__scopeId","data-v-907074cd"]]),Re=["width","height"],Ne=["d"],Me=["d"],Be=I({__name:"SparklineChart",props:{values:{},width:{default:112},height:{default:32},color:{default:"#10B981"},fill:{default:"rgba(16, 185, 129, 0.12)"}},setup(p){_e(a=>({v0da6cb32:a.color,v188f19ff:a.fill}));const u=p,x=L(()=>{var $;const a=($=u.values)!=null&&$.length?u.values:[0],v=Math.min(...a),s=Math.max(...a)-v||1;return a.map(y=>(y-v)/s)}),V=L(()=>{const a=x.value;if(!a.length)return"";const v=a.length===1?0:100/(a.length-1);return a.map((h,s)=>{const $=s*v,y=36-h*32;return`${s===0?"M":"L"} ${$.toFixed(2)} ${y.toFixed(2)}`}).join(" ")}),d=L(()=>{const a=V.value;return a?`${a} L 100 40 L 0 40 Z`:""});return(a,v)=>(_(),w("svg",{class:"sparkline",width:p.width,height:p.height,viewBox:"0 0 100 40",preserveAspectRatio:"none","aria-hidden":"true"},[e("path",{class:"sparkline-area",d:d.value},null,8,Ne),e("path",{class:"sparkline-line",d:V.value},null,8,Me)],8,Re))}}),Ee=Z(Be,[["__scopeId","data-v-c46622b7"]]),He={class:"chatbox !w-[100%]","aria-label":"PNL sparkline"},Fe=3,Oe=I({__name:"index",props:{address:{},width:{default:110}
1,height:{default:32}},setup(p){const u=p,x=L(()=>u.width),V=L(()=>u.height),d=P([]),a=P(0),v=L(()=>a.value>=0?"#10B981":"#EF4444"),h=L(()=>a.value>=0?"rgba(16,185,129,0.12)":"rgba(239,68,68,0.12)"),s=async($=0)=>{if(console.log("load pnl",u.address,111),d.value=[],a.value=0,!!u.address)try{const y=await ke({address:u.address,interval:"1m",fidelity:"1d"}),C=(Array.isArray(y)?y:[]).map(R=>Number(R==null?void 0:R.p)).filter(R=>Number.isFinite(R));d.value=C,a.value=C.length?C[C.length-1]:0}catch{if($<Fe){await s($+1);return}d.value=[],a.value=0}};return ne(()=>u.address,()=>s(),{immediate:!0}),($,y)=>(_(),w("div",He,[r(Ee,{values:d.value,color:v.value,fill:h.value,width:x.value,height:V.value},null,8,["values","color","fill","width","height"])]))}}),me=Z(Oe,[["__scopeId","data-v-fea36c2b"]]),Ie={class:"rounded-2xl border box_bg1 p-4"},De={class:"flex items-center justify-between"},Ze={class:"text-[10px] tracking-widest text-slate-500"},Ke={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"7",viewBox:"0 0 12 7",fill:"none"},je={key:1,xmlns:"http://www.w3.org/2000/svg",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none"},Ue={key:2,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",viewBox:"0 0 12 13",fill:"none"},We={key:3,xmlns:"http://www.w3.org/2000/svg",width:"6",height:"11",viewBox:"0 0 6 11",fill:"none"},ze={class:"mt-1 text-[10px] text-slate-500"},qe=I({__name:"MetricCard",props:{label:{},value:{},sub:{},tone:{},valueClassOverride:{}},setup(p){const u=p,x=L(()=>{if(u.valueClassOverride)return u.valueClassOverride;if(u.tone==="a1")return"text-emerald-400";if(u.tone==="a2"||u.tone==="a3")return"text-white";if(u.tone==="a4")return"text-blue-400"});return(V,d)=>(_(),w("div",Ie,[e("div",De,[e("div",Ze,g(p.label),1),p.tone==="a1"?(_(),w("svg",Ke,[...d[0]||(d[0]=[e("path",{d:"M8.14844 0H11.6484V3.5L10.3086 2.16016L6.64453 5.82422L4.32031 3.5L0.820312 7L0 6.17969L4.32031 1.85938L6.64453 4.18359L9.48828 1.33984L8.14844 0Z",fill:"#10B981"},null,-1)])])):O("",!0),p.tone==="a2"?(_(),w("svg",je,[...d[1]||(d[1]=[e("path",{d:"M5.25781 3.25391C5.03906 3.25391 4.84766 3.33594 4.68359 3.5C4.51953 3.66406 4.4375 3.85547 4.4375 4.07422C4.4375 4.3112 4.51953 4.51172 4.68359 4.67578C4.84766 4.83984 5.03906 4.92188 5.25781 4.92188C5.49479 4.92188 5.69531 4.83984 5.85938 4.67578C6.02344 4.51172 6.10547 4.3112 6.10547 4.07422C6.10547 3.85547 6.02344 3.66406 5.85938 3.5C5.69531 3.33594 5.49479 3.25391 5.25781 3.25391ZM5.25781 0C4.71094 0 4.20052 0.10026 3.72656 0.300781C3.2526 0.501302 2.82878 0.779297 2.45508 1.13477C2.08138 1.49023 1.78516 1.90039 1.56641 2.36523C1.34766 2.83008 1.22005 3.33594 1.18359 3.88281L0.0625 5.35938C-0.0104167 5.46875 -0.0195312 5.57357 0.0351562 5.67383C0.0898438 5.77409 0.18099 5.82422 0.308594 5.82422H1.18359V7.57422C1.18359 7.90234 1.29753 8.18034 1.52539 8.4082C1.75326 8.63607 2.03125 8.75 2.35938 8.75H2.93359V10.5H7.00781V7.76562C7.70052 7.4375 8.26562 6.94531 8.70312 6.28906C9.14062 5.63281 9.35938 4.89453 9.35938 4.07422C9.35938 3.50911 9.25 2.98047 9.03125 2.48828C8.8125 1.99609 8.51628 1.56315 8.14258 1.18945C7.76888 0.815755 7.33594 0.524089 6.84375 0.314453C6.35156 0.104818 5.82292 0 5.25781 0ZM7.00781 4.07422C7.00781 4.11068 7.00781 4.15169 7.00781 4.19727C7.00781 4.24284 7.00781 4.28385 7.00781 4.32031L7.5 4.70312C7.53646 4.73958 7.54557 4.78516 7.52734 4.83984L7.0625 5.66016C7.02604 5.71484 6.97135 5.73307 6.89844 5.71484L6.32422 5.46875C6.21484 5.5599 6.08724 5.63281 5.94141 5.687
15L5.85938 6.31641C5.84115 6.38932 5.79557 6.42578 5.72266 6.42578H4.79297C4.73828 6.42578 4.70182 6.38932 4.68359 6.31641L4.60156 5.6875C4.45573 5.63281 4.31901 5.5599 4.19141 5.46875L3.61719 5.71484C3.5625 5.73307 3.51693 5.71484 3.48047 5.66016L3.01562 4.83984C2.97917 4.78516 2.98828 4.73958 3.04297 4.70312L3.53516 4.32031C3.53516 4.28385 3.5306 4.24284 3.52148 4.19727C3.51237 4.15169 3.50781 4.11068 3.50781 4.07422C3.50781 4.03776 3.51237 4.0013 3.52148 3.96484C3.5306 3.92839 3.53516 3.89193 3.53516 3.85547L3.04297 3.47266C2.98828 3.4362 2.97917 3.38151 3.01562 3.30859L3.48047 2.51562C3.51693 2.46094 3.5625 2.44271 3.61719 2.46094L4.21875 2.70703C4.34635 2.59766 4.47396 2.51562 4.60156 2.46094L4.68359 1.85938C4.70182 1.78646 4.73828 1.75 4.79297 1.75H5.72266C5.79557 1.75 5.84115 1.78646 5.85938 1.85938L5.94141 2.46094C6.06901 2.51562 6.19661 2.59766 6.32422 2.70703L6.89844 2.46094C6.97135 2.44271 7.02604 2.46094 7.0625 2.51562L7.52734 3.30859C7.5638 3.38151 7.55469 3.4362 7.5 3.47266L6.98047 3.85547C6.9987 3.91016 7.00781 3.98307 7.00781 4.07422Z",fill:"#197FE6"},null,-1)])])):O("",!0),p.tone==="a3"?(_(),w("svg",Ue,[...d[2]||(d[2]=[e("path",{d:"M5.52344 0L11.0742 2.92578V4.10156H0V2.92578L5.52344 0ZM8.14844 5.25H9.89844V9.35156H8.14844V5.25ZM0 12.25V10.5H11.0742V12.25H0ZM4.64844 5.25H6.39844V9.35156H4.64844V5.25ZM1.14844 5.25H2.89844V9.35156H1.14844V5.25Z",fill:"#64748B"},null,-1)])])):O("",!0),p.tone==="a4"?(_(),w("svg",We,[...d[3]||(d[3]=[e("path",{d:"M2.34245 10.5H1.74089L2.34245 6.42578H0.291667C0 6.42578 -0.0729167 6.29818 0.0729167 6.04297C0.127604 5.95182 0.136719 5.92448 0.10026 5.96094C1.02995 4.33854 2.16016 2.35156 3.49089 0H4.09245L3.49089 4.07422H5.54167C5.79688 4.07422 5.87891 4.20182 5.78776 4.45703L2.34245 10.5Z",fill:"#197FE6"},null,-1)])])):O("",!0)]),e("div",{class:T(["mt-2 text-xl font-extrabold",x.value])},g(p.value),3),e("div",ze,g(p.sub),1)]))}}),Y=Z(qe,[["__scopeId","data-v-e0371598"]]),Ye={class:"card-list"},Ge={class:"card-top"},Qe={class:"left"},Xe={class:"flex justify-start items-center flex-row gap-2"},Je={class:"right"},et=["onClick"],tt={class:"stats-panel"},st={class:"stats-top"},at={class:"backtest"},lt={class:"bt-title"},ot={class:"th-with-tip"},nt={class:"kpis"},it={class:"kpi"},rt={class:"kpi-row"},dt={class:"kpi-val pos"},ct={class:"bar"},ut={class:"kpi"},pt={class:"kpi-row"},mt={class:"kpi-val"},vt={class:"bar"},gt={class:"stats-mid"},ht={class:"mini"},ft={class:"mini"},bt={class:"mini"},_t={class:"mini"},xt={class:"stats-bottom"},wt={class:"trend"},yt={key:1,class:"empty","aria-label":"No Data"},Ct=I({__name:"SmartTraderCardList",props:{rows:{},pageSize:{default:25},loading:{type:Boolean,default:!1}},setup(p){const u=de(),x=ce(),V=p,d=(h,s)=>{x.push({path:`/account/${h.address}`,query:{r:s}})},a=h=>h&&h.length?h:[12,12,13,15,16,16,15,17,20,19,18,19,21,24,22,23,26],v=L(()=>(Array.isArray(V.rows)?V.rows:[]).map(s=>({...s,sparkline:a(s.sparkline),sparklineColor:s.sparklineColor??"#10b981",sparklineFill:s.sparklineFill??"rgba(16,185,129,0.18)"})));return(h,s)=>{const $=S("el-tooltip"),y=re("loading");return ie((_(),w("div",Ye,[v.value.length?(_(!0),w(Q,{key:0},G(v.value,c=>(_(),w("div",{key:c.trader,class:"card"},[e("div",Ge,[e("div",Qe,[e("div",Xe,[r(ue,{address:c.address,size:32,"row-data":c},null,8,["address","row-data"])])]),e("div",Je,[e("button",{class:"copy-trade",type:"button",onClick:C=>d(c,m(u).params.r)}," COPY ",8,et)])]),e("div",tt,[e("div",st,[e("div",at,[e("div",lt,[e("span",ot,[s[2]||(s[2]=e("span",null,"Score",-1)),r($,{placement:"bottom",effect:"dark",teleported:!0,"show-after":150,"popper-class":"score-tip"},{content:k(()=>[...s[0]||(s[0]=[e("div",{class:"tip-content"},[n(' Here is how the "Backtest Copy PnL" and "Slippage Cost Rate" are calculated in the script: '),e("br"),e("br"),n(" 1. Calculating Backtest Copy PnL "),e("br"),e("br"),n(" When processing each historical trade, we simulate the slippage friction a copier would face: "),e("br"),e("br"),n(" ⢠BUY: We assume the copier buys at a slightly worse (higher) price. Buy Cost = Price * 1.02 (capped at a maximum of $1.00). "),e("br"),n(" ⢠SELL: We assume the copier sells at a slightly worse (lower) price. Sell Revenue = Price * 0.98. "),e("br"),n(` ⢠Unrealized Positions: If a position hasn't been settled yet, its backtest value is discounted by 2% (Current Value * 0.98), unless the market is already marked as "Redeemable" (meaning it can be cashed out at exactly $1.00). `),e("br"),n(" ⢠Settlements (Redeem / Merge / Split): These are processed officially by the platform at $1.00 or exact face value without any slippage, so we use the actual amounts. "),e("br"),e("br"),n(' Adding up these "friction-adjusted" buy and sell costs gives us the Backtest Copy PnL. '),e("br"),e("br"),n(" 2. Calculating Slippage Cost Rate "),e("br"),e("br"),n(' The Slippage Cost Rate reflects "what percentage of the profits is eaten away by slippage." '),e("br"),e("br"),n(" The formula
1is: "),e("br"),e("br"),e("code",null,[n(" Slippage Amount = Actual PnL - Backtest Copy PnL "),e("br"),n(" Slippage Cost Rate = (Slippage Amount / ABS(Actual PnL)) * 100% ")]),e("br"),e("br"),n(" ⢠For example, if the original address makes $100, but the backtest (copier) only makes $80, the slippage cost is $20. The slippage rate is 20%. "),e("br"),n(` ⢠If the slippage rate is extremely high (e.g., > 25%), it means the wallet's profitability relies heavily on "execution speed and tiny price spreads" (typical of high-frequency quantitative market-making). An average user copying these trades won't make money and will likely suffer consistent losses due to copy latency and slippage. This is why we flag high-slippage addresses as "Toxic for copying". `)],-1)])]),default:k(()=>[s[1]||(s[1]=e("img",{src:pe,alt:"",class:"w-[13px] h-[13px]"},null,-1))]),_:1})])]),e("div",{class:T(["bt-value",Number(c.score)>=0?"up":"down"])},g(c.score),3)]),e("div",nt,[e("div",it,[e("div",rt,[s[3]||(s[3]=e("div",{class:"kpi-label"},"Avg ROI",-1)),e("div",dt,g(m(N)(c.avgMarketRoi))+"% ",1)]),e("div",ct,[e("div",{class:T(["bar-fill",c.avgMarketRoi>0?"is-green":"is-red"]),style:te({width:`${Math.abs(c.avgMarketRoi)}%`})},null,6)])]),e("div",ut,[e("div",pt,[s[4]||(s[4]=e("div",{class:"kpi-label"},"WIN RATE",-1)),e("div",mt,g(m(N)(c.winRate))+"%",1)]),e("div",vt,[e("div",{class:"bar-fill is-blue",style:te({width:`${Math.abs(c.winRate)}%`})},null,4)])])])]),e("div",gt,[e("div",ht,[s[5]||(s[5]=e("div",{class:"mini-label"},"BackTest PNL",-1)),e("div",{class:T(["mini-val pos",Number(c.backtestTotalPnl)<0?"down":"up"])},g(m(D)(c.backtestTotalPnl,"$")),3)]),e("div",ft,[s[6]||(s[6]=e("div",{class:"mini-label"},"Slippage",-1)),e("div",{class:T(["mini-val pos",Number(c.slippageCostRate)<0?"down":"up"])},g(m(N)(c.slippageCostRate))+"% ",3)]),e("div",bt,[s[7]||(s[7]=e("div",{class:"mini-label"},"Recent BT PNL",-1)),e("div",{class:T(["mini-val pos",Number(c.recent20BacktestPnl)<0?"down":"up"])},g(m(D)(c.recent20BacktestPnl)),3)]),e("div",_t,[s[8]||(s[8]=e("div",{class:"mini-label"},"Recent Slippage",-1)),e("div",{class:T(["mini-val pos",Number(c.recent20SlippageCostRate)<0?"down":"up"])},g(m(N)(c.recent20SlippageCostRate))+"% ",3)])]),e("div",xt,[s[9]||(s[9]=e("div",{class:"trend-title"},"PNL TREND (30D)",-1)),e("div",wt,[r(me,{address:c.address,width:"100%",height:"90px",class:"w-[100%]"},null,8,["address"])])])])]))),128)):(_(),w("div",yt,"No Data"))])),[[y,p.loading]])}}}),kt=Z(Ct,[["__scopeId","data-v-a4d0d93c"]]),At={class:"h-full flex flex-col justify-between items-start"},Vt={class:"flex justify-start items-center w-full"},$t={class:"labelDes"},Lt={key:0,class:"labelDes"},Pt={class:"!w-[100%] gap-[8px] flex flex-row justify-between items-center max-xs:flex-row mt-[12px]"},St={class:"w-full flex justify-between items-center px-[24px] h-[94px] borderA"},Tt=I({__name:"FilterForm",props:{filterObj:{type:Object,default:()=>({})},hasResults:{type:Boolean,default:!0}},emits:["onSearch"],setup(p,{emit:u}){const x=P(),V=p,d=[{label:"Score",append:"",minKey:"min_score",maxKey:"max_score",validate:"positiveNumber"},{label:"Actual Total PnL",append:"$",minKey:"min_total_pnl",maxKey:"max_total_pnl",validate:"number"},{label:"Backtest Total Pnl",append:"$",minKey:"min_backtest_pnl",maxKey:"max_backtest_pnl",validate:"number"},{label:"Backtest Slippage",append:"%",minKey:"min_backtest_slippage",maxKey:"max_backtest_slippage",validate:"number"},{label:"Win Rate",append:"%",minKey:"min_win_rate",maxKey:"max_win_rate",validate:"percentage"},{label:"Avg Profit/Loss Ratio",append:"%",minKey:"min_avg_profit_loss_ratio",maxKey:"max_avg_profit_loss_ratio",validate:"number"},{label:"Recent Pnl",append:"$",minKey:"min_recent_pnl",maxKey:"max_recent_pnl",validate:"number"},{label:"Slippage Cost Rate",append:"%",minKey:"min_slippage",maxKey:"max_slippage",validate:"number"}],a=oe({min_score:null,max_score:null,min_total_pnl:null,max_total_pnl:null,min_backtest_pnl:null,max_backtest_pnl:null,min_win_rate:null,max_win_rate:null,min_recent_pnl:null,max_recent_pnl:null,min_avg_profit_loss_ratio:null,max_avg_profit_loss_ratio:null,min_slippage:null,max_slippage:null,min_backtest_slippage:null,max_backtest_slippage:null,...V.filterObj}),v=(f,l,b)=>{l&&l!=="-"&&isNaN(Number(l))?b(new Error("valid number")):b()},h=(f,l,b)=>{l&&l!=="-"&&isNaN(Number(l))?b(new Error("Valid number")):l&&l!=="-"&&Number(l)<=0?b(new Error("Mu
1st be greater than 0")):b()},s=(f,l,b)=>{l&&l!=="-"&&isNaN(Number(l))?b(new Error("Valid number")):l&&l!=="-"&&(Number(l)<0||Number(l)>100)?b(new Error("must be between 0~100")):b()},$=L(()=>Object.values(a).every(f=>f===null||f==="")),y={number:v,positiveNumber:h,percentage:s},c=oe({});d.forEach(f=>{const l=y[f.validate]||v;c[f.minKey]=[{validator:l,trigger:"change"}],c[f.maxKey]=[{validator:l,trigger:"change"}]});const C=()=>{var f;if(x.value)try{(f=x.value)==null||f.resetFields(),R("onSearch",{})}catch(l){console.log(l)}},R=u,X=new Set(d.filter(f=>f.append==="%").flatMap(f=>[f.minKey,f.maxKey])),J=()=>{var f;(f=x.value)==null||f.validate(l=>{if(l){const b={};Object.entries(a).forEach(([M,E])=>{E!==null&&E!==""&&(X.has(M)?b[M]=String(Number(E)/100):b[M]=E)}),R("onSearch",b)}})};return(f,l)=>{const b=S("el-input"),M=S("el-form-item"),E=S("el-form"),ee=S("el-icon"),U=S("el-button");return _(),w("div",At,[r(E,{ref_key:"formRef",ref:x,model:a,rules:c,"label-position":"top","label-width":"0px",class:"filter_custom_form w-full flex-1 overflow-auto flex flex-row justify-between items-center gap-[20px] flex-wrap mb-[20px] px-[24px]"},{default:k(()=>[(_(),w(Q,null,G(d,A=>e("div",{key:A.label,class:"flex flex-col justify-between items-center flex-wrap w-[1/3]"},[e("div",Vt,[e("span",$t,g(A.label),1),A.append?(_(),w("span",Lt,"("+g(A.append)+")",1)):O("",!0)]),e("span",Pt,[r(M,{label:"",prop:A.minKey},{default:k(()=>[r(b,{modelValue:a[A.minKey],"onUpdate:modelValue":H=>a[A.minKey]=H,placeholder:"Min",class:"md:!w-[116px] max-xs:!w-[100%]"},{prefix:k(()=>[...l[0]||(l[0]=[e("span",{class:"text-[#475569] text-[12px]"},"MIN",-1)])]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),l[2]||(l[2]=e("span",{class:"block w-[8px] h-[1px] bg-[#1E293B]"},null,-1)),r(M,{label:"",prop:A.maxKey},{default:k(()=>[r(b,{modelValue:a[A.maxKey],"onUpdate:modelValue":H=>a[A.maxKey]=H,placeholder:"Max",class:"md:!w-[116px] max-xs:!w-[100%] max-xs:!ml-[0px]"},{prefix:k(()=>[...l[1]||(l[1]=[e("span",{class:"text-[#475569] text-[12px]"},"MAX",-1)])]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])])])),64))]),_:1},8,["model","rules"]),e("div",St,[r(U,{type:"text",class:"plain_text",onClick:C},{default:k(()=>[r(ee,{class:"!mr-[5px]"},{default:k(()=>[r(m(xe))]),_:1}),l[3]||(l[3]=n(" Clear all filters",-1))]),_:1}),r(U,{type:"primary",plain:"",onClick:J,disabled:!p.hasResults||$.value,class:"applyBtn"},{default:k(()=>[...l[4]||(l[4]=[n("APPLY FILTERS",-1)])]),_:1},8,["disabled"])])])}}}),Rt={class:"py-4 sm:py-5 !pb-0"},Nt={class:"metrics-row flex flex-nowrap gap-4 overflow-x-auto md:grid md:grid-cols-2 lg:grid-cols-4 md:overflow-visible"},Mt={class:"metric-item shrink-0"},Bt={class:"metric-item shrink-0"},Et={class:"metric-item shrink-0"},Ht={class:"metric-item shrink-0"},Ft={class:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between min-h-[70px] search_box"},Ot={class:"flex justify-start items-center flex-row gap-3"},It={class:"flex justify-start sm:justify-between items-center flex-row gap-2 flex-1"},Dt={class:"rounded-2xl table_box p-4"},Zt={key:0,class:"block sm:hidden mt-4"},Kt={key:1,class:"mt-4 overflow-x-auto hidden sm:block"},jt={class:"w-full min-w-[980px] text-left text-xs"},Ut={class:"text-[10px] uppercase tracking-widest text-slate-500"},Wt={class:"border-b border-white/5"},zt={class:"text-left min-w-[100px] !px-0"},qt={class:"th-with-tip"},Yt={key:0},Gt=["onClick"],Qt={class:"py-4"},Xt={class:"flex items-center gap-3"},Jt={class:"px-[8px]"},es={class:"px-[8px]"},ts={class:"text-[#FFF]"},ss={class:""},as={class:"mt-1 h-1.5 w-24 rounded-full bg-white/5 overflow-hidden"},ls={class:"text-[#fff]"},os={class:""},ns={class:"text-[#fff]"},is={class:"text-right flex items-center justify-end gap-2"},rs=["onClick"],ds={class:"mt-4 flex flex-col items-center text-center gap-3 text-xs text-slate-500 sm:flex-row sm:items-center sm:justify-between sm:text-left"},cs=I({__name:"index",setup(p){const u=P(!1),x=de(),V=ce(),d=P({}),a=$e("(max-width: 767px)"),v=L(()=>Object.keys(d.value).length>0?"btn_active":""),h=P(!1),s=P(""),$=o=>{const t=`https://polymarket.com/profile/${o}?via=polycop`;window.open(t,"_blank")},y=P({avgDailyPnl:0,avgWinRate:0,totalValueTracked:0,totalBacktest30dayProfit:0,totalTrackedAddress:0}),c=o=>{u.value=!1,d.value=o,b({page:1})},C=P([]),R=()=>{A.value=1,f.value=1,J.value=[],b({page:1},s.value)},X=()=>{u.value=!0},J=P([]),f=P(1),l=async()=>{try{const o=await Ae({});console.log("summary res:",o.data.data),o.data.data&&(y.value=o.data.data)}catch{}},b=async(o,t)=>{var B,W,z;try{h.value=!0;const q=F.value?{category:F.value}:{},j=await Ve({...q,...t?{address:t}:{}
1,sort_options:[{field:"score",descending:!0}],pagination:{page_number:(o==null?void 0:o.page)??A.value,page_size:H.value},...d.value});h.value=!1,console.log("list res:",j.data.data);const i=((B=j.data.data)==null?void 0:B.portfolio)??[];o!=null&&o.append?(C.value=[...C.value,...i],console.log("list after append:",C.value)):C.value=i,K.value=((z=(W=j.data.data)==null?void 0:W.pagination)==null?void 0:z.total)??0}catch{h.value=!1}};we(()=>{l(),b({page:1})});const M=L(()=>{var o;return Number(((o=y.value)==null?void 0:o.avgDailyPnl)??0)}),E=L(()=>{const o=M.value,t=`$${N(Math.abs(o))}`;return o>0?`+${t}`:o<0?`-${t}`:t}),ee=L(()=>M.value<0?"text-[#F87171]":void 0),U=(o,t)=>{V.push({path:`/account/${o.address}`,query:{r:t}})},A=P(1),H=P(15),K=P(0),ve=L(()=>{if(K.value===0)return"0-0";const o=(A.value-1)*H.value+1,t=Math.min(A.value*H.value,K.value);return`${o}-${t}`}),ge=o=>{A.value=o,typeof window<"u"&&window.matchMedia&&window.matchMedia("(max-width: 639px)").matches&&document.body.scrollTo({top:0,behavior:"smooth"}),b()},F=P(""),se=o=>{const t=typeof o=="string"?o:"";return["","POLITICS","SPORTS","CRYPTO","CULTURE","MENTIONS","WEATHER","ECONOMICS","TECH","FINANCE"].includes(t)?t:""};F.value=se(x.query.category),ne(()=>x.query.category,o=>{F.value=se(o)});const he=async o=>{A.value=1;const t=typeof o=="string"?o:F.value,B={...x.query};t?B.category=t:delete B.category,await V.replace({query:B}),b({page:1},s.value)};return(o,t)=>{const B=S("el-input"),W=S("el-button"),z=S("el-tooltip"),q=S("el-pagination"),ae=S("el-drawer"),j=re("loading");return _(),w("div",Rt,[e("section",Nt,[e("div",Mt,[r(Y,{label:"AGGREGATE DAILY PNL",value:E.value,"value-class-override":ee.value,sub:`Total from ${m(N)(y.value.totalTrackedAddress??0)} tracked addresses`,tone:"a1"},null,8,["value","value-class-override","sub"])]),e("div",Bt,[r(Y,{label:"AVG. WIN RATE",value:`${m(N)(y.value.avgWinRate)}%`,sub:"Across all filtered traders",tone:"a2"},null,8,["value"])]),e("div",Et,[r(Y,{label:"TOTAL VALUE TRACKED",value:`$${m(D)(y.value.totalValueTracked)}`,sub:"Total active balance",tone:"a3"},null,8,["value"])]),e("div",Ht,[r(Y,{label:"TOTAL 30D BACKTEST PNL",value:`$${m(N)(y.value.totalBacktest30dayProfit)}`,sub:"Executions in last 1 hour",tone:"a4"},null,8,["value"])])]),e("div",Ft,[e("div",Ot,[r(B,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),class:"search-input w-full sm:w-[288px] text-sm text-slate-200 placeholder:text-slate-500 outline-none",placeholder:"Search address",clearable:"",onKeyup:ye(R,["enter"]),onSearch:R},null,8,["modelValue"]),e("div",{class:"hidden sm:block"},[e("button",{onClick:R,class:"searchCl"},"Search")])]),e("div",It,[r(W,{class:T(["!h-[34px] mr-[10px] filterBtn",v.value]),onClick:X},{default:k(()=>[...t[4]||(t[4]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"7",viewBox:"0 0 11 7",fill:"none"}
1,[e("path",{d:"M1.75 4.07422V2.92578H8.75V4.07422H1.75ZM0 0H10.5V1.17578H0V0ZM4.07422 7V5.82422H6.42578V7H4.07422Z",fill:"#197FE6"})],-1),e("span",{class:"mx-[10px]"},"Advanced Filters",-1)])]),_:1},8,["class"]),r(Te,{modelValue:F.value,"onUpdate:modelValue":t[1]||(t[1]=i=>F.value=i),onChange:he},null,8,["modelValue"])])]),e("section",Dt,[m(a)?(_(),w("section",Zt,[r(kt,{rows:C.value,"page-size":25,loading:h.value},null,8,["rows","loading"])])):O("",!0),m(a)?O("",!0):ie((_(),w("div",Kt,[e("table",jt,[e("thead",Ut,[e("tr",Wt,[t[8]||(t[8]=e("th",{class:"py-3"},"Trader",-1)),e("th",zt,[e("span",qt,[t[7]||(t[7]=e("span",null,"Score",-1)),r(z,{placement:"bottom",effect:"dark",teleported:!0,"show-after":150,"popper-class":"score-tip"},{content:k(()=>[...t[5]||(t[5]=[e("div",{class:"tip-content"},[n(' Here is how the "Backtest Copy PnL" and "Slippage Cost Rate" are calculated in the script: '),e("br"),e("br"),n(" 1. Calculating Backtest Copy PnL "),e("br"),e("br"),n(" When processing each historical trade, we simulate the slippage friction a copier would face: "),e("br"),e("br"),n(" ⢠BUY: We assume the copier buys at a slightly worse (higher) price. Buy Cost = Price * 1.02 (capped at a maximum of $1.00). "),e("br"),n(" ⢠SELL: We assume the copier sells at a slightly worse (lower) price. Sell Revenue = Price * 0.98. "),e("br"),n(` ⢠Unrealized Positions: If a position hasn't been settled yet, its backtest value is discounted by 2% (Current Value * 0.98), unless the market is already marked as "Redeemable" (meaning it can be cashed out at exactly $1.00). `),e("br"),n(" ⢠Settlements (Redeem / Merge / Split): These are processed officially by the platform at $1.00 or exact face value without any slippage, so we use the actual amounts. "),e("br"),e("br"),n(' Adding up these "friction-adjusted" buy and sell costs gives us the Backtest Copy PnL. '),e("br"),e("br"),n(" 2. Calculating Slippage Cost Rate "),e("br"),e("br"),n(' The Slippage Cost Rate reflects "what percentage of the profits is eaten away by slippage." '),e("br"),e("br"),n(" The formula is: "),e("br"),e("br"),e("code",null,[n(" Slippage Amount = Actual PnL - Backtest Copy PnL "),e("br"),n(" Slippage Cost Rate = (Slippage Amount / ABS(Actual PnL)) * 100% ")]),e("br"),e("br"),n(" ⢠For example, if the original address makes $100, but the backtest (copier) only makes $80, the slippage cost is $20. The slippage rate is 20%. "),e("br"),n(` ⢠If the slippage rate is extremely high (e.g., > 25%), it means the wallet's profitability relies heavily on "execution speed and tiny price spreads" (typical of high-frequency quantitative market-making). An average user copying these trades won't make money and will likely suffer consistent losses due to copy latency and slippage. This is why we flag high-slippage addresses as "Toxic for copying". `)],-1)])]),default:k(()=>[t[6]||(t[6]=e("img",{src:pe,alt:"",class:"w-[13px] h-[13px]"},null,-1))]),_:1})])]),t[9]||(t[9]=e("th",{class:"text-left"},"Total Pnl",-1)),t[10]||(t[10]=e("th",{class:"text-left w-[80px]"},"Backtest PNL",-1)),t[11]||(t[11]=e("th",{class:"text-left w-[80px]"},"Backtest Slippage",-1)),t[12]||(t[12]=e("th",{class:"min-w-[100px] text-left"},"Win Rate",-1)),t[13]||(t[13]=e("th",{class:"text-left"},"P/L",-1)),t[14]||(t[14]=e("th",{class:"text-left"},"Recent PNL",-1)),t[15]||(t[15]=e("th",{class:"text-left"},"Slippage",-1)),t[16]||(t[16]=e("th",{class:"text-left"},"PNL Trend",-1)),t[17]||(t[17]=e("th",{class:"text-right"},"Action",-1))])]),e("tbody",null,[C.value.length===0?(_(),w("tr",Yt,[...t[18]||(t[18]=[e("td",{colspan:"11",class:"py-8 text-center text-slate-500"}," No Data ",-1)])])):(_(!0),w(Q,{key:1},G(C.value,i=>(_(),w("tr",{key:i.trader,class:"border-b border-white/5 text-slate-200",onClick:fe=>$(i.address)},[e("td",Qt,[e("div",Xt,[r(ue,{address:i.address,size:32,"row-data":i},null,8,["address","row-data"])])]),e("td",{class:T(["box_bg",Number(i.score)<0?"down":"up"])},g(i.score),3),e("td",Jt,[e("div",{class:T(Number(i.actualTotalPnl)<0?"down":"up")},g(m(D)(i.actualTotalPnl,"$")),3)]),e("td",es,[e("div",{class:T(Number(i.backtestTotalPnl)<0?"down":"up")},g(m(D)(i.backtestTotalPnl,"$")),3)]),e("td",ts,g(m(N)(i.recent20SlippageCostRate))+"% ",1),e("td",null,[e("div",ss,g(m(N)(i.winRate))+"%",1),e("div",as,[e("div",{class:T(["h-1.5 rounded-full",i.winRate>0?"bg-emerald-400":"bg-rose-400"]),style:te({width:Math.abs(i.winRate)+"%"})},null,6)])]),e("td",null,[e("div",ls,g(m(N)(i.avgProfitLossRatio)),1)]),e("td",os,[e("div",{class:T(Number(i.recent20Pnl)<0?"down":"up")},g(m(D)(i.recent20Pnl)),3)]),e("td",ns,[e("div",null,g(m(N)(i.slippageCostRate))+"%",1)]),e("td",null,[r(me,{address:i.address},null,8,["address"])]),e("td",is,[e("button",{class:"btn",onClick:Ce(fe=>U(i,m(x).params.r||""),["stop"])}," COPY ",8,rs)])],8,Gt))),128))])])])),[[j,h.value]]),e("div",ds,[e("div",null,"Showing "+g(ve.value)+" of "+g(K.value)+" addresses",1),r(q,{"current-page":A.value,"onUpdate:currentPage":t[2]||(t[2]=i=>A.value=i),"page-size":H.value,total:K.value,layout:"prev, pager, next",class:"list-pagination",onCurrentChange:ge,"pager-count":"5"},null,8,["current-page","page-size","total"])])]),r(ae,{modelValue:u.value,"onUpdate:modelValue":t[3]||(t[3]=i=>u.value=i),"append-to-body":!0,class:"custom_drawer","show-close":!0,direction:m(a)?"btt":"rtl",size:m(a)?"90%":"894px"},{header:k(()=>[...t[19]||(t[19]=[e("div",{class:"flex justify-start items-center gap-3"},[e("div",{class:"svgBox"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none"},[e("path",{d:"M6.66667 15V10H8.33333V11.6667H15V13.3333H8.33333V15H6.66667ZM0 13.3333V11.6667H5V13.3333H0ZM3.33333 10V8.33333H0V6.66667H3.33333V5H5V10H3.33333ZM6.66667 8.33333V6.66667H15V8.33333H6.66667ZM10 5V0H11.6667V1.66667H15V3.33333H11.6667V5H10ZM0 3.33333V1.66667H8.33333V3.33333H0Z",fill:"#197FE6"})])]),e("div",null,[e("div",{class:"custom_drawer__title"},"ADVANCED_FILTERS"),e("div",{class:"custom_drawer__title_des"}," Adjust ranges for precision targeting ")])],-1)])]),default:k(()=>[r(Tt,{onOnSearch:c,filterObj:d.value},null,8,["filterObj"])]),_:1},8,["modelValue","direction","size"])])}}}),xs=Z(cs,[["__scopeId","data-v-d824746d"]]);export{xs as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.