πŸ’‘DefiLens Automation Examples

Here are some practical examples of how you can use DefiLens to automate your DeFi strategies:

1. Optimizing Lending Yields

Scenario: Automatically lend when APY increases

  • Condition: APY on Aave for USDC increases above 5%

  • Action: Lend available USDC on Aave

  • Benefit: Capture higher yields without constant monitoring

Scenario: Withdraw when APY decreases

  • Condition: APY on Compound for DAI drops below 3%

  • Action: Withdraw DAI from Compound

  • Benefit: Avoid keeping funds in low-yield environments

2. Dynamic Trading Strategies

Scenario: Buy asset when price decreases

  • Condition: ETH price drops by 10% in 24 hours

  • Action: Buy 1 ETH using USDC

  • Benefit: Automatically "buy the dip" without emotional decision-making

Scenario: Sell asset when price increases

  • Condition: BTC price increases by 20% from your buy-in price

  • Action: Sell 0.1 BTC for USDT

  • Benefit: Lock in profits at predetermined levels

3. Rebalancing Portfolio

Scenario: Maintain desired asset allocation

  • Condition: ETH/BTC ratio in portfolio deviates by 5% from 50/50 split

  • Action: Buy/sell necessary amount to rebalance to 50/50

  • Benefit: Keep your portfolio balanced without manual calculations

4. Cross-Platform Arbitrage

Scenario: Exploit price differences

  • Condition: LINK price on Uniswap is 2% higher than on SushiSwap

  • Action: Buy LINK on SushiSwap, sell on Uniswap

  • Benefit: Profit from price inefficiencies across DEXes

5. Liquidation Protection

Scenario: Avoid liquidation on loans

  • Condition: Collateralization ratio on MakerDAO drops to 170%

  • Action: Add more collateral or repay part of the loan

  • Benefit: Protect your position from automatic liquidation

6. Time-Based DCA (Dollar-Cost Averaging)

Scenario: Regular investment regardless of price

  • Condition: Every Monday at 9:00 AM UTC

  • Action: Buy $100 worth of ETH

  • Benefit: Implement a disciplined investment strategy without manual input

Example Automation Flow

Here's how a multi-step automation might work:

  1. Initial Setup: You have 10,000 USDC and want to optimize yields while managing risk.

  2. Step 1: Yield Optimization

    • Condition: APY for USDC on Platform A > 6%

    • Action: Lend 5,000 USDC on Platform A

  3. Step 2: Risk Management

    • Condition: If total value of USDC lending position drops below $4,800

    • Action: Withdraw all USDC from Platform A

  4. Step 3: Redeployment

    • Condition: 24 hours after withdrawal from Step 2

    • Action: Check APYs across platforms and lend on highest (if above 4%)

  5. Step 4: Take Profits

    • Condition: If total earnings from lending reach $500

    • Action: Withdraw $500 worth of USDC to your wallet

This flow automatically manages your lending position, protects against significant value loss, seeks new opportunities, and secures profits - all without your constant attention.

Remember, these are just examples. DefiLens allows you to create custom automations tailored to your specific investment goals and risk tolerance. Always consider your personal financial situation and risk appetite when setting up automations.

Last updated