Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SynFutures Integration for Automate #56

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

CryptoDoru
Copy link

@CryptoDoru CryptoDoru commented Feb 18, 2025

SynFutures Integration with Automate Framework

This PR implements a comprehensive integration between SynFutures and the Automate framework, enabling natural language command processing for derivatives trading and liquidity management on the BASE network.

Latest Updates

  • Migrated to SDK v2 for improved performance
  • Replaced .env with env.ts for better environment configuration
  • Implemented comprehensive batch testing system
  • Enhanced documentation and examples
  • Added test report generation

Core Features

1. Trading Operations

  • Market order execution with slippage protection
  • Limit order placement with advanced order types (GTC, IOC, FOK)
  • Leveraged position management (2x-25x)
  • Position monitoring and risk management
  • Support for both long and short positions

2. Liquidity Management

  • Concentrated liquidity provision with customizable ranges
  • Dynamic fee adjustment based on market volatility
  • Position range adjustment capabilities
  • Fee collection and reinvestment options
  • Partial liquidity removal support

3. Protocol Integration

  • Full integration with SynFutures' Oyster AMM
  • Support for permissionless derivatives trading
  • Unified liquidity system (AMM + Orderbook)
  • Price stabilization mechanisms
  • Mock client for testing and development

Technical Implementation

Architecture

  • Modular function-based architecture for extensibility
  • Type-safe implementations with comprehensive TypeScript definitions
  • Environment-based configuration through env.ts
  • Robust error handling and transaction validation
  • Mock client support for testing and development

Testing Infrastructure

  • Comprehensive batch testing system with 10+ test cases
  • Automated test report generation
  • Categories covered:
    • Market Orders
    • Limit Orders
    • Leveraged Positions
    • Liquidity Management
    • Error Handling
  • 100% success rate across all test categories

Environment Configuration

Now using env.ts near index.ts with support for:

  • Network Configuration (CHAIN_NAME, RPC_URL)
  • Trading Configuration (TRADING_PAIR, SLIPPAGE_TOLERANCE)
  • OpenAI Configuration for natural language processing
  • Test Mode Settings

Documentation

  • Comprehensive README with setup instructions
  • Environment configuration guide
  • Command format documentation
  • Usage examples for all operations
  • Security considerations and best practices

Security Features

  • Slippage protection for trades
  • Transaction validation and verification
  • Environment-based security configuration
  • Private key management guidelines
  • Test mode for safe development

Dependencies

  • @heyanon/sdk ^2.0.4
  • @synfutures/oyster-sdk 0.2.29
  • viem ^2.7.9
  • Other development dependencies as specified in package.json

Testing Instructions

  1. Clone the repository
  2. Configure environment variables in env.ts
  3. Set IS_TEST=true for safe testing
  4. Run test suite: pnpm run test:batch
  5. Check generated test report for results

Deployment Notes

  • Configured for BASE network (8453)
  • Supports BASE_SEPOLIA testnet
  • Requires proper environment configuration
  • Mock client available for development

⚠️ IMPORTANT

Pull Requests are only allowed to modify files in the /projects directory.
Any changes outside of this directory will be rejected automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants