Repository navigation
feat(simulation): enable sDAI in the erc4626 and curve filters - #1627
Conversation
Remove sDAI from erc4626_filter and add an ERC4626 vault allowlist to curve_filter with sDAI as its only entry. sDAI's rate reads only `pot`, which DCI indexes in full, so quotes match the chain on every branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…entries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
This first paragraph still says only oracle coins can be trusted. With this PR an ERC4626 coin can be trusted too, and the stETH pool allowlist already made it out of date.
There was a problem hiding this comment.
Fixed. The paragraph now lists all three trusted lists: oracle providers, ERC4626 vaults and rebase pool ids. The has_unsupported_asset_type doc had the same gap and is fixed too.
| const TRUSTED_ERC4626_COINS: [&str; 1] = [ | ||
| // sDAI: the rate reads only `pot` (`chi`, `dsr`, `rho`) on every branch. `pot` is not a | ||
| // component token, so DCI indexes all of its storage. | ||
| "0x83f20f44975d03b1b09e64809b757c47f942beea", | ||
| ]; |
There was a problem hiding this comment.
Nit: TRUSTED_ERC4626_COINS is declared after the let ... else, but TRUSTED_RATE_ORACLES is at the top of the function. Moving it next to TRUSTED_RATE_ORACLES keeps both allowlists together.
There was a problem hiding this comment.
Moved. Both allowlists are now at the top of has_unsupported_asset_type.
The curve_filter and has_unsupported_asset_type docs said only oracle coins can be trusted. They now also name trusted ERC4626 vaults and trusted rebase pools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move TRUSTED_ERC4626_COINS next to TRUSTED_RATE_ORACLES at the top of has_unsupported_asset_type, before the asset_types early return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
erc4626_filterno longer excludes the sDAI vault (0x83f2…beea, DAI ↔ sDAI).curve_filternow has an ERC4626 vault allowlist (TRUSTED_ERC4626_COINS), matched against the pool'scoinsattribute. sDAI is the only entry, so Curve pools with sDAI as an ERC4626 coin (asset_types0x03) are kept, for example FRAX/sDAI.Why
Fynd does not route sDAI today. The vault is the only DAI ↔ sDAI venue on Tycho; the
skyprotocol covers only the PSM, the PSM wrapper and the DaiUsds converter.The filter entry came from a Dec 2025 integration-test revert. sDAI's
maxDepositreturnstype(uint256).max. The test sized swaps at 0.1% ofget_limitswith a faked DAI balance, sovat.movereverted onvat.dai[daiJoin], which equals the real DAI supply. A real deposit cannot reach that limit: aneth_calldeposit of the full 4.5B DAI supply succeeds and equalspreviewDeposit. The test has capped swaps at about $10k since June 2026. sUSDS has the samemaxDepositand is live.The sDAI rate reads only
potslots (dsr,chi,rho) on every branch.potis not a component token, so DCI indexes all of its storage.scrvUSD is not on the allowlist. After its profit unlock period ends,
convertToAssetsreadsbalance_of[vault], which DCI does not capture. The rate is then 3.7 bps too low. Over the last 175 days this happened 2.9% of the time.Tested
get_dyto the wei on update blocks. sDAI vault quotes were at most 7e-19 relative belowpreviewDeposit/previewRedeem. Between updates, the rate accrual drifts the quote by at most 0.006 bps.tycho-integration-testonerc4626andvm:curve, 60 blocks: 108 router executions each on the sDAI vault and on FRAX/sDAI. Executed amounts were at most 0.003 bps below the quote. The only failures were RPC rate limits.Fynd picks this up after a tycho-simulation version bump.
🤖 Generated with Claude Code