IronBank ($CREAM) was exploited on $37.5M, let’s take a quick look at what happened.👇
1/ Attacker used Alpha Homora for borrowing sUSD from IronBank.
Each time they borrow twice as much as in the previous one.
2/ They do this through two transactions and each time they lend the funds back into IronBank, receiving cySUSD.
3/ At some point exploiter took $1.8M USDC flash loan from Aave v2 and swapped USDC to sUSD using Curve.
4/ They lend these sUSD to IronBank, which allows them to continue borrowing and lending them, receiving cySUSD.
5/ Of course, some sUSD are spent on repayment of the flash loan.
6/ Also, a 10M USD flash loan is taken, which is also used to increase the number of cySUSD.
7/ In the end, the number of their cySUSD reaches an incredible amount, which allows them to borrow anything from IronBank.
8/ Then they borrow:
- 13.2k WETH
- 3.6M USDC
- 5.6M USDT
- 4.2M DAI
9/ Stablecoins have been deposited to Aave v2,
1k ETH to IronBank deployer,
1k ETH to Homora deployer,
220 ETH to Tornado,
100 ETH granted to Tornado
and almost 11k ETH remain on the exploiter balance.
To obtain such a profit, the attacker executed 11 transactions.
Below is a very superficial explanation of what was happening in these transactions👇
1/ Flash loaned 116k ETH from dYdX 2/ Flash loaned 99k ETH from Aave v2 3/ Borrow 134M USDC and 129M DAI using ETH as collateral on Compound 4/ Add 134M USDC and 36M DAI to 3crv Curve pool 5/ Withdraw 165M USDT from 3crv Curve pool 6/ Repeat five times👇
- Deposit 93M DAI to yDAI vault (less w/ each time)
- Add 165M USDT to 3crv pool
- Withdraw 92M DAI from yDAI vault (less w/ each time)
- Withdraw 165M USDT from 3crv pool 7/ In the last time withdraw 39M DAI and 134M USDC instead USDT 8/ Repay Compound debts 9/ Repay flash loans
Let’s go back to Curve’s SynthSwap and use a real example to calculate the benefits of using it for large trades.
Due to the way Synthetix works, trades using Virtual Synths are divided into two transactions. Consequently, people using SynthSwap carry certain price risks.
2/5
The first transaction: 1) 9M USDT swapped to 8.95M sUSD through Curve sUSD v2 pool (0.5% negative slippage) 2) 8.95M sUSD swapped to 6.69k sETH through Synthetix Exchange (0.3% fee)
3/5
The second transaction took place 37 minutes after the first: 3) 6.69k sETH swapped to 6.71k ETH through Curve sETH pool (0.3% positive slippage)
So in this trade, ETH price was $1,341. For comparison, CoinGecko gives us $1,330.6 as ETH price, but what about the slippage?