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 SPL-Governance Treasury Operations #184

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rudrakc
Copy link

@Rudrakc Rudrakc commented Jan 11, 2025

This PR adds SPL Governance program support to the Solana Agent Kit, enabling programmatic DAO treasury monitoring and governance management.

Features Added:

  1. Monitor Treasury Balances:

    • Fetch SOL and SPL token balances for governance treasuries.
    • Integrated as monitorTreasuryBalances in SolanaAgentKit.
  2. Propose Transactions:

    • Added proposeTransaction for creating governance proposals.
  3. Execute Approved Actions:

    • Added executeApprovedTreasuryActions for executing transactions from proposals.
  4. LangChain Tools:

    • Integrated tools for all new functionalities.

Files Added/Modified:

  • Added functions to SolanaAgentKit (monitorTreasuryBalances, proposeTransaction, executeApprovedTreasuryActions).
  • Created corresponding tools in langchain/index.ts.

How It Works:

  1. Monitor Treasury Balances:
  • Fetches all treasuries for a governance account.
  • Retrieves SOL and SPL token balances for each treasury and structures them into a user-friendly format.
  1. Propose Transactions:
  • Creates a governance proposal with multiple configurable parameters (e.g., proposal name, options, vote type).
  • Supports additional metadata like description links.
  1. Execute Treasury Actions:
  • Executes transactions tied to approved governance proposals.
  • Handles execution via SPL Governance’s withExecuteTransaction helper.

Linked Issues:

Closes #166

---.
This pull request was created for https://app.gib.work/bounties/9e595117-5d86-42a4-b695-35ead834a4af in an attempt to solve a bounty #166 . Payment for the bounty is immediately sent to the contributor after merge.

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.

Treasury | SPL Governance Integration for Solana Agent Kit | realms.today
1 participant