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: Add Solana liquid staking support #1435

Conversation

FWangZil
Copy link
Contributor

Add the ability of liquid staking to the current elizaos solana plugin.

  • It can build the desired staking requests for end-users, eliminating the complexity of front-end development and the need for users to switch between multiple platforms to compare APYs and select staking protocols.
  • Currently supports five protocols: "jito", "blaze", "jpool", "marinade", "marginfi", and is capable of expanding to support more protocols.

Relates to:

Issue #1434

Risks

  • There are no risks. An independent new Solana feature module has been introduced without modifying the code of other parts.

Background

  • There are some distinctive liquid staking solutions on Solana. However, users or developers need to provide a specific APP for users to conduct staking.
  • Liquid Staking Action aims to enable users to interact with the Agent through natural language. The Eliza Agent will build transactions for users. The front-end only needs to integrate a Solana wallet to support multiple staking protocols, eliminating the need to code and integrate the specific logic of different staking protocols.

What does this PR do?

  • When the user specifies a liquid staking protocol, build the corresponding transaction (base58 encoded) for the user.
  • When the user does not specify a specific protocol, based on the APY and TVL data of multiple protocols provided by the StakeProtocolProvider, use the designated LLM to optimize the staking protocol for the user and then build the corresponding transaction.

What kind of change is this?

Features (non-breaking change which adds functionality)

Documentation changes needed?

  • No

Testing

Where should a reviewer start?

  • packages/plugin-solana/src/actions/liquidStake.ts

Detailed testing steps

  1. Enable @elizaos/plugin-solana in the character.
  2. Interact with the Agent, for example: “My address is HqvTPqS2FaB2fQ7mxqZHQHz6H28o1u2Z9fRH5No8JN2W and I want to stake 0.01 SOL”.
  3. Obtain the response (the constructed staking transaction).

@monilpat monilpat changed the base branch from main to develop December 24, 2024 19:18
@twilwa twilwa changed the title feat(solana): Add liquid staking support feat: Add Solana liquid staking support Dec 25, 2024
@FWangZil FWangZil closed this Dec 25, 2024
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.

1 participant