# Platypus: cross-asset withdrawal ratio mispricing drains pool

Platypus pool mispriced cross-asset withdrawals by using the wrong LP ratio, letting an attacker flash-loan USDC, deposit, withdraw USDT.e, swap back, and profit ~$51K.

- Payout: Real-world hack
- Severity: high
- Program: Platypus
- Analysis by: DeFiHackLabs
- Disclosed: 2023-07-12
- Write-up quality: 7/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2023-07/Platypus02_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20230712-platypus02
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity vuln:accounting-error vuln:business-logic

**Target:** Platypus AMM liquidity pool on Avalanche
**Root cause:** Deposits compute USDC amount from the USDC-LP ratio, but withdrawFromOtherAsset computes the USDT.e payout from the USDT.e-LP ratio. The two pool ratios are close but not equal, so the mismatch lets an attacker extract value.
**Steps:**
1. Flash-loan `85_000 * 1e6` USDC from Aave V3 via `flashLoanSimple`.
2. Approve and call `PlatypusPool.deposit(address(USDC), USDC.balanceOf(address(this)), address(this), block.timestamp)` to mint USDC-LP.
3. Approve LP_USDC and call `PlatypusPool.withdrawFromOtherAsset(address(USDC), address(USDTe), LP_USDC.balanceOf(address(this)), 0, address(this), block.timestamp)` to receive USDT.e priced by the USDT.e-LP ratio.
4. Approve USDTe and call `PlatypusPool.swap(address(USDTe), address(USDC), USDTe.balanceOf(address(this)), 0, address(this), block.timestamp)` to convert USDT.e back to USDC.
5. Repay the Aave flash loan plus premium; keep the remaining USDC as profit.
**How found:** The analyst observed that deposit and withdrawFromOtherAsset use different LP ratios for the same liquidity: deposits price USDC via the USDC-LP ratio while cross-asset withdrawals price USDT.e via the USDT.e-LP ratio. The two ratios are close but not identical, creating an arbitrage-like mispricing.
**Exploitation:** Attacker flash-borrowed 85,000 USDC from Aave V3, deposited into Platypus to mint USDC-LP, then used withdrawFromOtherAsset to redeem that LP for USDT.e at the USDT.e-LP ratio rather than the USDC-LP ratio. Because the ratios differed slightly, the attacker received more USDT.e than fair, swapped it back to USDC, repaid the flash loan, and netted ~$51K.
**Insight:** In multi-asset AMMs, check whether mint and redeem paths for cross-asset operations use the same pool ratio; any asymmetry between the source and destination asset LP ratios can be arbitraged with a flash loan.

