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

feat: Adding plugin for B² Network #2010

Merged
merged 43 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
17d06f1
feat: b2-network plugin
threewebcode Jan 8, 2025
d1b830f
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 8, 2025
92a6fa5
docs:update readme and package description
threewebcode Jan 8, 2025
2afe606
docs: update readme and package description
threewebcode Jan 8, 2025
b72151c
fix: solve build error
threewebcode Jan 8, 2025
cdb5b01
modify
Jan 8, 2025
195c57b
modify
Jan 8, 2025
de31440
feat: transfer action
threewebcode Jan 8, 2025
8c6aa4d
Merge pull request #1 from threewebcode/develop
threewebcode Jan 8, 2025
3b9006c
modify b2 plugin
Jan 8, 2025
8ebf789
modify b2 plugin
Jan 8, 2025
f5b3b56
modify README.md
Jan 8, 2025
b0282ca
docs: update readme
threewebcode Jan 8, 2025
2970514
Merge pull request #2 from threewebcode/develop
threewebcode Jan 8, 2025
615a299
chore: update env file
threewebcode Jan 8, 2025
1a6fdc0
chore: update env file
threewebcode Jan 8, 2025
0d9cf53
modify b2 plugin
Jan 8, 2025
ed3fa5a
Merge branch 'develop' of github.com:b2network/eliza into develop
Jan 8, 2025
5386f3d
chore: merge env file
threewebcode Jan 8, 2025
972cc5d
modify b2 plugin
Jan 8, 2025
d2cbfa5
Merge branch 'develop' of github.com:b2network/eliza into develop
Jan 8, 2025
13e1abc
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 8, 2025
ea2d523
Merge branch 'elizaOS:develop' into develop
goalongway Jan 8, 2025
2a80ff6
Merge branch 'develop' into develop
goalongway Jan 8, 2025
5be7eb4
modify b2 plugin
Jan 8, 2025
900ec3e
Merge branch 'develop' into develop
goalongway Jan 9, 2025
2333d56
merge latest env file
threewebcode Jan 9, 2025
b0e9d43
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 10, 2025
065160d
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 10, 2025
fc0dc5c
modify b2 plugin
goalongway Jan 11, 2025
a265dd8
Merge branch 'elizaOS:develop' into develop
goalongway Jan 11, 2025
6cb190d
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 11, 2025
cc28c48
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 12, 2025
f8495b1
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 13, 2025
46eb7f1
modify b2 plugin
goalongway Jan 13, 2025
2cf397f
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 13, 2025
396bb8c
modify b2 plugin
goalongway Jan 13, 2025
3a2cecc
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 13, 2025
a80c4fd
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 13, 2025
daf7ac9
fix: default empty value and resolve type error
threewebcode Jan 14, 2025
8e5c04e
Merge branch 'elizaOS:develop' into develop
threewebcode Jan 14, 2025
2cfc56d
chore: merge latest changes.
threewebcode Jan 14, 2025
7a033d7
Merge pull request #3 from threewebcode/develop
threewebcode Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modify
  • Loading branch information
goalongway committed Jan 8, 2025
commit cdb5b01fa5c9f4125f5804481e782d44fa1e590c
254 changes: 234 additions & 20 deletions packages/plugin-b2/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,253 @@
# Sample Plugin for Eliza
# @elizaos/plugin-b2

The Sample Plugin for Eliza extends the functionality of the Eliza platform by providing additional actions, providers, evaluators, and more. This plugin is designed to be easily extendable and customizable to fit various use cases.
A plugin for interacting with the B2-Network within the ElizaOS ecosystem.

## Description

The Sample Plugin offers a set of features that can be integrated into the Eliza platform to enhance its capabilities. Below is a high-level overview of the different components available in this plugin.
The Avalanche plugin enables comprehensive DeFi operations on the Avalanche network, including token transfers, YAK swaps, yield strategy management, and token creation via Token Mill.

## Actions
## Installation

- **createResourceAction**: This action enables the creation and management of generic resources. It can be customized to handle different types of resources and integrate with various data sources.
```bash
pnpm install @elizaos/plugin-avalanche
```

## Configuration

The plugin requires the following environment variable:

```typescript
AVALANCHE_PRIVATE_KEY=<Your Avalanche private key>
```

## Features

### 1. Token Transfers

- Send native AVAX and ERC20 tokens
- Support for multiple token standards
- Built-in address validation

### 2. YAK Swaps

- Decentralized token swaps
- Automatic best path finding
- Slippage protection (default: 0.2%)
- Support for all major tokens

### 3. Yield Strategies

- Deposit tokens into yield-generating strategies
- Support for multiple strategies including:
- YAK staking
- USDC Benqi
- gmYAK Token Mill
- PRINCESS staking
- JOE staking

### 4. Token Mill

- Create new tokens
- Configure custom tokenomics
- Automatic market creation

## Supported Tokens

```typescript
const TOKENS = {
AVAX: "0x0000000000000000000000000000000000000000",
WAVAX: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
YAK: "0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7",
gmYAK: "0x3A30784c1af928CdFce678eE49370220aA716DC3",
USDC: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
// ... and more
};
```

