export interface PostImage {
  src: string
  alt: string
  aspectRatio?: string
  fit?: 'cover' | 'contain'
}

export interface PostLink {
  label: string
  href: string
}

export interface Post {
  id: number
  number: number
  category: string
  title: string
  date: string
  content: string[]
  links?: PostLink[]
  images?: PostImage[]
}

export const posts: Post[] = [
  {
    id: 5,
    number: 5,
    category: 'Analysis',
    title: '$50M USDT→AAVE Swap — Bad Routing',
    date: 'Jun 26, 2026',
    content: [
      '0x98b...7ac8 just lost $50m in an attempt to buy AAVE using USDT through CoWSwap.',
      'This swap was very likely executed through AAVE\'s UI using the collateral swap feature, as it swaps from aEthUSDT to aEthAAVE, which represent deposits of USDT and AAVE into the AAVE protocol.',
      'The cause is mostly bad routing done by most aggregators. Below is a screenshot from matchametaxyz and CoWSwap, showing that all aggregators struggle with this. It doesn\'t seem to us that CoWSwap misrepresents the price of aEthAAVE.',
    ],
    links: [
      { label: 'Etherscan Tx', href: 'https://etherscan.io/tx/0x9fa9feab3c1989a33424728c23e6de07a40a26a98ff7ff5139f3492ce430801f' },
    ],
    images: [
      {
        src: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-37iQy4Dx8v9SMxjxpHvX2oE3g10faM.png',
        alt: 'CoWSwap aggregator comparison showing 99.28% price impact on $50M USDT to aEthAAVE swap',
      },
    ],
  },
  {
    id: 4,
    number: 4,
    category: 'Exploit',
    title: 'Silo Finance — soUSDC Vault Exploit on Arbitrum',
    date: 'Jun 25, 2026',
    content: [
      'Earlier today, ~392k USDC from SiloFinance\'s managed soUSDC vault on Arbitrum was forcibly allocated into the wstUSR/USDC market, leaving bad debt.',
      'wstUSR was trading at ~$0.12 onchain, but the Silo market\'s oracle priced it at 1 wstUSR = 1.1329 USDC. Anyone who bought wstUSR cheaply could use it as collateral worth ~10x its real value.',
      'The exploiter called deposit() on the wstUSR market directly, donating the shares to soUSDC. The supply cap controlling how much soUSDC can actively allocate to this market was 0, but that cap only governs the vault\'s own outbound deposits. It does nothing to stop external parties from crediting positions to the vault.',
      'Each attack loop: (1) Flash-loan USDC. (2) Deposit the bulk of USDC to soUSDC. (3) Deposit a small amount to the wstUSR market directly, donate shares to soUSDC. (4) Borrow that USDC back using cheap wstUSR at the inflated oracle price. (5) Redeem the soUSDC shares — totalAssets() now includes the gifted position, so shares are worth more. (6) Walk away with profit.',
      'Each loop was limited by how much wstUSR the attacker had, so between loops they kept buying more on the open market — driving wstUSR from ~$0.12 to ~$0.75. The loop ran 32 times over ~75 minutes.',
      'soUSDC depositors are now exposed to ~392k of undercollateralised debt at 100% utilisation. SiloVault is forked from Morpho\'s MetaMorpho contract. Any MetaMorpho/SiloVault-style vault that counts externally credited market balances in totalAssets() and relies on a stale or structurally incomplete pricing path can be exposed to this same class of attack.',
    ],
    links: [
      { label: 'Exploit Tx', href: 'https://arbiscan.io/tx/0xd354389e6f08ad1f59ab3100737c2ccbc7f7a2d22ba4775b4f8296a0d0c2363e' },
      { label: 'Exploiter', href: 'https://debank.com/profile/0x8170ca5522aee6875f9f2ed89f3322083af5da6e/history' },
      { label: 'soUSDC Vault', href: 'https://v2.silo.finance/vaults/arbitrum/0x2514A2Ce842705EAD703d02fABFd8250BfCfb8bd' },
      { label: 'wstUSR Market', href: 'https://v2.silo.finance/markets/arbitrum/wstusr-usdc-149' },
    ],
    images: [
      {
        src: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-yVvOjPK0njOOL6Dd5PqGECvs7E8hDX.png',
        alt: 'USD/wstUSR price chart showing the price run from $0.12 to $0.75 then crashing to $0.34 during the Silo exploit',
      },
    ],
  },
  {
    id: 3,
    number: 3,
    category: 'Transparency',
    title: 'Ethena Updates Transparency Page — $2.8B of $4.4B Visible Onchain',
    date: 'Jun 20, 2026',
    content: [
      'Ethena (@ethena) has updated its transparency page, providing exact visibility into where assets are deployed and making all onchain wallets public.',
      'As of now, $2.8B of $4.4B, around 64%, is visible onchain. The remainder sits in custodial solutions where user assets are commingled and cannot be easily identified.',
    ],
    links: [
      { label: 'Transparency Page', href: 'https://app.ethena.fi/dashboards/backing-assets' },
      { label: 'EVM Cluster', href: 'https://debank.com/bundles/222638/portfolio' },
      { label: 'Solana', href: 'https://jup.ag/portfolio/C23FGxQB2LsoTbZsQr5w3R7b3sw5saxPLGJ4ujvyH34L' },
    ],
    images: [
      {
        src: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-XdCYLpMGCKB2ayFGNyVotKzztXyyQn.png',
        alt: 'Ethena backing assets dashboard showing DeFi Lending, Institutional Lending, and Liquid Stables breakdown',
        aspectRatio: '4/5',
        fit: 'contain' as const,
      },
    ],
  },
  {
    id: 2,
    number: 2,
    category: 'Analysis',
    title: 'Ethena Self-Lending: $1.33B out of $4.4B',
    date: 'Jun 20, 2026',
    content: [
      'By our calculations, $1.33B out of $4.4B of USDe\'s backing is lending against itself.',
      'Rule used: Estimated self-lending = gross borrowing against USDe/sUSDe collateral × Ethena\'s share of supplied liquidity in that market. So if a pool has $556M borrowed against USDe/sUSDe, but Ethena supplies 47.4% of the liquidity, we attribute ~$263M of that as Ethena-funded self-lending.',
      'Using this pro-rata method: Estimated Ethena self-lending: ~$1.33B · Gross amount borrowed against Ethena assets: ~$1.67B · Difference from pro-rata attribution: ~$336M',
    ],
    links: [
      { label: 'AAVE Exposures', href: 'https://research.yuzu.money/aave-exposures' },
      { label: 'Steakhouse USDtb', href: 'https://app.morpho.org/ethereum/vault/0xBeEFC1CDAfc5b4a649b54D07AFc6bF0f75C6F4E2/steakhouse-ethena-usdtb#overview' },
      { label: 'Kamino', href: 'https://kamino.com/earn/lend/ethena-prime/vault-overview' },
      { label: 'Backing', href: 'https://app.ethena.fi/dashboards/backing-assets' },
    ],
    images: [
      {
        src: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-I14QSpMs5o3NiIE6vkhrJ9RSad7ZIq.png',
        alt: 'Ethena Estimated Self-Lending table showing $1.33B total across Aave, Morpho, Kamino and Juplend markets',
        aspectRatio: '5/3',
        fit: 'contain' as const,
      },
    ],
  },
  {
    id: 1,
    number: 1,
    category: 'Security',
    title: 'Fluid Lost 125k FLUID & 51.9k GHO — Key Compromise',
    date: 'May 27, 2026',
    content: [
      'Fluid lost 125k FLUID and 51.9k GHO due to a key compromise. A wallet was able to claim rewards from multiple Fluid Merkle distributors using empty-proof Merkle claims, then swap funds and route ETH into Tornado Cash.',
      'The timeline on Ethereum was very tight: proposer submits root, approver approves it, exploiter claims FLUID ~24 seconds after proposal. The GHO claim followed minutes later. The same wallet then swapped the claimed GHO and FLUID, bridged some Base/Arbitrum proceeds out, and later deposited ETH into Tornado Cash Router.',
      'Several hours later, an admin-style batched tx removed the old proposer/approver roles across multiple Fluid rewards contracts.',
      'Fluid has told users that Merkle reward claiming is temporarily paused for a few days, potentially up to a week, while updates are made. Rewards will continue accumulating retroactively and claiming will resume once updates are complete. No communication about a key compromise or loss of funds.',
    ],
    links: [
      { label: 'Exploiter', href: 'https://debank.com/profile/0x4925120CbE5A78Bf08F26f6E8cdF820f4c1D3dfB/' },
      { label: 'Admin Batched Tx', href: 'https://etherscan.io/tx/0x5240aca9dd893f0ffbc9797cba23f9cf5eeacfd57350ffc86857f1695f5847e8' },
    ],
    images: [
      {
        src: 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-4hwQYYPCvZ3QWaDdrnSKnwLSw8OvUC.png',
        alt: 'DeBank transaction history showing Fluid claims and MetaMask swaps from the exploiter wallet',
        aspectRatio: '5/4',
      },
    ],
  },
]
