Project Origins

Daydreams emerged from a critical insight: traditional agent frameworks like LangChain—and even systems built for Realms Eternum—fall short when it comes to handling the vast, unbounded possibilities of onchain interactions. In a landscape where hardcoding every scenario is infeasible, Daydreams leverages the inherent fluidity of onchain infrastructure to create agents capable of navigating infinite pathways.

The Visionary Behind Daydreams

Daydreams, created by Lord of a Few—a prolific builder in the web3 ecosystem—leverages years of hands-on experience in decentralized technologies. Notable achievements include:

  • Founding Contributor at Loot Realms
  • Co-founder of Ohayo Dojo
  • Builder with Cartridge.gg
  • Member of the Starknet class of '21
  • Founder of Realms Eternum
  • Top ElizaOS Contributor

With over 7,500 contributions in the last two years, Lord of a Few has consistently pushed the envelope in onchain infrastructure, covering everything from low-level indexing and smart contracts to high-level GUI design. This extensive background informs Daydreams' robust architecture and forward-thinking design.

Core Innovations

Daydreams addresses the perennial challenge of long time-horizon goals through several innovative features:

  • Hierarchical Task Networks: Breaking down complex objectives into manageable sub-goals.
  • Swarm Rooms: Facilitating agent collaboration for coordinated decision-making.
  • Sleeves: Utilizing simple markdown files for API integration and agent guidance.
  • Zero Custom Code Integration: Simplifying the onboarding process with no bespoke coding required.

What Makes Daydreams Stand Out?

Daydreams offers a complete cognitive architecture capable of:

  • Memory & Learning: Retaining and refining knowledge from past interactions.
  • Goal Decomposition: Transforming broad objectives into actionable tasks.
  • Cross-Chain Execution: Performing trades and transactions across diverse blockchain networks.
  • Adaptive Strategy: Evolving tactics based on real-time outcomes.

Under the Hood: The Technology Behind Daydreams

1. Memory That Makes Sense

Traditional bot memory systems are often limited to key-value storage. Daydreams, however, organizes its memory in a way that mirrors human cognition—clustering similar experiences and learning patterns over time:

// Traditional bot memory retrieval
const lastTrade = cache.get('lastTrade');

// Daydreams memory retrieval: Finding similar past experiences
const similarExperiences = await memory.findSimilarEpisodes(
    "ETH price dropped 5% in 10 minutes"
);

2. Smart Goal Handling

When you instruct a Daydreams agent with a goal such as, "maximize yield while maintaining $100k in stable liquidity," the system automatically:

  • Breaks down the goal into smaller, manageable tasks.
  • Prioritizes tasks based on current market conditions.
  • Executes in parallel where possible.
  • Adapts the strategy based on feedback and outcomes.

3. Chain-Agnostic by Design

Daydreams is built to work seamlessly across any blockchain. The following code snippet demonstrates how an agent can execute a limit order across different chains:

// Execute a limit order across any supported chain
await agent.execute({
    chain: "hyperliquid", // Alternatives: "base", "solana", "starknet"
    action: "placeLimitOrder",
    params: { /* order parameters */ }
});

Real-World Impact: From DeFi to Beyond

Daydreams is not just a concept—it's built for high-stakes, real-world applications, particularly in decentralized finance and trading:

Autonomous Trading

  • Multi-market monitoring: Simultaneously observes various markets.
  • Adaptive learning: Incorporates feedback from both successful and unsuccessful trades.
  • Real-time strategy adaptation: Adjusts strategies on the fly.
  • Risk management: Automatically maintains predefined risk parameters.

Smart Position Management

  • Dynamic sizing: Determines optimal position sizes based on historical data.
  • Adaptive stop-losses: Adjusts stop-loss orders as market conditions evolve.
  • Multi-chain liquidity management: Optimizes liquidity across different blockchains.
  • Gas-efficient execution: Prioritizes transaction cost-effectiveness.

Advanced Pattern Recognition

  • Cross-timeframe analysis: Identifies market patterns over varying durations.
  • Outcome correlation: Links recognized patterns with trading outcomes.
  • Iterative strategy building: Crafts strategies based on repeated successful experiences.
  • Error avoidance: Learns to sidestep pitfalls from past mistakes.

Production-Ready Architecture

Daydreams is engineered for robust, production-level deployment:

  • Type-Safe: End-to-end type safety minimizes runtime errors.
  • Automatic Error Recovery: Built-in mechanisms ensure resilience.
  • Transaction Simulation: Pre-execution simulations reduce the risk of failed transactions.
  • Comprehensive Monitoring: Detailed logging and analytics for continuous performance insights.

The Magic is in the Memory

A standout feature of Daydreams is its sophisticated memory system, which enables agents to learn from every interaction:

// Storing a successful trade experience
await agent.storeExperience({
    action: "Bought ETH at support after 5% drop",
    outcome: "15% profit taken at resistance",
    context: {
        marketConditions,
        indicators,
        reasoning
    }
});

// Later, recalling similar experiences under current market conditions
const relevantExperiences = await agent.recall({
    similar: currentMarketConditions
});

This capability ensures that with every trade and market fluctuation, the agent refines its strategy—evolving into a more adept and autonomous system over time.

Beyond Trading: Versatility Across Blockchain Use-Cases

While Daydreams is particularly potent in the DeFi space, its cognitive architecture is versatile enough to handle a wide array of blockchain applications, including:

  • NFT Trading & Collection Management
  • Yield Farming Optimization
  • Liquidity Provision Strategies
  • Cross-Chain Arbitrage
  • DAO Participation and Governance

Getting Started with Daydreams

Designed to be both powerful and approachable, setting up a Daydreams agent is straightforward:

// Instantiate a new Daydreams agent
const agent = new Daydreams({
    chains: ["hyperliquid", "base"],
    memory: new VectorMemory(),
    goals: ["maintain_liquidity", "maximize_yield"]
});

// Start the agent to begin execution
await agent.start();

Looking Ahead

The journey of Daydreams is just beginning. Upcoming enhancements on the roadmap include:

  • Advanced Market Pattern Recognition: More refined analysis of market trends.
  • Multi-Agent Collaboration: Enabling agents to work together for complex decision-making.
  • Custom Strategy Development: Allowing tailored strategies to meet specific use cases.
  • Enhanced Risk Management: Further automation and refinement of risk controls.

Try It Out

Daydreams is open source and ready for developers to experiment with. Whether you're building an advanced trading bot, a decentralized automation system, or exploring entirely new applications, Daydreams provides a robust cognitive framework for onchain agents.

Explore the code and contribute on our GitHub repository.

Daydreams isn't just another bot framework—it's a transformative step toward autonomous onchain agents that learn, adapt, and execute with ever-increasing sophistication.

Author Of article : Bruce Read full article