-
Notifications
You must be signed in to change notification settings - Fork 79
Add comprehensive Flow Credit Market (FCM) documentation #1626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit introduces complete documentation for Flow Credit Market (FCM), a DeFi yield platform that combines automated lending, yield farming strategies, and a synthetic stablecoin. ## Documentation Structure ### ALP (Automated Lending Platform) - 8 documents - Overview and architecture - Credit market mechanics with health factor calculations - Position lifecycle management - Automated rebalancing system - Liquidation mechanisms and safety features - MOET integration and role - DeFi Actions composability framework ### FCM (Flow Credit Market) - 4 documents - Product overview and component integration - Basics tutorial progressing from traditional lending to FCM - Technical architecture with data flow diagrams - Mathematical foundations with formulas and proofs ## Key Features - Visual mermaid diagrams throughout for clarity - Progressive learning path from basics to advanced topics - Cross-referenced sections linking related concepts - Practical examples with real-world scenarios - Mathematical formulas with step-by-step derivations - Professional narrative flow with minimal bullet points ## Content Highlights - Yield-powered liquidation prevention mechanism - Automated capital efficiency through rebalancing - Multi-component architecture (ALP + FYV + MOET) - Complete position lifecycle documentation - Security features and risk management - Integration patterns and best practices This documentation provides comprehensive coverage for users, developers, and DeFi builders looking to understand or integrate with FCM.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Replace non-existent flow-yield-vaults and moet directory links with placeholders
- Remove \text{} LaTeX commands causing acorn parsing errors in math.md
- All formulas now use plain text variables instead of \text{} wrapper
- Replace broken links: capital-flows.md, risk-management.md, integration.md - Convert all $$ LaTeX blocks to ```math code blocks for MDX compatibility - Remove LaTeX \sum and \in operators causing acorn parsing errors - Use plain mathematical notation instead of LaTeX commands
- Convert LaTeX math operators to Unicode equivalents (× ÷ ≤ ≥ ≈)
- Replace \frac{a}{b} with (a / b) notation
- Simplify subscripts from _{text} to _text
- Fix misaligned code block markers throughout document
- Remove all remaining LaTeX that causes MDX parsing errors
|
Instead of FCM as the sidebar title, I think having 'Flow Credit Market (FCM)' for discoverability would be more useful. I think it would also help a bit with LLMs. |
|
|
||
| # Flow Credit Market (FCM) | ||
|
|
||
| Flow Credit Market (FCM) is a comprehensive DeFi yield platform on Flow that combines automated lending, yield farming strategies, and a synthetic stablecoin to create a capital-efficient system for generating returns on crypto assets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads a bit awkward because we describe what it is then have the next section titled 'Whaat is FCM'. I think we can shorten this to: "Flow Credit Market (FCM) is a comprehensive DeFi yield platform on Flow that offers a capital-efficient system for generating returns on crypto assets.
Then rename the the next section to something like: "How It Works" and 'How the Components Work Together' to 'Interaction Between Components'.
I wonder if we should also mention something about it being a 'enshrined protocol' if that is tied to our branding goals.
|
|
||
| FCM is **not a single protocol** - it's an integrated system composed of three core components working together: | ||
|
|
||
| ```mermaid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if its because im looking at the vercel deployment but the graph isn't showing
|
|
||
| ### 1. Yield-Powered Liquidation Prevention | ||
|
|
||
| Unlike traditional lending protocols where you must manually add collateral or repay debt when prices drop, FCM **uses your yield to maintain position health**. Yield from FYV strategies flows back to ALP automatically, ALP pulls from FYV to repay debt when needed, your position stays healthy without manual intervention, and **you earn yield while protecting yourself from liquidation**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'.... ALP automatically via scheduled transactions (link to doc)' - useful explaining how it works incase they want to dig deeper
|
|
||
| ### For Conservative Users | ||
|
|
||
| FCM provides liquidation protection through yield maintaining position health, flexible health targets allowing you to choose your risk tolerance (1.1-1.5), support for multiple collateral types including FLOW, stFLOW, USDC and more, and complete transparency with all logic on-chain and auditable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We mention 'automatically' quite a few times in the overall doc. Also I think its worth pointing out frequency of rebalances or that they can occur many times in a given day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awkward wording: 'USDC and more, and complete...'
|
|
||
| ### For DeFi Builders | ||
|
|
||
| FCM offers composable primitives allowing you to build on ALP, FYV, or both, standard interfaces for integration through DeFi Actions, the ability to create custom FYV strategies through extensible strategy patterns, and all code publicly available as open source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sections after this feel a bit out of place relative to the rest of the docs. Also a user can see in the sidebar that the next doc is understanding the basics so not sure this is useful unless for LLMs.
| Maximum theoretical leverage: | ||
|
|
||
| ``` | ||
| MaxLeverage = (1 / 1 - CF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be: MaxLeverage = 1 / (1 - CF)?
| But actual safe leverage is constrained by target health: | ||
|
|
||
| ``` | ||
| SafeLeverage = (CF / HF_target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should rename this to Debt Ratio as leverage is typically = total exposure/equity. Leverage is typically = C/(C-D). If D = C * (CF)/(HF) then the leverage would be 1/(1-(CF/HF)) = 1/(1 - 0.615) = 2.6x
| Annual Percentage Yield without compounding: | ||
|
|
||
| ``` | ||
| APY_simple = (FinalValue - InitialValue / InitialValue) × (365 / Days) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing parentheses: APY_simple = ((FinalValue - InitialValue) / InitialValue) × (365 / Days)
| Amount of collateral to seize: | ||
|
|
||
| ``` | ||
| CollateralSeized = \frac{ED_repaid × (1 + bonus)}{P_collateral × CF_collateral} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this over-seize collateral relative to how EC is defined? Is CF double-penalizing the borrower.
|
|
||
| ### 2. Effective Debt | ||
|
|
||
| The effective debt is the sum of all borrowed assets multiplied by their prices and borrow factors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we explain why the Borrow Factor exists?
Overview
This PR introduces comprehensive documentation for Flow Credit Market (FCM), a DeFi yield platform that combines automated lending, yield farming strategies, and a synthetic stablecoin.
Documentation Structure
ALP (Automated Lending Platform) - 8 documents
FCM (Flow Credit Market) - 4 documents
Key Features
✅ Visual Documentation - Extensive mermaid diagrams for clarity and understanding
✅ Progressive Learning - Structured path from basics to advanced topics
✅ Cross-Referenced - Links connecting related concepts across documents
✅ Practical Examples - Real-world scenarios with concrete numbers
✅ Mathematical Rigor - Step-by-step formula derivations
✅ Professional Writing - Clear narrative flow optimized for readability
Content Highlights
Documentation Quality
Target Audience
Testing