PageSourceSearch

https://polymarketscan.org/assets/TraderProfilePage-B6f513Tq.js

js polymarketscan.org collected 2026-10-04 13:19:58 UTC 27,009 bytes, 7 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-kF-B_PN5.css"])))=>i.map(i=>d[i]);
2import{c as Ee,j as e,b as D,a7 as Re,r as d,G as Ie,a3 as re,f as Ue,Y as Ve,x as We,t as P,s as S,H as Fe,S as X,az as xe,I as se,J as Oe,_ as A,K as pe,B as ae}from"./index-EOagY1xL.js";import{H as Be,L as ne,T as He,e as ze,f as he,w as ge}from"./Layout-CbGqocRH.js";import{a as Me,b as qe,P as De,C as Ke}from"./useTraderProfileStats-BvXnAxNk.js";import{S as Qe}from"./useMarketsSearch-CceTltKG.js";import{b as fe}from"./useMovers-DSN7j7vE.js";import{PositionPnLChart as Ge}from"./PositionPnLChart-DQuqrV40.js";import{PnLChart as Je}from"./PnLChart-io2TYUsX.js";import{W as Ye,L as E}from"./SEO-CAUtX4mQ.js";import{C as Xe}from"./ContextualLinks-CMHKq0LP.js";import{a as Ze}from"./useDebouncedValue-BJxmesZ3.js";import{L as et,u as tt}from"./useLeaderboards-BTdxjqBU.js";import{L as rt}from"./LeaderboardBadge-CX_S3gM2.js";import{A as st}from"./AddToWatchListButton-DP-8z_4b.js";import{S as at}from"./useWhaleFeed-nmqv5HF_.js";import{u as nt,a as ot,b as lt,B as it}from"./SimilarTraders-CMJREBtY.js";import{L as ye}from"./useMarketAutocomplete-DUOg4jeE.js";import{U as dt}from"./user-minus-CSjUHhXC.js";import{U as mt}from"./user-plus-CIW2qn7C.js";import{u as ct}from"./PageAnswerCapsule-W0_boT86.js";import{u as ut}from"./useTrades-CODNAM8d.js";import{a as xt,b as pt,n as ht,T as gt}from"./submissionMeta-B5ijCL4J.js";import{E as ft}from"./shareUtils-dtGEdkhW.js";import{A as je}from"./KpiCardRow-Bt1XgT0b.js";import{C as oe}from"./useShirtToken-DEnntS7e.js";import{D as jt}from"./addMonths-D3W4pTDR.js";import{T as wt}from"./useArkhamIntel-C_agIJxW.js";import"./floatingChrome-D57i0lRb.js";import"./index-C5ikjDJd.js";import"./Combination-BS1XGO-p.js";import"./FeedbackModal-BvPMhMEp.js";import"./copilotBridge-BLi8X6Hb.js";import"./useOrderPreview-DfzhC_kE.js";import"./useWalletDisplayNames-CZRPLpmi.js";import"./topMarketsBoard-fJ1CjvKB.js";import"./priceDisplay-B36E1VD1.js";import"./usePersonalFeed-C_2ua0tJ.js";import"./skeleton-CLPw7O35.js";import"./tutorials-DpfhMTPp.js";import"./useWalletSearch-CbO4qcXD.js";import"./isAfter-Bzyw8vlL.js";import"./useWalletMapping-Bfd-ge2_.js";import"./closedPnlIntegrity-DmVRwjrk.js";import"./arrow-down-CZ6ZmXPC.js";import"./arrow-up-jWyj-LFi.js";import"./arrow-up-down-N2lhZaJN.js";import"./SeoPagination-B23-E7xN.js";import"./table-DU6bVX_C.js";import"./select-oPJY4BQ2.js";import"./useTraderPnLSeries-BUkfBUMn.js";import"./eachDayOfInterval-DljY7QXz.js";import"./circle-x-C3UbWSqE.js";import"./useTransferCounterparties-Cr1GfeiK.js";import"./generateCategoricalChart-gVwO7X-O.js";import"./index-Bn5Uzdm6.js";
2import"./value-B5BGaaDU.js";import"./MiniPnLChart-CCtjmNZy.js";import"./Area-M6tRjxXT.js";import"./WatchListShortRedirect-zkQGd3Ys.js";import"./CartesianGrid-BnWlfscw.js";import"./slider-CxGiD0Sk.js";import"./ticketMath-DVtnjTWj.js";import"./EmbedWhaleFeedPage-i0eCuyo-.js";import"./axios-DxEBw9jJ.js";import"./ComposedChart-B8mc-tmV.js";import"./Line-qrCp1Vjs.js";import"./ListsAlertsTabs-BBHjE2W7.js";import"./award-AmLiwhOy.js";import"./crown-DSZAfssj.js";import"./switch-D_n0W5MP.js";import"./useUserFlairs-CixHK8-U.js";/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const yt=Ee("PiggyBank",[["path",{d:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z",key:"1ivx2i"}],["path",{d:"M2 9v1c0 1.1.9 2 2 2h1",key:"nm575m"}],["path",{d:"M16 11h.01",key:"xkw8gn"}]]),vt=g=>{const m=g.length;return m<=8?"text-xl md:text-2xl":m<=12?"text-lg md:text-xl":m<=16?"text-base md:text-lg":"text-sm md:text-base"},B=({label:g,value:m,icon:p,trend:h,className:k})=>{const R=vt(m);return e.jsx("div",{className:D("stat-card",k),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-0.5 md:space-y-1 min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs md:text-sm font-medium text-muted-foreground uppercase tracking-wider leading-tight",children:g}),e.jsx("p",{className:D(R,"font-bold text-foreground break-all leading-tight"),children:m}),h&&e.jsxs("p",{className:D("text-xs font-medium",h.positive?"text-success":"text-destructive"),children:[h.positive?"+":"",h.value]})]}),p&&e.jsx("div",{className:"p-1.5 md:p-2 rounded-lg bg-primary/10 flex-shrink-0 ml-2",children:e.jsx(p,{className:"h-4 w-4 md:h-5 md:w-5 text-primary"})})]})})},H=()=>e.jsx("div",{className:"stat-card",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"skeleton-pulse h-3 w-20"}),e.jsx("div",{className:"skeleton-pulse h-8 w-32"})]}),e.jsx("div",{className:"skeleton-pulse h-9 w-9 rounded-lg"})]})}),bt=[{key:"points",type:"points"},{key:"yapper",type:"yapper"}],Nt=({ranks:g})=>{const m=bt.map(({key:p,type:h})=>{const k=g[p];return k?{type:h,rank:k.rank,value:k.value}:null}).filter(Boolean);return m.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx("p",{className:"text-sm",children:"No leaderboard rankings yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Trade more to climb the ranks!"})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:m.map(p=>{const h=et[p.type];return e.jsxs("div",{className:"rounded-xl p-4 border transition-all hover:scale-[1.02]",style:{background:`linear-gradient(135deg, ${h.colors.primary}15, transparent)`,borderColor:`${h.colors.primary}40`},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(rt,{type:p.type,rank:p.rank,size:"md",showRank:!1}),e.jsx("span",{className:"text-xl",children:h.icon})]}),e.jsxs("div",{className:"text-2xl font-bold",style:{color:h.colors.primary},children:["#",p.rank]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:h.name})]},p.type)})})};function kt({walletAddress:g,displayName:m,className:p}){const{isAuthenticated:h,isLoading:k}=Re(),[R,z]=d.useState(!1),{data:C,isLoading:I}=nt(g),L=ot(),v=lt(),U=L.isPending||v.isPending,r=async()=>{if(!h){z(!0);return}try{C?(await v.mutateAsync(g),re.success("Unfollowed wallet")):(await L.mutateAsync({walletAddress:g,displayName:m}),re.success("Following wallet"))}catch(x){console.error("Follow/unfollow error:",x),re.error((x==null?void 0:x.message)||(C?"Failed to unfollow":"Failed to follow"))}};return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{variant:"outline",size:"sm",onClick:r,disabled:U,className:p,children:U?e.jsx(ye,{className:"h-4 w-4 animate-spin"}):C?e.jsxs(e.Fragment,{children:[e.jsx(dt,{className:"h-4 w-4 mr-1"}),"Unfollow"]}):e.jsxs(e.Fragment,{children:[e.jsx(mt,{className:"h-4 w-4 mr-1"}),"Follow"]})}),e.jsx(at,{open:R,onOpenChange:z})]})}function we(g){const m=Number(g.currentPrice);return g.redeemable===!0||Number.isFinite(m)&&(m<=.01||m>=.99)}
7const Hr=()=>{const{address:g}=Ue(),m=Ve(),[p,h]=d.useState(null),[k,R]=d.useState(!1),[z,C]=d.useState(null),I=g||"",L=I.startsWith("@"),[v,U]=d.useState(null);d.useEffect(()=>{if(!L){h(I);return}const t=I.slice(1);R(!0),C(null),(async()=>{try{const{data:l,error:j}=await ae.functions.invoke("search-wallets",{body:{query:t,limit:1}});if(j)throw j;if(l!=null&&l.results&&l.results.length>0){const N=l.results[0].wallet;m(`/address/${N}`,{replace:!0})}else C(`User "@${t}" not found on Polymarket`)}catch(l){console.error("[TraderProfile] Username resolution error:",l),C(`Could not resolve username "@${t}"`)}finally{R(!1)}})()},[I,L,m]);const r=d.useMemo(()=>(p||"").toLowerCase(),[p]),{data:x}=Me(r),$=Ze(r),K=r.length===42&&r.startsWith("0x"),{walletAddress:V}=We(),Z=Be();d.useEffect(()=>{!V||!K||r.toLowerCase()!==V.toLowerCase()&&Z("view_5_trader_profiles",V,{dedupeKey:r.toLowerCase()})},[V,r,K,Z]);const{data:s,isLoading:le}=xt(r),{data:w,isLoading:Q,isError:ve}=ct(r,1e6),{data:y,isLoading:G,isError:be,refetch:Ne}=qe(r,1e6),c=w,u=y,J=d.useMemo(()=>(w??[]).filter(t=>!we(t)),[w]),ee=d.useMemo(()=>{const t=new Set((y??[]).map(n=>n.tokenId).filter(Boolean));return(w??[]).filter(n=>we(n)&&n.pnl<0&&(!n.tokenId||!t.has(n.tokenId)))},[y,w]),[te,ke]=d.useState(1e6),{data:i,isLoading:Pe,isLoadingMore:Pt}=ut(r,te),ie=d.useRef(null);d.useEffect(()=>{if(te>=1e6)return;const t=ie.current;if(!t||typeof IntersectionObserver>"u")return;const n=new IntersectionObserver(([l])=>{l.isIntersecting&&(ke(1e6),n.disconnect())},{rootMargin:"600px"});return n.observe(t),()=>n.disconnect()},[te]);const{data:de}=tt(r),{data:_,isLoading:Le}=pt(r),[$e,_e]=d.useState(null),[Se,Ce]=d.useState(null),[M,Te]=d.useState(null);d.useEffect(()=>{if(!r||L)return;(async()=>{const{data:n}=await ae.from("trader_metrics_full").select("username, display_name").eq("wallet",r.toLowerCase()).maybeSingle();n!=null&&n.username&&(console.log("[TraderProfile] Got username from DB:",n.username),_e(n.username),Ce(n.display_name));const{data:l}=await ae.from("wallet_proxy_mappings").select("eoa_wallet").eq("proxy_wallet",r.toLowerCase()).maybeSingle();l!=null&&l.eoa_wallet&&(console.log("[TraderProfile] Found EOA wallet:",l.eoa_wallet),Te(l.eoa_wallet))})()},[r,L]);const a=(s==null?void 0:s.username)||$e||null,Y=(s==null?void 0:s.display_name)||Se||a;d.useEffect(()=>{a&&!L&&r&&!k&&window.history.replaceState(null,"",`/address/@${a}`)},[a,L,r,k]);const W=s?{totalPnL:s.total_pnl,totalVolume:s.volume}:null,b=ht((s==null?void 0:s.daily_pnl)??[]),T=d.useMemo(()=>i?i.reduce((t,n)=>t+parseFloat(n.size)*parseFloat(n.price),0):0,[i]),me=d.useMemo(()=>!b||b.length===0?null:b[b.length-1].cumulativePnL,[b]),f=me!==null?me:(W==null?void 0:W.totalPnL)??null,Ae=le&&Q&&Le,o=d.useMemo(()=>{if(!s)return null;const t=s.wins,n=s.losses;if(t==null||n==null)return null;const l=t+n;return l>0?Math.round(t/l*100):null},[s]),F=a?`@${a}`:P(r),ce=d.useMemo(()=>{const t=new URLSearchParams({type:"trader",wallet:r,pnl:String(f||0),trades:String((i==null?void 0:i.length)||(s==null?void 0:s.num_trades)||0),volume:String(T||(s==null?void 0:s.volume)||0)});return o!=null&&t.set("winrate",String(o)),a&&t.set("username",a),`https://gzydspfquuaudqeztorw.supabase.co/functions/v1/generate-og-image?${t.toString()}`},[r,f,o,i==null?void 0:i.length,T,s,a]),O=f!==null?`${f>=0?"+":""}${S(f)}`:"View PnL";return k?e.jsx(ne,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] gap-4",children:[e.jsx(ye,{className:"h-8 w-8 animate-spin text-primary"}),e.jsxs("p",{className:"text-muted-foreground",children:["Looking up user @",I.slice(1),"..."]})]})}):z?e.jsx(ne,{children:e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[50vh] gap-4",children:e.jsxs("div",{className:"p-4 bg-destructive/10 border border-destructive/30 rounded-lg max-w-md text-center",children:[e.jsx("p",{className:"text-destructive font-medium",children:z}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Try searching for a different username or enter a wallet address directly."})]})})}):e.jsxs(e.Fragment,{children:[e.jsxs(Fe,{children:[e.jsx("title",{children:(()=>{const t=`${F}
7${O!=="View PnL"?` ${O}`:""}${o!=null&&o>0?` ${o}%`:""} | PolymarketScan`;return t.length<=60?t:`${F} | PolymarketScan`})()}),e.jsx("meta",{name:"description",content:`Polymarket trader ${F} — ${S(T||(s==null?void 0:s.volume)||0)} total volume${o==null?"":`, ${o}% win rate`} across ${(i==null?void 0:i.length)||(s==null?void 0:s.num_trades)||0} trades. View all positions and trade history.`}),e.jsx("meta",{name:"keywords",content:`${a?`${a}, ${a} Polymarket, `:""}${r}, ${P(r)}, Polymarket trader profile, Polymarket PnL, Polymarket win rate, prediction market trader, Polymarket wallet, Polymarket portfolio, Kalshi trader, prediction market performance`}),e.jsx("meta",{name:"robots",content:"index, follow"}),e.jsx("link",{rel:"canonical",href:`${X}/trader/${a?`@${a}`:r}`}),e.jsx("meta",{property:"og:title",content:`Trader ${F}${O!=="View PnL"?` | ${O} PnL`:""} | PolymarketScan`}),e.jsx("meta",{property:"og:description",content:`Polymarket trader ${F} — ${S(T||(s==null?void 0:s.volume)||0)} total volume${o==null?"":`, ${o}% win rate`}. View positions and trade history.`}),e.jsx("meta",{property:"og:url",content:`${X}/trader/${a?`@${a}`:r}`}),e.jsx("meta",{property:"og:type",content:"profile"}),e.jsx("meta",{property:"og:image",content:ce}),e.jsx("meta",{property:"og:image:width",content:"1200"}),e.jsx("meta",{property:"og:image:height",content:"630"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:`${a?`${a} (${P(r)})`:P(r)} | ${O} PnL | Polymarket Trader`}),e.jsx("meta",{name:"twitter:description",content:`${a?`${a}'s`:P(r)} Polymarket profile: ${o==null?"win rate not measured":`${o}% win rate`} • ${(i==null?void 0:i.length)||(s==null?void 0:s.num_trades)||0} trades • ${S(T||(s==null?void 0:s.volume)||0)} volume`}),e.jsx("meta",{name:"twitter:image",content:ce}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"ProfilePage",mainEntity:{"@type":"Person",name:a||P(r),...a?{alternateName:r}:{},description:`${a||P(r)} is a Polymarket trader with ${O} PnL${o==null?"":` and a ${o}% win rate`}.${a?` Wallet: ${r}`:""}`,url:`${X}/trader/${a?`@${a}`:r}`,identifier:r,sameAs:[`https://polymarket.com/profile/${a||r}`]},isPartOf:{"@type":"WebSite",name:"PolymarketScan",url:X}})})]}),e.jsxs(ne,{children:[e.jsx("div",{hidden:!0,"aria-hidden":"true","data-trader-profile-marker":"polynode","data-trader-name":$.name??"","data-trader-pseudonym":$.pseudonym??"","data-trader-source":$.source,"data-trader-not-found":String($.notFound),"data-trader-is-lightweight-proxy":String($.isLightweightProxy),"data-trader-eoa":$.eoaWallet??"","data-trader-total-pnl":String($.totalPnl),"data-trader-trades":String($.trades)}),!K&&e.jsxs("div",{className:"mb-8 p-4 bg-destructive/10 border border-destructive/30 rounded-lg",children:[e.jsx("p",{className:"text-destructive font-medium",children:"Invalid wallet address"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"This address doesn't appear to be a valid Ethereum wallet. The leaderboard currently shows demo data."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ye,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:a?e.jsxs(e.Fragment,{children:["@",e.jsx("span",{className:"text-primary",children:a})," — Polymarket Trading Profile & PnL"]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-mono text-xl md:text-2xl",children:P(r)})," — Polymarket Trading Profile & PnL"]})}),a&&e.jsx("a",{href:xe(a),target:"_blank",rel:"noopener noreferrer",className:"text-xs px-2 py-1 bg-primary/10 text-primary rounded hover:bg-primary/20 transition-colors",children:"Polymarket"})]}),Y&&Y!==a&&e.jsx("p",{className:"text-sm text-muted-foreground",children:Y}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground
7/70 break-all",children:r}),e.jsx(fe,{text:r}),e.jsx("a",{href:`https://polygonscan.com/address/${r}`,target:"_blank",rel:"noopener noreferrer",className:"p-1 rounded hover:bg-muted transition-colors",children:e.jsx(se,{className:"h-3 w-3 text-muted-foreground hover:text-primary"})})]}),M&&e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"EOA:"}),e.jsx("a",{href:`/address/${M}`,className:"font-mono text-xs text-primary hover:underline break-all",children:P(M)}),e.jsx(fe,{text:M}),e.jsx("a",{href:`https://polygonscan.com/address/${M}`,target:"_blank",rel:"noopener noreferrer",className:"p-1 rounded hover:bg-muted transition-colors",children:e.jsx(se,{className:"h-3 w-3 text-muted-foreground hover:text-primary"})})]}),x&&(x.viewCount>0||x.watcherCount>0)&&e.jsxs("div",{className:"flex items-center gap-3 pt-1 text-[11px] text-muted-foreground/80",children:[x.viewCount>0&&e.jsxs("span",{className:"inline-flex items-center gap-1",title:`${x.viewCount.toLocaleString()} unique sessions have viewed this profile`,children:[e.jsx(ft,{className:"h-3 w-3"}),e.jsx("span",{className:"tabular-nums",children:x.viewCount.toLocaleString()}),e.jsx("span",{children:x.viewCount===1?"view":"views"})]}),x.watcherCount>0&&e.jsxs("span",{className:"inline-flex items-center gap-1",title:`Added to ${x.watcherCount.toLocaleString()} watch ${x.watcherCount===1?"list":"lists"}`,children:[e.jsx(Oe,{className:"h-3 w-3"}),e.jsx("span",{className:"tabular-nums",children:x.watcherCount.toLocaleString()}),e.jsxs("span",{children:["on ",x.watcherCount===1?"watch list":"watch lists"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(kt,{walletAddress:r}),e.jsx(st,{walletAddress:r,displayName:Y||P(r)}),e.jsx(Qe,{title:`Trader ${F} | PolymarketScan`}),e.jsxs("a",{href:xe(r),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-semibold hover:bg-primary/90 transition-colors shadow-lg shadow-primary/20",onClick:()=>{V&&Z("view_polymarket_profile",V,{dedupeKey:"click"})},children:[e.jsx(se,{className:"h-4 w-4"}),"View on Polymarket"]})]})]}),e.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[e.jsx(E,{load:()=>A(()=>import("./WalletSpiderMap-BBH43HNA.js"),__vite__mapDeps([0])).then(t=>({default:t.WalletSpiderMap})),componentProps:{wallet:r},minHeight:320,rootMargin:"400px"}),e.jsx(E,{load:()=>A(()=>import("./RelatedWalletsCard-D4ezQMku.js"),__vite__mapDeps([0])).then(t=>({default:t.RelatedWalletsCard})),componentProps:{proxyAddress:r},minHeight:120,rootMargin:"400px"})]})]}),e.jsx("section",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-8",style:{minHeight:96},children:Ae?e.jsxs(e.Fragment,{children:[e.jsx(H,{}),e.jsx(H,{}),e.jsx(H,{}),e.jsx(H,{}),e.jsx(H,{}),e.jsx(H,{})]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{label:"USDC Balance",value:(_==null?void 0:_.usdcBalance)!==void 0?S(_.usdcBalance):"—",icon:it}),e.jsx(B,{label:"Portfolio Value",value:_!=null&&_.portfolioValue?S(_.portfolioValue):"—",icon:yt}),e.jsx(B,{label:"Total Volume",value:S(T||(W==null?void 0:W.totalVolume)||0),icon:gt}),e.jsx(B,{label:"Total Trades",value:pe((i==null?void 0:i.length)||0,0),icon:je}),e.jsx(B,{label:"Open Positions",value:pe((w==null?void 0:w.length)||0,0),icon:oe}),e.jsx(B,{label:"Total PnL",value:f!==null?`${f>=0?"+":""}${S(f)}`:"—",icon:jt,className:D(f!==null&&f>=0?"border-success/30":"",f!==null&&f<0?"border-destructive/30":"")}),e.jsxs("div",{className:D("stat-card flex items-center gap-4",o==null?"":o>=60?"border-success/30":o<40?"border-destructive/30":""),children:[e.jsxs("div",{className:"relative w-16 h-16 flex-shrink-0",children:[e.jsxs("svg",{viewBox:"0 0 36 36",className:"w-full h-full -rotate-90",children:[e.jsx("circle",{cx:"18",cy:"18",r:"15.5",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"3"}),o!=null&&e.jsx("circle",{cx:"18",cy:"18",r:"15.5",fill:"none",stroke:o>=60?"hsl(var(--success))":o>=40?"hsl(var(--primary))":"hsl(var(--destructive))",strokeWidth:"3",strokeDasharray:`${o*.9738} ${97.38-o*.9738}`,strokeLinecap:"round"})]}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-bold text-foreground",children:o==null?"—":`${o}%`})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:"Win Rate"}),e.jsx("p",{className:"text-xl font-bold text-foreground",children:o==null?"—":`${o}%`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:(s==null?void 0:s.wins)==null||(s==null?void 0:s.losses)==null?"Not measured for this wallet":`${s.wins} / ${s.wins+s.losses} positions`})]})]})]})}),de&&e.jsxs("section",{className:"mb-8",children:[e.jsxs("h2",{className:"text-xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(wt,{className:"h-5 w-5 text-primary"}),"Leaderboard Rankings"]}),e.jsx("div",{className:"bg-card border border-border rounded-lg p-6",children:e.jsx(Nt,{ranks:de})})]}),e.jsx("section",{className:"mb-8",style:{minHeight:360},children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx("div",{className:"lg:col-span-2",children:v?e.jsx(Ge,{position:v,onClose:()=>U(null)}):b&&b.length>0?e.jsx(Je,{dailyPnL:b,wallet:p||g,lifetimeVolumeUsd:T||(s==null?void 0:s.volume)||void 0}):!le&&f!==null&&e.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 h-full",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsx("h3",{className:"text-lg font-semibold",children:"PnL"})}),e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"Chart data is still loading..."}),e.jsx("p",{className:"text-sm mt-1",children:"Historical PnL data may take a moment to compute."})]})]})}),K&&e.jsx("div",{className:"lg:col-span-1 h-full",style:{minHeight:320},children:e.jsx(E,{load:()=>A(()=>import("./TraderActivityChart-oivzd3pU.js").then(t=>t.T),__vite__mapDeps([0])).then(t=>({default:t.TraderActivityChart})),componentProps:{wallet:r},minHeight:320,rootMargin:"400px"})})]})}),b&&b.length>0&&e.jsx("section",{className:"mb-8",style:{minHeight:240},children:e.jsx(E,{load:()=>A(()=>import("./PnLCalendar-MDIJksp6.js"),__vite__mapDeps([0])).then(t=>({default:t.PnLCalendar})),componentProps:{dailyPnl:b.filter(t=>!t.isOpeningSnapshot).map(t=>({date:t.date,pnl:t.pnl}))},minHeight:240,rootMargin:"400px"})}),e.jsxs("section",{className:"mb-8",children:[e.jsxs("h2",{className:"text-xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(oe,{className:"h-5 w-5 text-primary"}),"Positions"]}),e.jsxs(He,{defaultValue:J.length===0&&(((y==null?void 0:y.length)??0)>0||ee.length>0)?"closed":"open",className:"w-full",children:[e.jsxs(ze,{children:[e.jsxs(he,{value:"open",children:["Open (",Q&&!w?"…":J.length.toLocaleStr
7ing(),")"]}),e.jsxs(he,{value:"closed",children:["Closed (",(()=>{const t=y;if(G&&!(t!=null&&t.length))return"…";const n=(((t==null?void 0:t.length)||0)+ee.length).toLocaleString(),l=t!=null&&t.truncated?"+":G||t!=null&&t.loading?"…":"";return`${n}${l}`})(),")"]}),(()=>{const t=y;return t!=null&&t.loading?null:(t==null?void 0:t.status)==="interrupted"?e.jsxs("button",{type:"button",onClick:()=>Ne(),className:"ml-2 text-xs text-amber-500/90 hover:text-amber-400 underline-offset-2 hover:underline self-center",title:"Stream interrupted — click to retry",children:["⚠ Stream interrupted at ",(t.length||0).toLocaleString()," — retry"]}):(t!=null&&t.failedPages,null)})()]}),e.jsx(ge,{value:"open",className:"mt-4",children:e.jsx("div",{className:"bg-card border border-border rounded-lg p-4",children:J.length>0?e.jsx(De,{positions:J,isLoading:Q,pageSize:10,activeChartId:v==null?void 0:v.id,onShowChart:t=>{let n;if(i&&i.length>0){const l=i.filter(j=>j.asset_id&&t.tokenId&&j.asset_id===t.tokenId||(j.market===t.market.id||j.event_slug===t.market.id)&&(j.outcome||"").toLowerCase()===t.outcome.toLowerCase());if(l.length>0){const j=l.reduce((N,q)=>new Date(q.timestamp).getTime()<new Date(N.timestamp).getTime()?q:N);n=new Date(j.timestamp).getTime()}}U({id:t.id,marketQuestion:t.market.question||"Unknown Market",outcome:t.outcome,shares:t.shares,avgPrice:t.avgPrice,tokenId:t.tokenId,openedAtMs:n,closedAtMs:void 0,isClosed:!1,finalPnl:t.pnl}),window.scrollTo({top:0,behavior:"smooth"})}}):e.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No open positions"})})}),e.jsx(ge,{value:"closed",className:"mt-4",children:e.jsx("div",{className:"bg-card border border-border rounded-lg p-4",children:e.jsx(Ke,{wallet:r,positions:y||[],isLoading:G,pageSize:10,activeChartId:v==null?void 0:v.id,profileTotalPnl:f,awaitingRedemptionLosses:ee,historyMeta:{loading:G||!!(u!=null&&u.loading),status:(u==null?void 0:u.status)??"interrupted",failedPages:(u==null?void 0:u.failedPages)??(be?1:0),fetchedCount:(u==null?void 0:u.fetchedCount)??(y==null?void 0:y.length)??0,source:(u==null?void 0:u.source)??"unknown",retrievedAt:u==null?void 0:u.retrievedAt},awaitingRedemptionMeta:{loading:Q,error:ve||!!(c!=null&&c.error),status:(c==null?void 0:c.status)??"unknown",failedPages:(c==null?void 0:c.failedPages)??0,fetchedCount:(c==null?void 0:c.fetchedCount)??(w==null?void 0:w.length)??0,source:(c==null?void 0:c.source)??"unknown",retrievedAt:c==null?void 0:c.retrievedAt},onShowChart:t=>{const n=t.rowStatus==="awaiting_redemption_loss";let l;if(i&&i.length>0){const j=i.filter(N=>N.asset_id&&t.tokenId&&N.asset_id===t.tokenId||(N.outcome||"").toLowerCase()===t.outcome.toLowerCase()&&(N.marketQuestion||"").toLowerCase()===t.market.toLowerCase());if(j.length>0){const N=j.reduce((q,ue)=>new Date(ue.timestamp).getTime()<new Date(q.timestamp).getTime()?ue:q);l=new Date(N.timestamp).getTime()}}U({id:t.id,marketQuestion:t.market||"Unknown Market",outcome:t.outcome,shares:t.size,avgPrice:t.avgPrice,tokenId:t.tokenId,openedAtMs:l,closedAtMs:n?void 0:t.closedAt?new Date(t.closedAt).getTime():void 0,isClosed:!n,finalPnl:t.pnl}),window.scrollTo({top:0,behavior:"smooth"})}})})})]})]}),e.jsxs("section",{ref:ie,style:{minHeight:480},children:[e.jsxs("h2",{className:"text-xl font-semibold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(je,{className:"h-5 w-5 text-primary"}),"Trade History"]}),e.jsx(E,{load:()=>A(()=>import("./TradesTable-B5EaEnck.js"),__vite__mapDeps([0])).then(t=>({default:t.TradesTable})),componentProps:{trades:i||[],isLoading:Pe,showTrader:!1},minHeight:400,rootMargin:"600px"})]}),e.jsx("section",{className:"mt-8",style:{minHeight:200},children:e.jsx(E,{load:()=>A(()=>import("./TraderProfileComments-fEcU_8h-.js"),__vite__mapDeps([0])).then(t=>({default:t.TraderProfileComments})),componentProps:{profileWallet:r,viewerDisplayName:null},minHeight:200,rootMargin:"400px"})}),e.jsx("section",{className:"mt-8",style:{minHeight:200},children:e.jsx(E,{load:()=>A(()=>import("./SimilarTraders-CMJREBtY.js").then(t=>t.S),__vite__mapDeps([0])).then(t=>({default:t.SimilarTraders})),componentProps:{currentWallet:r},minHeight:200,rootMargin:"400px"})}),e.jsx(Xe,{title:"Dig deeper",links:[{to:"/leaderboard",label:"Trader rankings by tag"},{to:"/whales",label:"Smart-money trades"},{to:"/learn/polymarket-whales-explained",label:"How whales move markets"},{to:"/learn/how-to-trade-polymarket",label:"Trade the same markets"},{to:"/discover",label:"Discover similar profiles"}]})]})]})};export{Hr 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.