Skip to content

Ash20pk/nexus-playground

Repository files navigation

Nexus Playground Studio - Visual Intent Composer

Nexus Playground Studio is a drag-and-drop visual workflow builder for creating cross-chain automation and DeFi strategies using the Avail Nexus SDK.

🌟 Features

Visual Workflow Builder

  • Drag & Drop Interface: Intuitive node-based workflow creation
  • Real-time Preview: See your workflow as you build it
  • Connection Validation: Ensures proper data flow between nodes

Pre-built Action Nodes

  • Bridge: Move tokens between different blockchain networks
  • Transfer: Send tokens to specific addresses
  • Swap: Exchange tokens on DEX protocols
  • Stake: Deposit tokens in DeFi protocols (Aave, Compound, etc.)
  • Custom Contract: Execute any smart contract function
  • Condition: Add conditional logic to workflows
  • Trigger: Start point for workflow execution

Workflow Management

  • Templates: Pre-built workflows for common use cases
  • Save & Load: Persist workflows locally and via API
  • Export/Import: Share workflows as JSON files
  • Community Workflows: Discover and use public workflows

Execution Engine

  • Real-time Execution: Execute workflows with live progress tracking
  • Error Handling: Comprehensive error reporting and recovery
  • Transaction Monitoring: Track all blockchain transactions
  • Simulation: Test workflows before execution

πŸš€ Getting Started

Access Nexus Playground Studio

  1. From the main app: Click "Open Nexus Playground Studio" button
  2. Direct access: Navigate to /studio route
  3. Development: Visit http://localhost:3000/studio

Creating Your First Workflow

  1. Start with a Template:

    • Click "Templates" to browse pre-built workflows
    • Choose "Bridge & Stake" for a simple example
    • Customize parameters as needed
  2. Build from Scratch:

    • Click "New Workflow"
    • Add a "Trigger" node to start
    • Drag additional nodes from the palette
    • Connect nodes by dragging between handles
    • Configure each node in the right panel
  3. Execute Workflow:

    • Click "Execute" in the toolbar
    • Monitor progress in real-time
    • View results and transaction links

πŸ“‹ Workflow Templates

Bridge & Stake

Bridge USDC from Ethereum to Polygon and automatically stake in Aave.

Trigger → Bridge (ETH→Polygon) → Stake (Aave)

Multi-Chain Arbitrage

Exploit price differences across multiple chains.

Trigger → Swap (ETH) → Bridge (ETH→Arbitrum) → Swap (Arbitrum)

Conditional Transfer

Transfer tokens only when certain conditions are met.

Trigger β†’ Condition (balance > 100) β†’ Transfer

πŸ”§ Node Configuration

Bridge Node

  • From Chain: Source blockchain network
  • To Chain: Destination blockchain network
  • Token: Asset to bridge (USDC, ETH, USDT)
  • Amount: Amount to bridge or "fromPrevious"

Transfer Node

  • Chain: Target blockchain network
  • Token: Asset to transfer
  • Amount: Transfer amount or "fromPrevious"
  • Recipient: Destination wallet address

Swap Node

  • Chain: Blockchain for the swap
  • From Token: Input token
  • To Token: Output token
  • Amount: Swap amount or "fromPrevious"
  • Slippage: Maximum slippage tolerance

Stake Node

  • Chain: Blockchain network
  • Token: Asset to stake
  • Amount: Stake amount or "fromPrevious"
  • Protocol: DeFi protocol (aave, compound, uniswap)

Custom Contract Node

  • Chain: Target blockchain
  • Contract Address: Smart contract address
  • Function Name: Contract function to call
  • Parameters: Function parameters as JSON array

πŸ”— Node Connections

Output Handles (Right side)

  • amount: Token amount from the operation
  • transaction: Transaction hash/receipt

Input Handles (Left side)

  • trigger: Required connection to start execution
  • amount: Optional amount input from previous node

Data Flow

  • Use "fromPrevious" in amount fields to use output from connected nodes
  • Chain multiple operations by connecting transaction outputs to trigger inputs

🎯 Use Cases

DeFi Automation

  • Yield Farming: Bridge to high-yield chains and stake automatically
  • Liquidity Management: Rebalance across multiple pools
  • Arbitrage Bots: Exploit cross-chain price differences

Portfolio Management

  • Diversification: Split assets across multiple chains
  • Rebalancing: Maintain target allocations automatically
  • Risk Management: Move assets based on market conditions

Cross-Chain Operations

  • Gas Optimization: Move to cheaper chains for operations
  • Protocol Access: Access DeFi protocols on different chains
  • Yield Optimization: Find best rates across ecosystems

πŸ”’ Security & Best Practices

Workflow Design

  • Always test with small amounts first
  • Use simulation before execution
  • Set appropriate slippage tolerances
  • Validate all addresses and parameters

Access Control

  • Keep private keys secure
  • Use hardware wallets for large amounts
  • Review all transactions before signing
  • Monitor execution closely

Error Handling

  • Plan for failed transactions
  • Set realistic timeouts
  • Have backup strategies
  • Monitor gas prices

πŸ›  API Integration

Workflow Execution API

POST /api/workflows/{id}/execute

Workflow Management

// Get workflows
GET /api/workflows

// Save workflow
POST /api/workflows

// Get templates
GET /api/workflows/templates

Integration Example

import { useWorkflowStore } from '@/store/workflowStore';

const { executeWorkflow, currentWorkflow } = useWorkflowStore();

// Execute current workflow
await executeWorkflow();

🀝 Contributing

Nexus Playground Studio is built with:

  • React Flow: Visual workflow editor
  • Zustand: State management
  • Next.js: Full-stack framework
  • Avail Nexus SDK: Cross-chain operations

To contribute:

  1. Fork the repository
  2. Create workflow templates
  3. Add new node types
  4. Improve the execution engine
  5. Submit pull requests

πŸ“š Resources


About

A visual composer studio for Avail Nexus SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •