ChainScore Labs
LABS
Guides

Composing Synthetic Assets With Lending Protocols

Chainscore © 2025
core_concepts

Core Concepts for Protocol Composition

Foundational knowledge required to understand how protocols interact to create synthetic assets.

01

Collateralization & Debt Positions

Overcollateralization is the core security mechanism. Users lock assets exceeding the value of the minted synthetic to absorb price volatility. For example, locking $150 of ETH to mint $100 of a synthetic USD. This creates a Collateralized Debt Position (CDP), which is liquidated if the collateral ratio falls below a threshold, protecting the protocol's solvency.

02

Oracle Price Feeds

Oracles provide external, real-world data to smart contracts. For synthetic assets, decentralized oracle networks like Chainlink supply the price of both the collateral and the synthetic asset. This data is critical for determining collateral health, enabling minting/redemption, and triggering liquidations. Reliable oracles are non-negotiable for system integrity.

03

Synthetic Asset Minting (Synth)

A synthetic asset is an on-chain token that mirrors the price of an external asset without holding it. Minting involves depositing collateral into a protocol to generate synthetic tokens, like sUSD or sBTC. These synths can be traded, used in DeFi, or burned to reclaim the underlying collateral, minus fees.

04

Liquidation Mechanisms

Liquidation is an automated process to close undercollateralized positions. When a user's collateral value drops too close to their debt value, keepers can repay part of the debt in exchange for the collateral at a discount. This ensures the protocol remains overcollateralized overall, protecting other users from insolvency risk.

05

Composability & Money Legos

Composability allows protocols to function as interoperable building blocks or "money legos." A synthetic asset minted on one protocol can be used as collateral in a separate lending protocol to borrow another asset. This creates complex financial strategies, like yield farming loops, but also compounds systemic risk across the DeFi ecosystem.

06

Stability Fees & Incentives

Stability fees are recurring interest rates charged on debt positions, often paid in the protocol's governance token. These fees accrue to the protocol treasury or token stakers. Incentive mechanisms, like liquidity mining rewards, are used to bootstrap usage and liquidity for newly minted synthetic assets, aligning user and protocol goals.

Basic Workflow for a Collateralized Synthetic Position

Process overview

1

Deposit Collateral into Lending Protocol

Provide the initial capital that will back the synthetic asset.

Detailed Instructions

Begin by depositing an accepted collateral asset, such as WETH or WBTC, into a lending protocol like Aave or Compound. This deposit mints a collateralized debt position (CDP) token, representing your share of the pool. The amount deposited determines your borrowing capacity based on the asset's loan-to-value (LTV) ratio. For example, depositing 10 ETH with a 75% LTV allows you to borrow up to 7.5 ETH worth of other assets.

  • Sub-step 1: Approve the lending protocol contract to spend your collateral token using the approve function.
  • Sub-step 2: Call the protocol's deposit or supply function, specifying the asset address and amount.
  • Sub-step 3: Verify you received the protocol's corresponding aToken or cToken in your wallet, which accrues interest.
solidity
// Example: Depositing WETH to Aave V3 IERC20(wethAddress).approve(poolAddress, collateralAmount); IPool(poolAddress).supply(wethAddress, collateralAmount, yourAddress, 0);

Tip: Always check the protocol's current LTV ratios and liquidation thresholds for your chosen collateral, as they can be updated via governance.

2

Borrow a Stablecoin Against Collateral

Draw debt in a stable asset to serve as the minting currency.

Detailed Instructions

Using your active CDP, borrow a stablecoin like DAI or USDC. This creates a debt position denominated in the borrowed asset, which accrues interest at a variable or stable rate. The borrowed amount must remain below your health factor, a risk metric calculated as (Collateral Value * Liquidation Threshold) / Total Borrowed Value. A health factor below 1.0 risks liquidation.

  • Sub-step 1: Query your available borrowing power for the desired stablecoin using the protocol's getUserAccountData function.
  • Sub-step 2: Execute the borrow function, specifying the stablecoin address, amount, interest rate mode (1 for stable, 2 for variable), and a referral code (often 0).
  • Sub-step 3: Confirm the stablecoins are received in your wallet and that your health factor is safely above 1.2 to provide a buffer.
