Credit Market Mechanics
ALP operates as a decentralized lending protocol where users can deposit collateral and borrow assets. Understanding the core mechanics is essential for effectively managing positions and maximizing capital efficiency.
Basic Lending Mechanics
Collateral Deposits
When you deposit tokens into ALP, they become collateral that backs your borrowing capacity. However, not all collateral value is usable for borrowing.
_10graph LR_10 Deposit[Deposit<br/>1000 FLOW<br/>@ $1 each] --> Factor[Apply<br/>Collateral Factor<br/>0.8]_10 Factor --> Effective[Effective Collateral<br/>$800]_10_10 Effective --> Borrow[Can Borrow<br/>$615 @ HF 1.3]_10_10 style Effective fill:#bfb,stroke:#333,stroke-width:2px
Each token has a collateral factor that determines what percentage of its value can be used. For example, depositing 1,000 FLOW worth $1,000 with a collateral factor of 0.8 results in $800 of effective collateral. This safety buffer protects the protocol against price volatility and ensures positions remain solvent even with market fluctuations.
Borrowing Limits
Your borrowing capacity depends on two key factors:
- Effective Collateral: Total collateral value × collateral factor
- Target Health Ratio: Minimum ratio of collateral to debt
Formula:
_10Maximum Borrow = Effective Collateral / Target Health Ratio
See FCM Mathematical Foundations for detailed formulas and derivations.
Example with target health of 1.3:
- Effective collateral: $800 (from 1,000 FLOW at 0.8 factor)
- Target health: 1.3
- Maximum borrow: $800 / 1.3 ≈ $615.38
Health Factor
The health factor is the most important metric for your position:
_10Health Factor = Effective Collateral Value / Effective Debt Value
_20graph TD_20 subgraph "Health Factor States"_20 HF1[HF > 1.5<br/>Overcollateralized]_20 HF2[HF: 1.3 - 1.5<br/>Healthy]_20 HF3[HF: 1.1 - 1.3<br/>Below Target]_20 HF4[HF: 1.0 - 1.1<br/>At Risk]_20 HF5[HF < 1.0<br/>Liquidatable]_20 end_20_20 HF1 --> Action1[Can borrow more]_20 HF2 --> Action2[Optimal state]_20 HF3 --> Action3[Should repay<br/>or add collateral]_20 HF4 --> Action4[Urgent action<br/>needed]_20 HF5 --> Action5[Liquidation<br/>imminent]_20_20 style HF1 fill:#bbf_20 style HF2 fill:#bfb_20 style HF3 fill:#ffa_20 style HF4 fill:#fbb_20 style HF5 fill:#f00,color:#fff
Your position's health can be understood across a spectrum: when HF > 1.5 you're overcollateralized and can borrow more; HF between 1.3 and 1.5 represents the healthy range; HF between 1.1 and 1.3 means you're below target and should repay or add collateral; HF between 1.0 and 1.1 puts you at risk of liquidation; and HF < 1.0 means your position is liquidatable and requires immediate action.
Auto-Borrowing Feature
ALP includes an innovative auto-borrowing feature that automatically manages your position to maintain optimal health ratios.
How Auto-Borrowing Works
_14sequenceDiagram_14 participant User_14 participant ALP_14 participant DrawDownSink_14_14 User->>ALP: Deposit 1000 FLOW<br/>pushToDrawDownSink=true_14 ALP->>ALP: Calculate effective<br/>collateral: $800_14 ALP->>ALP: Calculate max borrow<br/>at HF 1.3: $615.38_14 ALP->>ALP: Auto-borrow 615.38 MOET_14 ALP->>DrawDownSink: Push MOET_14 DrawDownSink->>User: Funds deployed_14 ALP->>User: Position created<br/>HF = 1.3 ✓_14_14 Note over User,DrawDownSink: Automatic optimization!
When you create a position with pushToDrawDownSink=true, you deposit collateral (e.g., 1,000 FLOW), the system calculates your maximum safe borrowing capacity, automatically borrows MOET to reach target health (1.3), and sends the borrowed MOET to your DrawDown Sink.
Example:
_10Deposit 1000 Flow with collateralFactor=0.8_10Target health = 1.3_10_10Effective collateral = 1000 * 1.0 (price) * 0.8 = 800_10Auto-borrow amount = 800 / 1.3 ≈ 615.38 MOET_10_10Result:_10- Position health: 1.3 (at target)_10- User receives: ~615.38 MOET via DrawDownSink_10- Collateral locked: 1000 FLOW
Opting Out of Auto-Borrowing
You can disable auto-borrowing by setting pushToDrawDownSink=false when creating your position. With auto-borrowing disabled, your collateral is deposited without any automatic borrowing occurring, your health factor starts very high (>1.5), and you manually borrow when needed.
Benefits of Auto-Borrowing
_14graph LR_14 subgraph "Auto-Borrowing Benefits"_14 B1[Maximized<br/>Capital Efficiency]_14 B2[Simplified<br/>Management]_14 B3[Immediate<br/>Liquidity]_14 B4[Automated<br/>Rebalancing]_14 end_14_14 B1 --> Result[Optimal<br/>Position]_14 B2 --> Result_14 B3 --> Result_14 B4 --> Result_14_14 style Result fill:#bfb,stroke:#333,stroke-width:3px
- Maximized Capital Efficiency: Automatically uses available borrowing capacity
- Simplified Position Management: No need to manually calculate safe borrow amounts
- Immediate Liquidity: Receive borrowed funds instantly upon deposit
- Automated Rebalancing: System maintains optimal health as market conditions change
When to Use Auto-Borrowing
Use auto-borrowing when:
- You want to maximize capital efficiency
- You're comfortable with leveraged positions
- You trust automated position management
- You want immediate access to borrowed funds
Don't use auto-borrowing when:
- You want conservative collateralization
- You prefer manual position control
- You're testing or learning the protocol
- You don't need immediate borrowing
Interest System
ALP uses a sophisticated interest system based on scaled balances and interest indices.
How Interest Accrues
_10graph TD_10 User[User Borrows<br/>1000 MOET] --> Scaled[Record Scaled Balance<br/>1000 / 1.0 = 1000]_10 Scaled --> Time[Time Passes]_10 Time --> Index[Interest Index<br/>Grows to 1.05]_10 Index --> Current[Current Debt<br/>1000 × 1.05 = 1050]_10_10 Note1[No transaction<br/>needed!]_10 Time -.-> Note1_10_10 style Current fill:#fbb
Instead of updating every user's balance constantly, ALP:
- Tracks your scaled balance:
actual balance / interest index at deposit - Updates a global interest index as time passes
- Calculates your current balance:
scaled balance × current interest index
This means your debt and deposits grow automatically without requiring transactions.
See FCM Mathematical Foundations for detailed formulas.
Interest Rates
Interest rates in ALP are determined by the utilization rate (percentage of available capital currently borrowed), a base rate (minimum interest rate when utilization is low), slope rates (how quickly rates increase as utilization rises), and optimal utilization (target utilization for balanced rates).
_12graph LR_12 subgraph "Utilization vs Interest Rate"_12 Low[0-80%<br/>Low Utilization<br/>Gradual increase]_12 Opt[80%<br/>Optimal<br/>Target balance]_12 High[80-100%<br/>High Utilization<br/>Steep increase]_12 end_12_12 Low --> Opt_12 Opt --> High_12_12 style Opt fill:#bfb_12 style High fill:#fbb
Typical Rate Curve:
_10Low Utilization (0-80%): Gradual rate increase_10Optimal Zone (80%): Target balance point_10High Utilization (80-100%): Steep rate increase to encourage repayment
Compound Interest
Interest in ALP compounds continuously as the interest index grows, with borrowers paying compound interest on debt, lenders earning compound interest on deposits, and interest index updates reflecting accumulated compounding.
Example:
_10Initial borrow: 1000 MOET_10Interest index at borrow: 1.0_10After 1 year at 10% APY:_10- New interest index: ~1.105 (continuous compounding)_10- Debt owed: 1000 * 1.105 = 1,105 MOET
Price Oracle System
Accurate pricing is critical for maintaining protocol solvency. ALP uses a price oracle with multiple safety features.
Price Feeds
All token prices are quoted in terms of the default token (MOET):
_12graph TD_12 MOET[MOET<br/>Unit of Account] --> P1[FLOW/MOET<br/>Price]_12 MOET --> P2[USDC/MOET<br/>Price]_12 MOET --> P3[stFLOW/MOET<br/>Price]_12 MOET --> P4[Other Tokens<br/>Prices]_12_12 P1 --> Calc[Health Factor<br/>Calculations]_12 P2 --> Calc_12 P3 --> Calc_12 P4 --> Calc_12_12 style MOET fill:#fbb,stroke:#333,stroke-width:3px
All token prices are quoted in terms of MOET (FLOW/MOET, USDC/MOET, and other token prices), which simplifies calculations and ensures consistency across the protocol.
Oracle Safety Features
_14graph LR_14 subgraph "Oracle Protections"_14 S1[Staleness Checks<br/><5 min old]_14 S2[Deviation Guards<br/>Large jumps flagged]_14 S3[Fallback Sources<br/>Alternative feeds]_14 S4[TWAP Support<br/>Manipulation resistant]_14 end_14_14 S1 --> Safe[Safe Price<br/>Feed]_14 S2 --> Safe_14 S3 --> Safe_14 S4 --> Safe_14_14 style Safe fill:#bfb,stroke:#333,stroke-width:3px
The oracle employs staleness checks to ensure prices are recent (typically < 5 minutes old), deviation guards that reject or flag large price jumps, fallback mechanisms providing alternative price sources if the primary fails, and TWAP support using time-weighted average prices to reduce manipulation risk.
How Prices Affect Positions
Price changes directly impact your health factor:
_11graph TD_11 Initial[Initial State<br/>1000 FLOW @ $1<br/>Debt: $600<br/>HF: 1.67]_11_11 Initial --> Up[Price Increase<br/>FLOW → $1.20]_11 Initial --> Down[Price Decrease<br/>FLOW → $0.80]_11_11 Up --> UpResult[New HF: 2.0<br/>Can borrow more!]_11 Down --> DownResult[New HF: 1.33<br/>May trigger rebalancing]_11_11 style UpResult fill:#bfb_11 style DownResult fill:#ffa
Collateral price increases: Health improves, can borrow more
_10Before: 1000 FLOW @ $1 = $1000, Debt = $600, HF = 1.67_10After: 1000 FLOW @ $1.20 = $1200, Debt = $600, HF = 2.0_10→ Can borrow additional ~$108 MOET
Collateral price decreases: Health worsens, may need to repay
_10Before: 1000 FLOW @ $1 = $1000, Debt = $600, HF = 1.67_10After: 1000 FLOW @ $0.80 = $800, Debt = $600, HF = 1.33_10→ Close to target health, rebalancing may trigger
Multi-Token Support
ALP supports multiple token types as both collateral and debt.
Token Configuration
_22graph TB_22 subgraph Collateral_22 C1[FLOW<br/>Factor: 0.8]_22 C2[stFLOW<br/>Factor: 0.75]_22 C3[USDC<br/>Factor: 0.9]_22 end_22_22 subgraph Debt_22 D1[MOET<br/>Primary]_22 D2[FLOW<br/>Alternative]_22 D3[USDC<br/>Alternative]_22 end_22_22 C1 --> Health[Single Health<br/>Factor Calculation]_22 C2 --> Health_22 C3 --> Health_22_22 D1 --> Health_22 D2 --> Health_22 D3 --> Health_22_22 style Health fill:#f9f,stroke:#333,stroke-width:3px
Collateral Tokens
Any supported token can be used as collateral, including Flow, stFlow, USDC, and other allowlisted tokens. Each token has its own collateral factor, price feed, and interest rate parameters.
Debt Tokens
You can borrow multiple token types including MOET (the primary borrowed asset), Flow, USDC, and other allowlisted tokens. Each position can have multiple simultaneous borrows, with health calculated across all assets.
Cross-Token Calculations
When you have multiple tokens, ALP converts all collateral and debt to the default token (MOET) value, calculates a single health factor across all positions, and ensures the total position remains solvent.
Example:
_10Collateral:_10- 1000 FLOW @ $1 each, factor 0.8 = $800 effective_10- 500 USDC @ $1 each, factor 0.9 = $450 effective_10Total effective collateral: $1,250_10_10Debt:_10- 800 MOET @ $1 each = $800 debt_10Health Factor = 1,250 / 800 = 1.56 ✓ Healthy
Utilization and Protocol Dynamics
Utilization Rate
_10graph LR_10 Total[Total Available<br/>Capital] --> Borrowed[Amount<br/>Borrowed]_10 Total --> Available[Amount<br/>Available]_10_10 Borrowed --> Util[Utilization Rate<br/>Borrowed / Total]_10_10 Util --> Low[Low <80%<br/>Lower rates]_10 Util --> High[High >80%<br/>Higher rates]_10_10 style Util fill:#bbf,stroke:#333,stroke-width:2px
The protocol tracks utilization for each token:
_10Utilization = Total Borrowed / (Total Deposited + Reserves)
Higher utilization leads to higher interest rates for borrowers, higher yields for lenders, and incentives to add liquidity or repay loans.
Reserve Factor
A portion of interest goes to protocol reserves:
_10Lender Interest = Borrower Interest × (1 - Reserve Factor)
_10graph LR_10 Borrower[Borrower Pays<br/>100 Interest] --> Protocol[Protocol<br/>Reserve Factor]_10 Protocol --> Reserve[20 to<br/>Reserves]_10 Protocol --> Lender[80 to<br/>Lenders]_10_10 Reserve --> Uses[Insurance Fund<br/>Development<br/>Emergency<br/>Treasury]_10_10 style Reserve fill:#ffa_10 style Lender fill:#bfb
Reserves are used for the protocol insurance fund, development and maintenance, emergency situations, and the governance-controlled treasury.
Risk Management
For Borrowers
_16graph TD_16 subgraph "Borrower Risk Management"_16 R1[Monitor Health<br/>Factor Daily]_16 R2[Set Alerts<br/>HF < 1.5]_16 R3[Diversify<br/>Collateral]_16 R4[Use Stable<br/>Assets]_16 R5[Watch Price<br/>Volatility]_16 end_16_16 R1 --> Safety[Reduced<br/>Liquidation Risk]_16 R2 --> Safety_16 R3 --> Safety_16 R4 --> Safety_16 R5 --> Safety_16_16 style Safety fill:#bfb,stroke:#333,stroke-width:3px
Borrowers should monitor their health factor by setting up alerts for HF < 1.5, keeping a buffer above the minimum (1.1), and watching for price volatility. Manage collateral wisely by diversifying across multiple tokens, using stable assets for lower risk, and considering collateral factors when depositing.
For Lenders
Lenders should understand the risks including smart contract risk, liquidation risk (if the protocol becomes undercollateralized), and interest rate volatility. To maximize returns, monitor utilization rates, deposit when rates are high, and consider different tokens for better yields.
Summary
Core Mechanics:
- 💰 Collateral with safety factors (e.g., 0.8 = 80% usable)
- 📊 Health factor = Effective Collateral / Debt
- 🤖 Auto-borrowing optimizes capital efficiency
- 📈 Scaled balance system for efficient interest
Key Formulas:
- Max Borrow = Effective Collateral / Target Health
- Health Factor = Effective Collateral / Effective Debt
- Utilization = Total Borrowed / Total Available
Safety Features:
- ✅ Oracle staleness checks and deviation guards
- ✅ Multi-token support with unified health calculation
- ✅ Reserve factor for protocol insurance
- ✅ Continuous interest compounding
Mathematical Foundation
For detailed formulas underlying credit market mechanics:
- Effective Collateral: Collateral Calculation
- Health Factor: Health Factor Formula
- Maximum Borrowing: Max Borrow Capacity
- Interest Calculations: Interest Mathematics
- Multi-Collateral: Multi-Collateral Mathematics
Next Steps
- Learn about protection: Liquidation System
- Understand the lifecycle: Position Lifecycle
- Explore automation: Rebalancing Mechanics
- See complete formulas: FCM Mathematical Foundations
ALP's credit market mechanics combine automated efficiency with robust safety features. The auto-borrowing feature, scaled interest system, and multi-token support create a powerful yet accessible lending platform. Understanding these mechanics helps you manage positions effectively and maximize your DeFi strategy.