Skip to content

[FEATURE] DeFi: Implement yield farming aggregator service (#43) #298

Description

@KevinMB0220

📋 Feature Description

Clear and concise description of the feature:
Create a yield farming aggregator service YieldFarmingAggregator that programmatically evaluates yield options across Blend pools, Soroswap pools, and internal Vault strategies, and provides a unified interface to deposit assets into the source of highest APR/APY.

🎯 Motivation

Why is this feature needed? What problem does it solve?
Tracks roadmap item #43. This allows developers and automated agents to query multiple yield-bearing protocols, compare their returns, and automate allocation without manual repositioning.

💡 Proposed Solution

How should this feature work? Include technical details:
Build a core service class in packages/core/defi-protocols that fetches rates from Blend pools, Soroswap reserves, and vault configurations. Expose deposit, withdraw, and optimize/rebalance methods.

🔧 Technical Implementation

Implementation details for AI/developers:

Files to Create/Modify

  • packages/core/defi-protocols/src/services/yield-farming-aggregator.ts

Dependencies

  • None additional

API Changes

export interface YieldOpportunity {
  protocol: string;
  asset: string;
  apy: number;
  tvl: string;
}
export class YieldFarmingAggregator {
  async getOpportunities(): Promise<YieldOpportunity[]>;
  async deposit(opportunity: YieldOpportunity, amount: string): Promise<string>;
}

✅ Acceptance Criteria

  • Correctly fetches and aggregates APY rates.
  • Deposits route successfully through the chosen protocol.
  • Unit tests cover rebalancing calculations.

📚 Additional Context

None.

🔗 Related Issues

🏷️ Labels

Phase: phase-3
Component: defi
Priority: high


---

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestphase-3Phase 3: Advanced Features

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions