Adding Custom Actions
Learn how to extend the Okto Eliza Plugin with your own custom actions
The Okto Eliza Plugin provides core blockchain functionalities through its built-in actions. However, you can create your own plugins with custom actions that leverage these core functionalities to build more complex features.
Why Create Custom Actions?
Custom actions allow you to:
- Build complex multi-step workflows
- Add business-specific logic and validations
- Create specialized user experiences
- Integrate with external services and APIs
Here are some examples of what you can build with custom actions:
Use Case | Description | Implementation Example |
---|---|---|
Trading Bot | Automated trading based on market conditions | Combine OKTO_GET_TOKENS for price monitoring with OKTO_SWAP for execution |
Portfolio Rebalancer | Maintain target portfolio allocations | Use OKTO_GET_PORTFOLIO to check balances and OKTO_TRANSFER to rebalance |
DeFi Yield Optimizer | Automate yield farming strategies | Chain multiple OKTO_SWAP actions to move funds between protocols |
Cross-chain Bridge | Simplify asset bridging across networks | Coordinate OKTO_TRANSFER actions across different chains |
Social Trading | Copy trading with social features | Monitor successful traders and replicate their OKTO_SWAP transactions |
Getting Started with Custom Actions
This guide will show you how to create a custom plugin and integrate it with your Eliza project.
Create Plugin Entry Point
Create your plugin class that implements the Plugin interface:
Create Custom Action
Define your action with validation and handler logic:
Run Your Project
Start your Eliza agent with the custom plugin:
Your custom action will now be available through the Eliza agent's natural language interface.
Need help or have questions? Join our Discord community for support and discussions!