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 23, 2025 3:45pm

- 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.


### 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...'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What word should we use instead of repeating automation/automatically/etc.?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we can remove most of them and it will still flow as long as we clearly highlight in the beginning once that everything is executed automatically by FCM

Updated basics.md:
- Converted bullet points to paragraphs for better readability
- Added diagram styling to highlight key components
- Added explanations for TracerStrategy and AutoBalancer
- Enhanced composability section

Updated math.md:
- Fixed liquidation formulas with complete implementation details
- Corrected collateral seizure calculations
- Added proper debt ratio vs leverage distinction
- Fixed mathematical notation and formatting issues
- Improved formula parenthesis handling for clarity
Created complete FYV documentation with 9 files covering:
- Core concepts: architecture, strategies, AutoBalancer, vault lifecycle
- Advanced features: leveraged farming, scheduling system, cross-chain integration
- Composability: DeFi Actions framework

Documentation follows same structure and quality as ALP and FCM docs.
style MOET fill:#bfb,stroke:#333,stroke-width:2px
```

## Getting Started with ALP
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 how helpful this section is. As a user what am I connecting my wallet to on the Flow blcokchain? How do I create a position? We say we recommend using Flow Credit Market after but there really isn't an URLs or way for me to use ALP rn? Maybe we can reframe this so that we start with 'For most users, we recommend using Flow Credit Markets...' then elaborate, when you use FCM, behind the scenes ALP does x, y, z. Anyone can incorporate ALP directly into their app'


### TokenState

Each supported token in the protocol has an associated **TokenState** that tracks per-token metrics:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should link to the supported tokens section in FYV index


### Price Oracle

The **Price Oracle** provides token prices in terms of the default token (MOET):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to MOET section

style Oracle fill:#bfb,stroke:#333,stroke-width:3px
```

The oracle implements the DeFi Actions PriceOracle interface, enabling standardized price queries across the protocol.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to DeFi actions priceoracle


**5. Liquidation**: User closes vault, strategy liquidates all positions (closes ALP position for leveraged strategies), converts all value to collateral, and returns final value to user.

## Best Practices
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who are these best practices for? Users of apps that leverage it?


Despite atomicity guarantees, vaults can become stuck for several reasons:

1. **Transaction failure** during reschedule due to gas issues or network congestion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not super clear who pays for gas with the rescheduling or if you need to fund an account that sponsors the txns indefinitely


## mUSDCStrategy: Cross-Chain Yield Farming

The mUSDCStrategy leverages the EVM bridge to access Ethereum-compatible ERC4626 yield vaults.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, it's much clearer here than the previous reference I commented on. It's just using the Cross-VM bridge, the other doc I already left a comment on made it seem like it was going to a different chain that was EVM. I would change these references to Cross-VM instead of cross-chain if I'm understanding this piece correctly.


### Mitigation Strategies

**Bridge Audits**: Use only audited, established bridge infrastructure and verify escrow contract security.
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 this is a good one to highlight because there is only one cross-VM bridge and we created it.

@@ -0,0 +1,440 @@
---
title: DeFi Actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should rename this to FYV DeFi actions because we already have a Flow Actions section of the docs

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