Skip to content

feat: Add Solana liquid staking support#3

Open
FWangZil wants to merge 1 commit intoelizaos-plugins:mainfrom
stafiprotocol:2-add-liquid-staking-solana-enhancement
Open

feat: Add Solana liquid staking support#3
FWangZil wants to merge 1 commit intoelizaos-plugins:mainfrom
stafiprotocol:2-add-liquid-staking-solana-enhancement

Conversation

@FWangZil
Copy link

@FWangZil FWangZil commented Feb 24, 2025

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 #2
elizaOS PR elizaOS/eliza#1461

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.
  • The StakeProtocolProvider uses the Solana LST data provider open-sourced by stafiprotocol to provide data support. You can choose to use the default Stafi API or deploy it yourself.

What kind of change is this?

Features (non-breaking change which adds functionality)

Documentation changes needed?

  • No

Testing

Where should a reviewer start?

  • 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).

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