TradingFlow Aptos Smart Contract is a vault system designed specifically for the Aptos blockchain, allowing users to securely store and manage their digital assets, and enabling automated trading through integration with Hyperion DEX.
- Fund Management: Users can deposit and withdraw various tokens
- Bot Operations: Bots can perform operations on behalf of users
- Trading Signals: Users can send trading signals and execute trades on Hyperion DEX
- Event Logging: All operations are recorded with detailed events
The contract is written in Move language, optimized for the Aptos blockchain. Main components include:
- Vault Module: Core vault functionality
- Balance Manager: Tracks user funds
- Hyperion Integration: Interaction with Hyperion DEX
- Aptos CLI
- Move compiler
- An Aptos account
aptos move compile --named-addresses tradingflow_vault=<YOUR_ADDRESS>aptos move publish --named-addresses tradingflow_vault=<YOUR_ADDRESS>The project includes multiple scripts for easy interaction with the contract:
- init_vault.move: Initialize the vault
- deposit_coins.move: Deposit tokens
- withdraw_coins.move: Withdraw tokens
- trade_signal.move: Send trading signals
- admin_manage.move: Manage admin functions
- Create Balance Manager: Users need to create a balance manager for first-time use
- Deposit Tokens: Store tokens in the vault
- Withdraw Tokens: Retrieve tokens from the vault
- Send Trading Signals: Execute trades through Hyperion DEX
- Initialize Vault: Set up the vault system
- Manage Admin Capability: Control who can perform admin operations
- Withdraw on Behalf of Users: Extract tokens from user vaults
- Deposit on Behalf of Users: Add tokens to user vaults
The contract integrates with Hyperion DEX, supporting the following features:
- Exact Input Swap: Specify input amount and execute trades
- Trading Signal Records: Log all trading signals
The project includes a comprehensive test suite covering all major functionalities:
aptos move test --named-addresses tradingflow_vault=<YOUR_ADDRESS>- All critical operations have permission checks
- Comprehensive error code system for debugging
The system uses two main accounts:
- Admin Account: Responsible for initializing the vault and managing admin functions
- User Account: Used for depositing and withdrawing tokens, and sending trade signals
Contributions are welcome through issues and pull requests. For major changes, please open an issue first to discuss what you would like to change.
See the LICENSE file for details.