Commit Graph

344 Commits

Author SHA1 Message Date
aryan
89aed5452c Merge branch 'main' into quangkeu95/main 2025-01-18 01:49:33 +05:30
aryan
d67747b70d Merge branch 'main' into feat/drift-tool 2025-01-18 01:34:39 +05:30
aryan
deb75d54c1 Merge branch 'main' into deposit_and_withdraw_with_lulo 2025-01-18 01:19:10 +05:30
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
michaelessiet
e4fa501c52 chore: add minimum compute price to constants 2025-01-17 17:23:15 +01:00
michaelessiet
0c840d9bcb feat: add more drift actions 2025-01-17 17:12:34 +01:00
quangkeu95
15172ee8c6 fix: Allow input normal token amounts 2025-01-17 15:20:57 +07:00
michaelessiet
79fe5b0cb4 fix: bugs noticed during testing 2025-01-16 21:33:07 +01:00
michaelessiet
97e9673089 feat: add more drift actions 2025-01-16 19:39:47 +01:00
michaelessiet
00f033ccf0 merge: main 2025-01-16 15:50:24 +01:00
jakeyvee
7cf2e80971 chore: resolve merge conflights 2025-01-16 15:21:20 +08:00
biccsdev
dc520dff08 Merge branch 'main' of github.com:3-land/solana-agent-kit into main 2025-01-15 11:49:29 -06:00
michaelessiet
ccbdc27f63 feat: add drift tools to langchain 2025-01-15 17:37:54 +01:00
michaelessiet
484a64de85 fix: drift user account info fetching 2025-01-15 14:52:13 +01:00
jakeyvee
e3c93222de chore: export voltr folder instead of indiv files in tools 2025-01-15 21:28:09 +08:00
jakeyvee
04cd1b2e28 chore: merge Voltr changes into remote branch 2025-01-15 21:18:14 +08:00
michaelessiet
df01cc3267 merge: main 2025-01-15 13:28:58 +01:00
jakeyvee
c71f2159fd fix: changes for Voltr vault program upgrade 2025-01-15 18:15:35 +08:00
aryan
a65463a77b chore: docs + lint 2025-01-15 02:55:30 +05:30
michaelessiet
2f05af13cb fix: drift vault deposits and withdrawals 2025-01-14 20:33:18 +01:00
michaelessiet
4d50d2f260 fix: drift vault experience 2025-01-14 15:08:18 +01:00
michaelessiet
f0d84f6924 feat: add drift functions to agent class 2025-01-14 12:43:28 +01:00
quangkeu95
0ef7fbf74f fix: Using sendTx function 2025-01-14 10:41:19 +07:00
quangkeu95
fb935b6809 chore: Remove comments 2025-01-14 08:02:56 +07:00
michaelessiet
69cfcd90d2 merge: main. Also removed eslint config from discord bot starter it was conflicting with global eslint config 2025-01-13 21:42:22 +01:00
michaelessiet
60adc8d8c5 feat + fix: add action to get user drift account info and fix deposit, borrow, lend and withdraw on drift 2025-01-13 21:17:53 +01:00
quangkeu95
12a05f4b05 chore: Merge sendai main 2025-01-13 23:24:15 +07:00
quangkeu95
1fcf818922 fix: Remove Meteora alpha vault tool 2025-01-13 23:20:29 +07:00
shivaji43
20360ba523 fix: remove unncesary import 2025-01-13 17:43:32 +05:30
shivaji43
9d1623ed7e added actions for tools 2025-01-13 17:37:20 +05:30
shivaji43
40193b75e8 fix:deleted unncessary files 2025-01-13 17:37:05 +05:30
shivaji43
71bfbc6bd8 feat:added spl token support to priority fee transaction 2025-01-13 17:37:05 +05:30
shivaji43
be3f158aaa fix : able to send transaction with priority fee 2025-01-13 17:37:05 +05:30
shivaji43
53ee654202 feat:added webhooks for live notifications 2025-01-13 17:37:05 +05:30
shivaji43
e09c6b5d0b fix:added solana tool in createSolanaTools 2025-01-13 17:37:04 +05:30
shivaji43
4a270c4a0d feat: send transaction with proiority fee 2025-01-13 17:37:04 +05:30
shivaji43
2de1a7365d added helius api key to config type 2025-01-13 17:37:04 +05:30
shivaji43
96608fd7a9 fix: removed unnecessary logs 2025-01-13 17:37:04 +05:30
shivaji43
418f55178a feat:parsing transactions and getting all Assets 2025-01-13 17:37:04 +05:30
shivaji43
58a9edd7e2 refactored code 2025-01-13 17:37:04 +05:30
quangkeu95
2f0695400f chore: Merge main 2025-01-13 12:11:00 +07:00
quangkeu95
4f72b557af fix: Update script to create meteora dlmm pool 2025-01-13 10:54:00 +07:00
quangkeu95
872427a44b --amend 2025-01-13 08:38:24 +07:00
quangkeu95
89b4bc05c7 fix: Parse float number to BN error 2025-01-13 08:37:58 +07:00
zhourunlai
33737f8bef lend and withdraw asset with lulo, not only usdc 2025-01-12 17:01:12 +08:00
Arihant Bansal
bb6d51471c feat: fix merge 2025-01-12 09:52:11 +05:30
michaelessiet
25f0f503cb feat: drift perp trade, account creation, withdraw, and deposit 2025-01-12 01:33:11 +01:00
Arihant Bansal
ba9f6a9423 feat: add rest of squads actions 2025-01-11 23:33:14 +05:30
Arihant Bansal
ea6430129b feat: add more squads actions 2025-01-11 23:24:58 +05:30