[simplex]: ERC-4626 vault funding venue#958
Conversation
|
haven't looked at the code yet, but this should support hydrating free USDC/USDT balances at startup to aave & everytime its cumulative stablecoin free balance crosses some minimum threshhold. |
|
also do we check maxDeposit/maxWithdrawal before interacting with the vault? |
seunlanlege
left a comment
There was a problem hiding this comment.
Inline review of the ERC-4626 vault funding venue. Two pre-existing concerns plus the two requested additions (maxDeposit check, redeemOnShutdown flag) are left as inline comments at the relevant sections.
Blocking-ish: (1) the [erc4626] vs [vault] config-key mismatch silently disables the feature for anyone following the docs; (2) the reservation (consumed) accounting looks like it leaks for evaluated-but-not-won orders and can degrade sourcing to zero over time — worth confirming. Everything else is polish. Nice use of maxWithdraw as the authoritative sourcing cap, and good atomic approve+deposit batching.
…maxDeposit clamp, redeemOnShutdown
seunlanlege
left a comment
There was a problem hiding this comment.
Re-reviewed at 4f0421d — thanks, all four items from the last pass are addressed:
- ✅ Config key — now
[vault]consistently across code,filler-config-example.toml, and docs (plannernamealso renamed"Vault"). - ✅ Reservation leak — replaced the monotonic
consumedcounter with TTL-bounded reservations; won bids release immediately on the realised position drop, lost bids expire. Good back-to-back-fill and TTL-expiry tests. - ✅ maxDeposit clamp — added to the ABI and the sweep now deposits
min(excess, maxDeposit), skipping when headroom <minSweep. Covered by two new tests. - ✅ redeemOnShutdown — per-vault flag, defaults
false(positions kept across restarts), honoured inredeemChainand documented in the example config. Tested both ways.
Also a nice unprompted catch: ordering the vault venue before the V4 LP for the FX strategy so stablecoins source from the treasury before draining (and perturbing the price of) a concentrated-liquidity position.
Two small non-blocking notes inline (TTL vs. slow cross-chain settlement; a benign FIFO-vs-expiry ordering nit in releaseReserved). LGTM otherwise.
seunlanlege
left a comment
There was a problem hiding this comment.
One follow-up design suggestion on the sweep config naming/semantics — non-blocking, details inline on VaultConfig and sweepChain. TL;DR: replace threshold (retained float) + minSweep (dust floor) with minBalance (floor to keep in wallet) + threshold (high-water trigger that sweeps down to minBalance). Drops minSweep entirely and gives clean hysteresis with two self-explanatory knobs.
… reservations, 1m TTL
|
lets try to get tests passing & we can merge |
|
Simplex test failing |
…ills stay profitable
Implements #939 — yield-venue funding via ERC-4626.
Adds a filler-wide ERC-4626 venue for sourcing and managing stablecoin liquidity. Any compliant vault (Aave stataToken, Morpho, an issuer yield vault) is a config entry — no protocol-specific code:
vault.withdraw), prepended atomically beforefillOrderin the same ERC-7821 batch; capped byvault.maxWithdraw. Wired into both the stable and FX strategies.thresholdinto the vault (exactapprove + deposit, batched in one ERC-7821 call), keeping the threshold liquid for fills.[erc4626].vaults = [{ chain, vault, threshold? }]; the underlying asset is resolved on-chain from the vault.basicstrategy tostable.