Open
Conversation
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
Signed-off-by: Dave Coleman <dave@wildcat.finance>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Top Level: 678
Phase Ticket: 685
P1-S1: Revolving factory interface and skeleton
P1-S2: Revolving deploy path and validation rules
P1-S3: Revolving market contract behavior
P1-S4: Unified lens market and borrower/template reads
P1-S5: Deployment scripting, template sync, and handoff artifact
Feature
A new market type implmeneting RCF (Revolving Credit Facility) behavior, while keeping legacy market behavior and ABI surfaces unchanged.
Core product behavior:
Fee math
Interest accrued to lenders:
= linear(commitmentFeeBips, deltaTime) + (linear(annualInterestBips, deltaTime) * utilization)Undrawn (
utilization = 0): only commitment fee accruesFully drawn (
utilization = 1): commitment fee + full annual interest accruesPartially drawn (
0 < utilization< 1): annual interest is utilization-weighted, commitment fee always applies.deltaTime = 0ortotalSupply = 0: no accrualall other math remains unchanged.
Changes
New factory, not retrofitting old factory:
HooksFactoryRevolving(separate deployment)HooksFactoryremains canonical for legacy market deploymentsNew market contract for revolving behavior:
WildcatMarketRevolvingdrawnAmount,commitmentFeeBips), notMarketStateBackward-compatibility:
MarketStatewas not changedhooksData) remains hook-owned and is forwarded unchangedmarketDataPrimary new/updated contracts:
src/IHooksFactoryRevolving.solsrc/HooksFactoryRevolving.solsrc/interfaces/IWildcatMarketRevolving.solsrc/market/WildcatMarketRevolving.solsrc/market/WildcatMarket.sol(new hook support)src/market/WildcatMarketBase.sol(new hook support)src/market/WildcatMarketWithdrawals.sol(new hook support)src/lens/MarketData.sol(forge fmt makes this look worse than it is)src/lens/MarketLens.sol(forge fmt, additive functionality)Important supporting changes (clanker, needs review):
script/DeployHooksFactoryRevolving.solscript/DeployMarketLens.soldocs/rcf-v2-deployment-runbook.mddocs/rcf-v2-handoff.schema.jsonLens/read-path updates
Phase 1 lens changes are additive:
MarketDataV2now exposes optional revolving fields with explicit presence flagsgetAggregatedHooksTemplatesForBorrowerWithFactoryDeployment
HooksFactoryRevolvingdeploy methods now requiremarketData:abi.encode(uint8 version, uint16 commitmentFeeBips)1Compatibility:
This feature is intentionally low-disruption:
MarketStateABI remains unchangedMarketDeployedlisteners keep workingTest coverage
Added/expanded:
test/HooksFactoryRevolving.t.soltest/market/WildcatMarketRevolving.t.soltest/lens/MarketLensMultiFactory.t.solthese cover deploy validation, revolving accounting and accrual behavior, and mixed-factory lens read correctness.