Documentation

Learn about the SECP Protocol mechanics, collateral pricing rules, and our unique Anti-Liquidation engine.

SECP Protocol Overview

The SECP Protocol is a decentralized, risk-adjusted lending platform built on Moonbase Alpha (Polkadot), leveraging cross-chain capabilities via XCM.

Unlike traditional DeFi protocols (Aave, Compound) that instantaneously auction off your assets at a discount when market prices dip, SECP introduces a resilient Anti-Liquidation Engine. We freeze vaults under extreme distress and use native asset yield to predictably pay down the debt without sacrificing user principals.

Protocol Lifecycle

1

Deposit & Lend

Users start by locking supported collateral assets (like mDOT, mWBTC, or mRWA) into their personal isolated SECP Smart Vault. By keeping their principal actively locked, the underlying collateral can be put to work automatically generating base protocol yields behind the scenes (staking, RWA treasuries, etc).

2

Borrowing USDC

Once collateral is securely vaulted, users can borrow up to an actively weighted 75% LTV in USDC directly from the SECP LoanManager. As long as the health factor is stable (green), the borrower acts as normal, deploying the USDC liquidity outwards.

3

Market Crash & Yield Shifting

When global markets plummet, oracle prices drop, plunging the Smart Vaults into Freeze Mode. Traditional platforms instantly liquidate users into the ground by selling off their DOT or WBTC at discount auctions.

The Anti-Liquidation Shift

Instead of destroying the principal collateral, SECP activates the YieldManager. All ongoing native staking rewards, yield distributions, or RWA rebases that the underlying collateral is organically earning are strictly diverted. This intercepted yield is forcibly funneled backwards to gently "pay down" the user's active debt over time, stabilizing the Health Factor without evaporating the user's base position. The user loses their daily earnings entirely until the debt is back to safe levels!

Core Formulae

1. Total Risk-Adjusted Collateral

Each token type is given a unique Risk Weight. A risk weight represents the percentage of the asset's dollar value that can be counted toward borrowing.

Value = Σ (TokenAmount × OraclePrice × (TokenRiskWeight / 100))
  • mUSDC 95%
  • mWBTC 90%
  • mDOT 85%
  • mRWA 80%
  • mYIELD 75%

2. Health Factor (HF)

The Health Factor dictates the safety of your loan. A larger HF means your borrowed position is solidly overcollateralized.

Health Factor = (Total Risk-Adjusted Collateral × 85) / Active Debt
HF > 150 : Safe (Flexible Mode)
100 < HF ≤ 150 : Warning (Conservative Mode)
HF ≤ 100 : Critical (Freeze Mode)

3. Maximum Borrowing

The absolute ceiling up to which a user can borrow. SECP utilizes an aggressive 75% globally unified LTV target based on the risk-adjusted value.

Max Borrow = Total Risk-Adjusted Collateral × 0.75

Borrow Utilization = (Active Debt / Max Borrow) × 100

Smart Vault Modes

Flexible Mode

Standard mode when HF > 150 and Oracle Volatility is low. Users enjoy full withdrawal, deposit, and borrowing rights.

Conservative Mode

Activated when 100 < HF ≤ 150. Borrowing abilities might be severely limited or rate-bounded to prevent slipping into critical zones.

Freeze Mode

Activated rigidly when HF ≤ 100 OR Oracle Volatility exceeds 80! Withdrawals are halted. Native Yield intercepts to slowly trim debt avoiding immediate liquidations.

Contract Interactions

  • MockOracleProvides on-chain mock pricing natively and emits global marketVolatility indices which are polled by protocol logic continually.
  • LoanManager & CollateralManagerWork hand-in-hand to approve loan issuances, maintaining ledger ledgers, asserting protocol invariant checks, and recalculating health vectors in virtually constant time O(1).
  • YieldManagerHarnesses native token yields and securely interfaces with Vaults to funnel active yield earnings backwards into isolated un-frozen repayment avenues inside the Loan Manager.

Cross-Chain XCM Architecture

SECP operates with a global liquidity perspective by heavily integrating Polkadot's Cross-Consensus Messaging (XCM) format. XCM empowers smart contracts on our native deploying parachain (e.g., Moonbase Alpha) to natively communicate intent, transfer assets, and assess collateral originating from entirely separate Layer-1 chains inside the Polkadot Ecosystem.

Remote Collateral

Deposit native tokens (like DOT) straight from Polkadot Asset Hub into your SECP parity Vault on Moonbeam via XCM asset teleportation, utilizing unified execution environments.

XCM Rebalancing

The protocol can rebalance cross-chain liquidity passively by dispatching XCM Transact instructions outward holding surplus stablecoins securely against extreme volatility on isolated side-chains.

How to Run This Protocol

Running SECP Protocol locally or configuring it for Testnet requires setting up BOTH the Smart Contracts and the Next.js Frontend.

1

Deploy Smart Contracts

# Navigate to the smart contracts directory

cd smart-contracts

# Install dependencies

npm install

# Setup your keys (add your private key to .env)

cp .env.example .env

# Compile and deploy to Polkadot testnet (Moonbase Alpha)

npx hardhat run scripts/deploy.ts --network moonbaseAlpha

* Keep track of the contract addresses printed in the terminal!

2

Configure & Run Frontend

# Navigate to frontend & install dependencies

cd ../frontend

npm install

# Update configuration

Open src/config/contracts.ts and replace the mock addresses with your newly deployed contract addresses.

# Start the development server

npm run dev

3

Initial Setup (Testnet)

With the DApp running at http://localhost:3000, head to the Faucet tab to mint your testing ERC-20 tokens. Ensure your wallet is connected to the Moonbase Alpha remote RPC.