solidity
// Example: Borrowing DAI from Aave V3 IPool(poolAddress).borrow(daiAddress, borrowAmount, 2, 0, yourAddress);

Tip: Monitor borrowing rates. Variable rates can fluctuate with market conditions, impacting your cost of capital for the synthetic position.

3

Mint Synthetic Asset with Stablecoin

Use the borrowed capital to create the target synthetic token.

Detailed Instructions

Direct the borrowed stablecoins to a synthetic asset protocol like Synthetix or a derivative vault. This step involves swapping the stablecoin for a synthetic token (synth) that tracks an external price feed, such as sETH or sBTC. The minting is typically done via a mint function that burns the stablecoin and mints the synth, often at a 1:1 ratio to the value of the underlying asset.

  • Sub-step 1: Approve the synthetic protocol's minter contract to spend your stablecoin balance.
  • Sub-step 2: Call the mint or issueSynths function, specifying the amount. The protocol will use an on-chain oracle (e.g., Chainlink) to determine the minting ratio.
  • Sub-step 3: Verify the synthetic token balance in your wallet and check the protocol's collateralization ratio to ensure the system remains over-collateralized.
solidity
// Example: Minting sUSD with DAI on a Synthetix-inspired contract IERC20(daiAddress).approve(synthMinterAddress, mintAmount); ISynthMinter(synthMinterAddress).mint(mintAmount);

Tip: Understand the synthetic protocol's fee structure, which may include a minting fee or exchange fee when converting between synths.

4

Manage Position Health and Risk

Monitor and maintain the leveraged position to avoid liquidation.

Detailed Instructions

