Skip to content

Conversation

@0xLisanAlGaib
Copy link
Contributor

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

  • Overview and Architecture - Introduction to ALP components and design
  • Credit Market Mechanics - Health factors, collateral, and debt management
  • Position Lifecycle - Complete user journey from creation to closure
  • Automated Rebalancing - System for maintaining optimal position health
  • Liquidation System - Multiple liquidation paths and safety mechanisms
  • MOET Integration - Role of MOET as unit of account and borrowed asset
  • DeFi Actions - Composability framework for protocol integration

FCM (Flow Credit Market) - 4 documents

  • Product Overview - High-level introduction to the three-component system
  • Basics Tutorial - Progressive learning from traditional lending to FCM
  • Technical Architecture - Component integration and data flow
  • Mathematical Foundations - Formulas, proofs, and calculations

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

  • Yield-Powered Liquidation Prevention - Unique mechanism using yield to maintain position health
  • Automated Capital Efficiency - Auto-borrowing and rebalancing for optimal returns
  • Multi-Component Architecture - ALP + FYV + MOET integration
  • Complete Position Lifecycle - From creation through health states to closure
  • Security & Risk Management - Oracle safety, circuit breakers, and multiple liquidation paths
  • Integration Patterns - Best practices for building on FCM

Documentation Quality

  • 12 markdown files totaling 5,549+ lines
  • 90+ mermaid diagrams
  • Cross-referenced mathematical proofs
  • Consistent structure across all documents
  • Mobile-friendly and accessible formatting

Target Audience

  • Users - Understanding how to use FCM safely and effectively
  • Developers - Building integrations and custom strategies
  • DeFi Builders - Composing with FCM primitives

Testing

  • All markdown files properly formatted
  • All internal links verified
  • Mermaid diagrams render correctly
  • Mathematical notation displays properly
  • Sidebar navigation structure tested

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.
@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 18, 2025 9:34pm

- 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
@Aliserag
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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**.
Copy link
Contributor

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.
Copy link
Contributor

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

Copy link
Contributor

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.
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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}
Copy link
Contributor

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:
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants