Skip to main content

Overview

DeFi strategies allow you to put your idle treasury funds to work, earning yield while maintaining liquidity. This guide covers how to use strategies effectively and safely.

What are DeFi Strategies?

A DeFi strategy represents a yield-earning opportunity through decentralized finance protocols. When you deploy funds to a strategy:
  1. Your tokens are deposited into a DeFi protocol
  2. The protocol uses your funds (lending, liquidity provision, etc.)
  3. You earn yield (interest, fees, rewards)
  4. You can withdraw your funds plus earnings at any time

Available Strategies

Sky Protocol (formerly MakerDAO)

Sky Protocol - USDS Savings

Asset: USDC → USDS → sUSDSAPY Range: 4-8%Risk Level: LowLiquidity: High (instant withdrawals)Min Deposit: No minimum
How it works:
  1. Deposit USDC to receive USDS (Sky Dollar - stablecoin)
  2. Stake USDS to receive sUSDS (Sky Savings USDS)
  3. sUSDS accumulates value over time
  4. Unstake and convert back to USDC when needed
Key Features:
  • Battle-tested protocol (evolved from MakerDAO)
  • Audited smart contracts
  • Large TVL (Total Value Locked)
  • No lock-up period
  • Predictable, stable yields
Best For:
  • Conservative treasury management
  • Large allocations
  • Primary yield strategy
  • Long-term holdings

Strategy Lifecycle

1. Viewing Available Strategies

const response = await fetch('/api/strategies?status=active', {
  credentials: 'include'
});

const { strategies } = await response.json();

// Response:
// [
//   {
//     "id": "sky-protocol",
//     "name": "Sky Protocol USDS Savings",
//     "type": "yield",
//     "chainId": 1,
//     "apy": "5.25",
//     "status": "active"
//   }
// ]

2. Creating an Allocation

An allocation represents your position in a strategy:
const response = await fetch('/api/allocations', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    accountId: 'acc_789',
    strategyId: 'sky-protocol',
    shares: '1000.500000000000000000',  // sUSDS shares received
    depositedAmount: '1000.00',         // Original USDC deposited
    token: 'usdc',
    depositTxHash: '0x...',
    depositedAt: new Date().toISOString()
  })
});

const { allocation } = await response.json();

3. Monitoring Your Position

Track your allocation’s performance:
// Get specific allocation
const response = await fetch(`/api/allocations/${allocationId}`, {
  credentials: 'include'
});

const { allocation } = await response.json();

// allocation includes:
// - depositedAmount: Original deposit
// - currentValue: Current value (updated periodically)
// - shares: Number of strategy tokens held
// - Gain/loss calculation

4. Updating Position Value

Periodically update the current value of your position:
await fetch(`/api/allocations/${allocationId}`, {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    currentValue: '1025.50',  // New value after yield accrual
    valueUpdatedAt: new Date().toISOString()
  })
});

5. Withdrawing from Strategy

When you need liquidity:
1

Create Withdrawal Transaction

Create a transaction to withdraw from the strategy
2

Execute On-Chain

Execute the withdrawal and get transaction hash
3

Update Allocation

Mark allocation as withdrawn
// Update allocation status
await fetch(`/api/allocations/${allocationId}`, {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({
    status: 'withdrawn',
    withdrawTxHash: '0x...',
    withdrawnAt: new Date().toISOString()
  })
});

Automated Strategy Management

Auto-Deploy with Workflows

Set up a workflow to automatically deploy idle funds:
// Create workflow
const workflow = await createWorkflow({
  accountId: 'treasury_account',
  name: 'Auto-Deploy Idle Funds',
  description: 'Deploy excess USDC to Sky Protocol daily'
});

// Add scheduled trigger
const trigger = await createTrigger({
  workflowId: workflow.id,
  name: 'Daily at 9am',
  type: 'schedule',
  config: JSON.stringify({ cron: '0 9 * * *' }),
  transactionType: 'deposit',
  transactionConfig: JSON.stringify({
    amount: '5000',  // Deploy $5k daily
    token: 'usdc',
    strategyId: 'sky-protocol'
  })
});

Auto-Withdraw on Low Balance

Automatically withdraw when treasury balance is low:
const trigger = await createTrigger({
  workflowId: workflow.id,
  name: 'Low Balance Emergency',
  type: 'balance_below',
  config: JSON.stringify({ threshold: '10000' }),
  transactionType: 'withdraw',
  transactionConfig: JSON.stringify({
    amount: '20000',  // Withdraw $20k
    token: 'usdc',
    strategyId: 'sky-protocol'
  })
});

Strategy Performance Tracking

Calculate Yields

// Fetch all allocations
const { allocations } = await fetch('/api/allocations?status=active', {
  credentials: 'include'
}).then(r => r.json());

// Calculate total yield
const totalYield = allocations.reduce((sum, allocation) => {
  const deposited = parseFloat(allocation.depositedAmount);
  const current = parseFloat(allocation.currentValue || allocation.depositedAmount);
  const gain = current - deposited;
  return sum + gain;
}, 0);

console.log(`Total Yield Earned: $${totalYield.toFixed(2)}`);

APY Calculation

function calculateAPY(allocation) {
  const deposited = parseFloat(allocation.depositedAmount);
  const current = parseFloat(allocation.currentValue || allocation.depositedAmount);
  const gain = current - deposited;
  
  const depositDate = new Date(allocation.depositedAt);
  const now = new Date();
  const daysHeld = (now - depositDate) / (1000 * 60 * 60 * 24);
  const yearFraction = daysHeld / 365;
  
  const returnRate = gain / deposited;
  const apy = (returnRate / yearFraction) * 100;
  
  return apy.toFixed(2);
}

Risk Management

Important ConsiderationsWhile DeFi strategies can earn yield, they come with risks:
  • Smart contract vulnerabilities
  • Protocol failures
  • Liquidity crunches
  • Regulatory changes
  • Market volatility

Risk Mitigation Strategies

Don’t put all funds in one strategy. Split across multiple protocols to reduce concentration risk.Example Allocation:
  • 50% Sky Protocol
  • 30% Cash reserves
  • 20% Other protocols
Set maximum allocation limits per strategy based on protocol TVL and your risk tolerance.
const MAX_ALLOCATION_PERCENT = 0.10; // 10% of protocol TVL
const MAX_ABSOLUTE = 1000000; // $1M max
  • Check APY changes weekly
  • Monitor protocol news and audits
  • Review allocation values daily
  • Set up alerts for unusual activity
Always have a plan to withdraw:
  • Know withdrawal timeframes
  • Understand gas costs
  • Have backup liquidity sources
  • Test withdrawals with small amounts first

Red Flags to Watch For

Warning Signs

Immediate Action Required:
  • APY drops significantly (>50%)
  • Protocol TVL decreases rapidly
  • Smart contract exploit reported
  • Team members leaving project
  • Regulatory concerns
Response: Withdraw funds immediately

Best Practices

1. Start Small

Test strategies with small allocations first:
// Test deposit: $100
const testAllocation = {
  accountId: 'test_account',
  strategyId: 'sky-protocol',
  depositedAmount: '100.00',
  // ... other fields
};

// Monitor for 1 week, then scale up

2. Document Everything

Keep detailed records of all strategy operations:
const allocation = {
  accountId: 'acc_789',
  strategyId: 'sky-protocol',
  depositedAmount: '10000.00',
  notes: 'Q1 2026 yield strategy - targeting 5% APY',
  approvedBy: 'treasury_committee',
  reviewDate: '2026-04-01'
};

3. Automate Value Updates

Set up a scheduled job to update allocation values:
// Run daily to fetch latest values
async function updateAllocationValues() {
  const { allocations } = await fetch('/api/allocations?status=active')
    .then(r => r.json());
  
  for (const allocation of allocations) {
    // Fetch current value from protocol
    const currentValue = await fetchProtocolValue(
      allocation.strategyId,
      allocation.shares
    );
    
    // Update allocation
    await fetch(`/api/allocations/${allocation.id}`, {
      method: 'PATCH',
      body: JSON.stringify({
        currentValue: currentValue.toString(),
        valueUpdatedAt: new Date().toISOString()
      })
    });
  }
}

4. Set Rebalancing Triggers

Automatically rebalance when APY changes:
// Pseudo-code for rebalancing logic
async function checkRebalancing() {
  const { strategies } = await fetch('/api/strategies')
    .then(r => r.json());
  
  const bestStrategy = strategies
    .filter(s => s.status === 'active')
    .sort((a, b) => parseFloat(b.apy) - parseFloat(a.apy))[0];
  
  // If best strategy APY is significantly higher, trigger rebalancing
  const currentAPY = getCurrentStrategyAPY();
  if (parseFloat(bestStrategy.apy) - currentAPY > 2.0) {
    // Trigger workflow to rebalance
    await triggerRebalancingWorkflow(bestStrategy.id);
  }
}

Strategy Comparison

FactorSky ProtocolFuture Protocols
APY4-8%TBD
RiskLowTBD
LiquidityInstantTBD
Min DepositNoneTBD
Lock-upNoneTBD
ComplexitySimpleTBD

Tax Considerations

Consult a Tax ProfessionalDeFi yields may have tax implications:
  • Yield may be taxable as income
  • Timing of recognition varies by jurisdiction
  • Record-keeping requirements
  • Reporting obligations

Next Steps