## Usage Examples

### Token Transfer

```typescript
// Send AVAX
"Send 10 AVAX to 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";

// Send ERC20
"Transfer 100 USDC to [address]";
```

### YAK Swap

```typescript
// Swap tokens
"Swap 1 AVAX for USDC";
"Swap 10 USDC for gmYAK";
```

### Yield Strategy

```typescript
// Deposit into strategies
"Deposit 1 USDC into the strategy";
"Deposit 10 gmYAK to earn yield";
```

### Token Creation

```typescript
// Create new token
"Create a new memecoin called 'Test Token' with the symbol 'TEST'";
```

## Providers

- **sampleProvider**: This provider offers a mechanism to supply data or services to the plugin. It can be extended to include additional providers as needed.
### 1. Wallet Provider

- Displays wallet balances
- Shows tokens in yield strategies
- Real-time balance updates

### 2. Strategies Provider

- Lists available yield strategies
- Shows deposit token requirements

### 3. Tokens Provider

- Lists supported tokens
- Shows token addresses

## Development

1. Clone the repository
2. Install dependencies:

```bash
pnpm install
```

3. Build the plugin:

```bash
pnpm run build
```

4. Run linting:

```bash
pnpm run lint
```

## Dependencies

- viem: ^2.21.49
- @elizaos/core: workspace:\*

## Future Enhancements

1. **Advanced DeFi Operations**

- Multi-hop yield strategies
- Auto-compounding features
- Yield optimization algorithms
- Risk assessment tools
- Portfolio rebalancing automation
- Cross-chain yield farming

2. **Enhanced Token Management**

- Batch token operations
- Advanced token creation templates
- Token migration tools
- Automated token listing
- Token analytics dashboard
- Custom tokenomics implementation

3. **YAK Protocol Integration**

- Advanced routing algorithms
- MEV protection features
- Gas optimization strategies
- Liquidity analysis tools
- Price impact predictions
- Custom trading strategies

4. **Benqi Protocol Features**

- Collateral optimization
- Liquidation protection
- Interest rate monitoring
- Position management tools
- Risk assessment dashboard
- Auto-repayment features

5. **Token Mill Improvements**

- Advanced token customization
- Automated market making
- Token distribution tools
- Vesting schedule management
- Governance token features
- Token upgrade mechanisms

6. **Security Enhancements**

- Transaction simulation
- Smart contract auditing tools
- Real-time monitoring
- Automated safety checks
- Emergency shutdown features
- Multi-signature support

7. **Developer Tools**

- Enhanced debugging capabilities
- Testing framework improvements
- Documentation generator
- CLI tools for common operations
- Integration templates
- Performance monitoring

8. **Analytics and Reporting**
- Portfolio tracking
- Performance metrics
- Gas usage optimization
- Transaction history analysis
- Yield comparison tools
- Risk assessment reports

We welcome community feedback and contributions to help prioritize these enhancements.

## Evaluators
## Contributing

- **sampleEvaluator**: This evaluator provides a way to assess or analyze data within the plugin. It can be extended to include additional evaluators as needed.
Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.

## Services
## Credits

- **[ServiceName]**: Description of the service and its functionality. This can be extended to include additional services as needed.
This plugin integrates with and builds upon several key technologies:

## Clients
- [Avalanche](https://www.avax.network/): High-performance blockchain platform
- [avalanchejs](https://github.com/ava-labs/avalanchejs): Official Avalanche JavaScript library
- [YAK Protocol](https://yak.exchange/): Decentralized exchange aggregator
- [Benqi](https://benqi.fi/): Lending and borrowing protocol
- [Token Mill](https://tokenmill.xyz/): Token creation platform

- **[ClientName]**: Description of the client and its functionality. This can be extended to include additional clients as needed.
Special thanks to:

## How to Extend
- The Ava Labs team for developing Avalanche
- The YAK Protocol development team
- The Benqi protocol developers
- The Token Mill platform team
- The Avalanche Developer community
- The Eliza community for their contributions and feedback

To extend the Sample Plugin, you can add new actions, providers, evaluators, services, and clients by following the structure provided in the plugin. Each component can be customized to fit your specific requirements.
For more information about Avalanche capabilities:

1. **Actions**: Add new actions by defining them in the `actions` array.
2. **Providers**: Add new providers by defining them in the `providers` array.
3. **Evaluators**: Add new evaluators by defining them in the `evaluators` array.
4. **Services**: Add new services by defining them in the `services` array.
5. **Clients**: Add new clients by defining them in the `clients` array.
- [Avalanche Documentation](https://docs.avax.network/)
- [YAK Protocol Docs](https://yak.exchange/docs)
- [Benqi Documentation](https://docs.benqi.fi/)
- [Token Mill Guide](https://docs.tokenmill.xyz/)

## License

For more detailed information on how to extend the plugin, refer to the documentation provided in the Eliza platform.
This plugin is part of the Eliza project. See the main project repository for license information.