Unified Margin

Unified Margin Examples

Real-world DeFi execution plans you can run with Tetrics SDK for unified margin management across chains. Copy, customize, and deploy!

Basic Operations

1. Stake ETH on Lido

Simple ETH staking to receive stETH - building your unified margin position.

import { TetricsClient, type ActionStep } from '@tetrics/sdk'

const client = TetricsClient.fromApiKey(keyId, secret)

const actions: ActionStep[] = [{
  chain: 'ethereum',
  protocol: 'lido',
  method: 'deposit',
  params: { amount: '1000000000000000000' }, // 1 ETH
  value: '1000000000000000000'
}]

const receipt = await client.executePlanDirect({
  name: 'Stake ETH on Lido',
  steps: actions,
  executionMode: 'atomic'
})

console.log(`stETH received! Tx: ${receipt.action_results?.[0]?.tx_hash}`)

Use Case: Earn staking rewards on your ETH without running a validator.

Expected Returns: ~4% APY

2. Wrap stETH to wstETH

Convert stETH to wstETH for DeFi composability.

Use Case: wstETH is composable with other DeFi protocols (Morpho, Aave, etc).

3. Supply Collateral to Morpho

Supply wstETH as collateral on Morpho Blue.

Use Case: Earn supply APY while maintaining ability to borrow.

Intermediate Workflows

4. Stake and Wrap (2-Step)

Stake ETH and automatically wrap to wstETH.

Benefits:

  • ✅ Atomic execution (all-or-nothing)

  • ✅ Gas savings (~30% vs separate txs)

  • ✅ wstETH ready for DeFi

5. Collateralized Borrowing

Supply collateral and borrow USDC in one transaction.

Risk Parameters:

  • Collateral: 2 wstETH (~$7,000)

  • Borrow: $4,900 USDC

  • LTV: 70%

  • Liquidation threshold: ~83%

6. Leverage Staking

Recursive staking for amplified returns.

Effective Exposure: 1.7 ETH staked with 1 ETH capital

⚠️ Risks: Liquidation risk if ETH price drops significantly

Advanced Cross-Chain Unified Margin

7. Ethereum to Hyperliquid Yield

Bridge ETH to Hyperliquid and supply to HyperLend.

Expected Returns: ~5-8% APY on HyperLend

8. HYPE Staking and Lending

Stake HYPE for beHYPE, then use as collateral for unified margin.

Benefits:

  • Earn staking rewards on HYPE

  • Earn supply APY on beHYPE

  • Access to borrowed capital

9. Felix CDP

Create a CDP, deposit collateral, mint fUSDC for unified margin positions.

Collateralization Ratio: ~66% (safe from liquidation)

Production Workflows

10. Full Yield Optimization with Unified Margin

Complete multi-chain execution plan for maximum yield using unified margin.

Expected Returns:

  • Lido staking: 4% APY

  • Morpho supply: 2% APY

  • HyperLend supply: 6% APY

  • Effective APY: ~8-12% (on 5 ETH capital)

Risks:

  • ⚠️ Liquidation risk if ETH drops >30%

  • ⚠️ Bridge risk during transfers

  • ⚠️ Smart contract risk across 4+ protocols

Execution Plan Templates

Reusable Plan Builder

Best Practices

✅ DO

❌ DON'T

Testing Workflows

Always test with small amounts first:

Last updated