Add design doc on using Hydro vault shares as solver collateral#14
Add design doc on using Hydro vault shares as solver collateral#14p-offtermatt wants to merge 2 commits into
Conversation
Design doc for a trait-based system supporting multiple collateral types: - Native tokens (ATOM) - 0% haircut - LSM shares - 10% haircut, staking module queries - Hydro vault shares - 20% haircut, ICQ for cross-chain Key features: - Hybrid valuation: on-chain for same-chain, cached ICQ for cross-chain - Per-settlement 1.5x locking with solver-chosen asset class - Liquidation via intent auction for non-native collateral - Hard block on stale cross-chain data (1 hour max) Unifies PR #14 (Hydro vaults) with LSM share support under single framework. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hey Philip, this is great work - the valuation infrastructure for vault shares is exactly what we need. I've now landed two complementary design docs that build on your approach:
Unified DesignThe key insight is that both Hydro vault shares and LSM shares use ratio-based valuation: // Hydro: share_value = amount × (total_pool_value / total_shares_issued)
// LSM: share_value = amount × (validator.tokens / validator.shares)This lets us abstract both behind a common trait: pub trait CollateralValuation {
fn get_raw_value(&self, deps: Deps, env: &Env, amount: Uint128) -> Result<Uint128, ContractError>;
fn haircut_bps(&self) -> u64;
fn get_collateral_value(&self, ...) -> Result<Uint128, ContractError>;
fn is_liquidatable(&self, deps: Deps) -> bool;
fn asset_class(&self) -> AssetClass;
}Design Decisions
Liquidation FlowThis solves the "out of scope" piece from your PR: Same mechanism works for both Hydro vault shares and LSM shares - no separate liquidation logic needed. Suggested Next Steps
Happy to sync on the trait interface if you want to iterate on the design. The combination gives us a comprehensive collateral system that supports yield-bearing assets from both the Hydro ecosystem and native Hub staking. |
|
Yep this is great! Feel free to merge when you think this is ready, the generalization to both types of tokens looks like what I expect. |
This PR adds a quick design doc on how Inflow vault shares can be used as solver collateral.
The primary challenge is in querying the value of the vault shares, potentially across chains, this gives an idea of it.
I am using a new query I am proposing for the Inflow contracts here, so this part is not in production on Inflow yet; it makes the implementation a bit more straightforward and we likely want this in Hydro anyways.
I saw there is a PR already for allowing bonds with different tokens, I didn't take that into account here but shouldn't be too hard to adjust to it.
A piece of future work is to Integrate vault shares into solving: Shares can be liquidated by withdrawing from the vaults if there is sufficient liquidity for instant withdrawal, which solvers might want to use to trade the shares, e.g. during a solver bond liquidation of vault shares.