60 Commits

Author SHA1 Message Date
Damjan
925d0cf82b Merge remote-tracking branch 'sak/main' 2025-01-18 09:55:55 +01:00
aryan
d8c67311a5 Add Voltr check balance, deposit and withdraw strategy (#128)
# Pull Request Description

## Related Issue
Fixes # (issue number)

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- Query Voltr vault and strategies balances
- Withdraw from Voltr strategies
- Deposit into Voltr strategies
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- utilises Voltr's SDK `@voltr/sdk` to instantiate a `VoltrClient`  
- find and fetch relevant accounts to create instructions using
`VoltrClient`

## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction:
https://solana.fm/tx/GnUd38TMhtBYNv29nNAyESEWLwjHhUW6hraNrPE3RTF6LtdqNtnoBBqEKptT5JaWqv6TiFp6MeooUa9Rt7vMAu9?cluster=mainnet-alpha
Demo: https://x.com/voltrxyz/status/1875204418465059189

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
Tested on autonomous mode.
``` 
async function runAutonomousMode(agent: any, config: any, interval = 10) {
  console.log("Starting autonomous mode...");

  let iterations = 0;

  while (true) {
    try {
      const evenThought =
        "1. Get the total amount and amount for each strategy of a Voltr vault: 3ab3KVY9GbDbUUbRnYNSBDQqABTDup7HmdgADHGpB8Bq. " +
        "2. Take note of the strategies id with the their respective amount. " +
        "3. Calculate the sum of all strategy amounts. " +
        "4. Subtract that sum from the vault total to get the excess amount. " +
        "5. Indicate the excess amount and the strategy id with the lowest amount.";

      const oddThought =
        "Using the latest excess amount, if it is 0 then do nothing. " +
        "Else if it is more than 0, deposit the excess amount into the lowest strategy and vault: 3ab3KVY9GbDbUUbRnYNSBDQqABTDup7HmdgADHGpB8Bq.";

      const thought = iterations % 2 === 0 ? evenThought : oddThought;

      const stream = await agent.stream(
        { messages: [new HumanMessage(thought)] },
        config,
      );

      for await (const chunk of stream) {
        if ("agent" in chunk) {
          for (const message of chunk.agent.messages) {
            console.log(message.content);
          }
        } else if ("tools" in chunk) {
          for (const message of chunk.tools.messages) {
            console.log(message.content);
          }
        }
        console.log("-------------------");
      }

      iterations++;

      await new Promise((resolve) => setTimeout(resolve, interval * 1000));
    } catch (error) {
      if (error instanceof Error) {
        console.error("Error:", error.message);
      }
      process.exit(1);
    }
  }
}
```

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
2025-01-18 01:14:34 +05:30
biccsdev
6bbb6d489c implemented nft creation with LP 2025-01-17 12:14:47 -06:00
Damjan
7df99ae897 Update README.md 2025-01-16 16:51:10 +01:00
biccsdev
dc520dff08 Merge branch 'main' of github.com:3-land/solana-agent-kit into main 2025-01-15 11:49:29 -06:00
jakeyvee
2971bdaef4 feat: include Voltr into readme 2025-01-15 21:21:13 +08:00
michaelessiet
fd95ac8682 chore: drift integration docs 2025-01-14 21:07:24 +01:00
michaelessiet
2f05af13cb fix: drift vault deposits and withdrawals 2025-01-14 20:33:18 +01:00
biccsdev
23ca0b0fba refactoring for standarization 2025-01-07 15:01:21 -06:00
Scriptscrypt
d12f23451f Feat: README w docs 2025-01-07 20:13:30 +05:30
aryan
afcf0ad9c1 Merge branch 'main' into feature/reclaim_rent 2025-01-07 18:58:59 +05:30
Victor Torres
7b4c4ffc2c Update README.md 2025-01-06 21:40:46 -06:00
biccsdev
ae7878cca1 finished touches on testing file 2025-01-06 21:39:31 -06:00
biccsdev
e680ddd4f3 3land tools implementation 2025-01-06 21:37:08 -06:00
Thrishank
874cc95195 Merge branch 'main' into feature/reclaim_rent 2025-01-05 12:45:48 +05:30
Arihant Bansal
15a5a6b08d merge and docs 2025-01-04 23:41:47 +05:30
Arihant Bansal
8bd0b462d2 feat: update to hermes v2 2025-01-04 23:37:51 +05:30
thrishank
8136bde20f Add docs 2025-01-04 23:34:19 +05:30
aryan
b3a15fb019 update FUNDING info 2025-01-04 15:19:44 +05:30
Orex
a68f26d009 Add Adrena Protocol Open/Close PERP trade support 2025-01-04 10:26:12 +04:00
JoshuaSum
058877b4d5 Merge remote-tracking branch 'upstream/main' 2025-01-03 14:35:16 -08:00
JoshuaSum
1a34e9a4e5 Add Solayer staking through blinks 2025-01-01 17:41:46 -08:00
Michael Essiet
9b934d636f Merge branch 'main' into feature/vercel-ai-sdk 2025-01-01 04:11:57 +01:00
DonDuala
3d50b4bc3d Merge branch 'main' into manifest 2024-12-31 09:07:47 -04:00
krill
df386a8cbd 📝 fix typos 2024-12-31 12:02:55 +09:00
Michael Essiet
9b9bdbaade Merge branch 'main' into feature/vercel-ai-sdk 2024-12-30 12:26:08 +01:00
DonDuala
4ae9051957 Add create manifest market support 2024-12-29 19:29:16 -04:00
Deepak
0138f7de89 Updated README.md with contributors and star graph 2024-12-30 02:29:51 +05:30
aryan
984f0390b4 feat: replit 2024-12-29 22:38:10 +05:30
Michael Essiet
00c9e3d616 Merge branch 'main' into feature/vercel-ai-sdk 2024-12-28 21:05:45 +01:00
Deepak
041953c1d5 Added documentation 2024-12-27 17:45:28 +05:30
michaelessiet
3439308f62 chore: add docs 2024-12-26 16:26:55 +01:00
ARYAN
8315576c06 Update README.md 2024-12-25 21:59:43 +05:30
YASH AGARWAL
8f3c7e3f6d Update README.md 2024-12-25 21:47:57 +05:30
YASH AGARWAL
273d4fa36d Update README.md 2024-12-25 21:37:52 +05:30
Arihant Bansal
ad1e8e3f2a fix 2024-12-23 11:52:28 +05:30
Arihant Bansal
528faceafe fixes 2024-12-23 11:50:14 +05:30
aryan
06d4311ea9 Merge branch 'main' into readme-fix 2024-12-23 11:30:54 +05:30
Zhe
6dc0478e2c feat: add pyth example to readme 2024-12-22 19:29:11 +00:00
Arihant Bansal
6d4f468fb3 fix 2024-12-22 01:30:29 +05:30
Arihant Bansal
ed689f5efd fixes and renames 2024-12-22 01:20:29 +05:30
Arihant Bansal
f84a618c6c feat: fix readme issues, and add types 2024-12-22 00:47:25 +05:30
aryan
16a363ac14 formatting 2024-12-21 01:26:40 +05:30
YASH AGARWAL
fffa757719 Update README (copy changes).md 2024-12-21 01:02:30 +05:30
aryan
0ad136fa3a fix: license 2024-12-21 00:03:22 +05:30
aryan
60cc0a07b1 feat: readme 2024-12-21 00:01:21 +05:30
Swenschaeferjohann
8865c4a3a8 add example in readme.md 2024-12-20 06:30:58 +00:00
Blockiosaurus
1b7f657734 Merging in main. 2024-12-18 12:41:44 -05:00
metasal
fc9d551eb2 improved the example new agent declartion 2024-12-16 15:11:15 +11:00
Blockiosaurus
8faf8983b0 Updating NFTs to Core and adding token metadata. 2024-12-15 19:26:15 -05:00