Ongoing management is critical. You must monitor two key risk layers: the lending protocol health factor and the synthetic protocol collateralization ratio. Price volatility of your initial collateral (e.g., ETH) or the synthetic asset can endanger the position. If your lending health factor nears 1.0, you must either repay debt or add more collateral.

  • Sub-step 1: Set up alerts for your health factor using a service like DeFi Saver or a custom script polling the protocol's contract.
  • Sub-step 2: To avoid liquidation, be prepared to call repay on the lending protocol or deposit more collateral.
  • Sub-step 3: Periodically claim any reward tokens (e.g., Aave's stkAAVE or COMP) emitted by the lending protocol for participation.
solidity
// Example: Repaying a portion of debt on Aave V3 IERC20(daiAddress).approve(poolAddress, repayAmount); IPool(poolAddress).repay(daiAddress, repayAmount, 2, yourAddress);

Tip: Consider using a debt management dashboard that aggregates your position across both the lending and synthetic protocols for a unified view.

5

Unwind the Synthetic Position

Close the position to reclaim collateral, settling all debt.

Detailed Instructions

To exit, reverse the workflow. First, burn the synthetic token to redeem the stablecoin. Then, repay the stablecoin debt to the lending protocol to free your collateral. Finally, withdraw the original collateral. The order is crucial to maintain solvency and minimize slippage or interest accrual.

  • Sub-step 1: On the synthetic protocol, call burn or burnSynths to convert your synth back to the base stablecoin, paying any redemption fees.
  • Sub-step 2: With the stablecoin, repay the full outstanding debt (principal + accrued interest) to the lending protocol using the repay function.
  • Sub-step 3: Once debt is zero, call withdraw on the lending protocol to retrieve your original collateral, minus any fees.
solidity
// Example: Unwinding sequence ISynthToken(synthAddress).burn(burnAmount); IERC20(daiAddress).approve(poolAddress, debtBalance); IPool(poolAddress).repay(daiAddress, type(uint256).max, 2, yourAddress); // Repay all debt IPool(poolAddress).withdraw(wethAddress, collateralBalance, yourAddress);

Tip: Always check for outstanding interest accrued since your last interaction; use type(uint256).max to repay the full debt amount conveniently.

Common Protocol Combinations and Use Cases

Comparison of strategies for leveraging synthetic assets in DeFi lending.

Strategy FeatureSynthetix + AaveMakerDAO + LiquityAbracadabra + Yearn

Primary Collateral Type

sUSD, sETH, sBTC

ETH, wBTC, LP Tokens

Interest-Bearing Tokens (e.g., yvUSDC, xSUSHI)

Target Debt Asset

aTokens (e.g., aUSDC)

DAI

MIM

Max LTV for Strategy

~75% (Aave) + 130% C-Ratio (Synthetix)

~110-150% (Maker) + 110% (Liquity)

~90% (Abracadabra)

Interest Rate Mechanism

Variable (Aave) + Staking Rewards (SNX)

Stability Fee (Maker) + Liquity Fee

Variable (Abracadabra) + Yield Booster (Yearn)

Key Risk Vector

Synthetix debt pool fluctuation

Liquidation cascades from ETH volatility

Underlying yield strategy failure

Typical Gas Cost for Setup

~800k-1.2M gas

~1.5M-2M gas

~600k-900k gas

Exit / Unwind Complexity

Medium (burn synths, repay Aave)

High (repay DAI, close Vault, redeem collateral)

Low (repay MIM, withdraw collateral)

Best For

Leveraged yield on synthetic forex/crypto

Capital-efficient stablecoin minting

Recollateralizing yield-bearing assets

Advanced Composition Strategies

Maximizing Returns Through Recursive Strategies

Recursive lending involves using borrowed assets as collateral to borrow more, amplifying exposure. This strategy is high-risk and requires active monitoring of health factors.

Key Mechanisms

  • Collateral Recycling: Deposit a base asset (e.g., ETH) to mint a synthetic (e.g., sUSD). Supply the synthetic to a lending pool to borrow more of the base asset, then repeat the cycle.
  • Leverage Loops: On protocols like Aave or Compound, you can create a leverage loop by borrowing a stablecoin against a volatile collateral, swapping it for more collateral, and redepositing. This increases your position size and potential yield, but also liquidation risk.
  • Cross-Protocol Arbitrage: Use a synthetic asset minted on Synthetix as collateral on MakerDAO to mint DAI at a potentially better collateral ratio, then use that DAI to farm yield elsewhere.

Critical Risk Management

Always model the impact of price volatility on your health factor or collateral ratio. A 10% drop in collateral value can trigger cascading liquidations in a recursive position. Use tools like DeFi Saver for automated management.

risk_factors

Key Risk Factors in Composed Positions

Understanding the specific vulnerabilities introduced when combining synthetic assets with lending protocols is critical for risk management.

01

Liquidation Cascade Risk

Recursive liquidation occurs when a price drop triggers the liquidation of a collateralized debt position (CDP) backing a synthetic asset, which itself is used as collateral elsewhere. This can create a domino effect.

  • Example: A user deposits ETH to mint sUSD, then uses that sUSD as collateral to borrow more ETH on Aave.
  • A sharp ETH decline can liquidate the Aave position, forcing the sale of sUSD, which may trigger the original CDP's liquidation if the sUSD peg breaks.
  • This interconnectedness amplifies market volatility and user losses.
02

Oracle Manipulation & Front-Running

Oracle latency and manipulation are critical threats. Composed positions often rely on multiple price feeds for different assets, creating more attack surfaces.

  • An attacker could manipulate the price of a synthetic asset's underlying collateral to trigger unfair liquidations.

  • Keepers may front-run liquidation transactions, offering minimal collateral buyback, worsening user losses.

  • Protocols using different oracles for the same asset can create arbitrage opportunities at the user's expense.

03

Protocol Dependency & Smart Contract Risk

Systemic smart contract risk increases with each additional protocol integration. A failure in any component can compromise the entire composed position.

  • A critical bug or upgrade in the lending protocol (e.g., Aave, Compound) could freeze funds or alter liquidation logic.

  • The synthetic asset protocol (e.g., Synthetix, MakerDAO) could experience a governance attack or oracle failure.

  • Users bear the combined risk of all integrated protocols' code and administrative controls.

04

Liquidity Fragmentation & Slippage

Exit liquidity risk is heightened. Unwinding a composed position requires reversing multiple transactions, each subject to market depth and slippage.

  • To close a position, you must repay debt, burn synthetic assets, and withdraw collateral, potentially across several blocks.

  • During market stress, liquidity for synthetic assets can vanish, causing significant slippage on decentralized exchanges.

  • This makes it difficult and expensive to deleverage quickly, trapping users in deteriorating positions.

05

Interest Rate & Fee Volatility

Variable cost structures from multiple protocols can erode yields or increase costs unexpectedly. Positions are exposed to fluctuating borrowing rates and minting fees.

  • A spike in borrowing rates on the lending protocol can turn a leveraged yield farming position unprofitable.

  • The synthetic asset protocol may adjust stability fees or minting rewards via governance, impacting position economics.

  • Users must actively monitor and model these variable costs to avoid involuntary unwinding.

06

Collateral & Debt Depeg Risk

Asymmetric peg stability between the synthetic asset and its backing collateral creates unique instability. The position's health depends on multiple pegs holding.

  • If a synthetic stablecoin like DAI or sUSD depegs below its $1 target, the collateral value in the lending protocol drops.

  • Conversely, if the collateral asset (e.g., a liquid staking token) depegs, it threatens the overcollateralization ratio of the synthetic debt position.

  • This dual dependency makes positions vulnerable to peg instability in either ecosystem.

Implementing Risk Management and Monitoring

Process for establishing automated risk controls and real-time monitoring for a synthetic asset lending strategy.

1

Define Risk Parameters and Health Thresholds

Establish the quantitative limits that define the safety of your leveraged position.

Detailed Instructions

Define the core risk parameters that will trigger automated actions. The primary metric is the Health Factor (HF), calculated as (Collateral Value * Liquidation Threshold) / Total Borrowed Value. A position becomes liquidatable when HF < 1. Set a Safety Buffer (e.g., HF > 1.5) for proactive alerts.

  • Sub-step 1: Determine the Liquidation Threshold for your collateral asset (e.g., 75% for wETH).
  • Sub-step 2: Calculate the minimum collateral required for your target borrow amount to maintain your Safety Buffer.
  • Sub-step 3: Set a Maximum Debt Ceiling for the protocol to limit protocol-level exposure.
  • Sub-step 4: Define acceptable Price Deviation thresholds for your oracle feeds.

Tip: Use a conservative liquidation threshold from the protocol's documentation, as it can vary by asset and market conditions.

2

Implement Automated Health Factor Monitoring

Set up a script to continuously track your position's health and collateralization.

Detailed Instructions

Build a monitoring agent that queries on-chain data to compute the real-time Health Factor. Use the lending protocol's lens contracts or direct contract calls for efficiency.

  • Sub-step 1: Fetch the user's userAccountData from the Aave V3 Pool contract, which returns totalCollateralBase, totalDebtBase, and healthFactor.
  • Sub-step 2: Parse the returned values. The health factor is returned as an integer; divide by 1e18 for the decimal representation.
  • Sub-step 3: Log the HF and trigger an alert (e.g., Discord webhook, SMS) if it drops below your predefined Safety Buffer.
  • Sub-step 4: Monitor the Available Borrowing Power to anticipate if you can safely increase leverage.
javascript
// Example using ethers.js to fetch Aave V3 health factor const userData = await lendingPool.getUserAccountData(userAddress); const healthFactor = Number(userData.healthFactor) / 1e18; console.log(`Current Health Factor: ${healthFactor}`);

Tip: Run this script on a serverless function (e.g., AWS Lambda) with a 60-second interval for cost-effective, real-time monitoring.

3

Configure Oracle and Price Feed Safeguards

Ensure the integrity of the price data that determines your collateral value and liquidation prices.

Detailed Instructions

Synthetic asset values are derived from oracles. Monitor these feeds for staleness, manipulation, and deviation.

  • Sub-step 1: Identify the primary oracle (e.g., Chainlink AggregatorV3Interface) and any fallback oracles used by the protocol.
  • Sub-step 2: Check the latestRoundData() for the answeredInRound and updatedAt values. A stale price (e.g., > 1 hour old) is a critical risk.
  • Sub-step 3: Monitor the price deviation between the primary oracle and a secondary decentralized source (e.g., a Uniswap V3 TWAP) using a price deviation oracle.
  • Sub-step 4: Set up alerts for oracle downtime or if the price deviates beyond a set percentage (e.g., 3%).
solidity
// Solidity snippet to check Chainlink oracle staleness (, int256 answer, , uint256 updatedAt, ) = aggregator.latestRoundData(); require(block.timestamp - updatedAt <= STALE_PRICE_DELAY, "Stale price"); require(answer > 0, "Invalid price");

Tip: For critical positions, consider subscribing to Chainlink's Market & Data Feeds status page for outage notifications.

4

Establish a Liquidation Response Protocol

Create a plan and tools to react swiftly if your position approaches liquidation.

Detailed Instructions

When the Health Factor nears 1, you must either add collateral or repay debt. Automate this response to avoid liquidation penalties and loss of funds.

  • Sub-step 1: Pre-approve a stablecoin (e.g., USDC) for debt repayment on the lending protocol to save time in a crisis.
  • Sub-step 2: Create a Keeper Network job (using Chainlink Keepers or Gelato) that automatically repays a portion of the debt when HF < 1.1.
  • Sub-step 3: Alternatively, prepare a script that can be manually executed to deposit additional collateral from a designated wallet.
  • Sub-step 4: Calculate the exact amount needed to restore the HF to your Safety Buffer. Use the formula: Required Collateral Increase = (Total Debt * Target HF) / Liquidation Threshold - Current Collateral.

Tip: Test your emergency response script on a testnet with a simulated price drop to ensure it executes correctly under network congestion.

5

Monitor Protocol and Market Risk Indicators

Track external factors that could impact the safety of your position beyond direct metrics.

Detailed Instructions

Systemic risks include changes to the lending protocol's parameters and broader market volatility.

  • Sub-step 1: Subscribe to governance forums (e.g., Aave Governance Forum) for proposals that may affect Liquidation Thresholds, Loan-to-Value ratios, or asset listings.
  • Sub-step 2: Monitor the protocol's Total Value Locked (TVL) and Utilization Rates for your borrowed asset. High utilization (>90%) can lead to increased borrowing costs and liquidity crunches.
  • Sub-step 3: Track the Stablecoin peg of assets you are borrowing or using as collateral (e.g., DAI, USDC). A depeg can drastically affect collateral value.
  • Sub-step 4: Watch for network congestion on the underlying blockchain, as high gas fees can prevent timely execution of your risk mitigation transactions.

Tip: Use DeFi risk dashboards like DeFi Pulse or DeFi Llama to get an aggregated view of protocol health and market conditions.

Frequently Asked Questions on Synthetic Composition

The primary risk is liquidation cascades. If the value of the underlying collateral in the lending vault drops, it triggers a liquidation, forcing the sale of that collateral. This sale can depress the asset's price, triggering further liquidations in a feedback loop. For your synthetic position, this means the collateral backing it can be forcibly removed, potentially leaving the synthetic undercollateralized. Managing this requires maintaining a high collateralization ratio, often 150% or more, and using stable or less volatile assets as the primary collateral layer.