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 Mayan SDK tool #241

Merged
merged 7 commits into from
Jan 29, 2025
Merged

Conversation

zoli
Copy link
Contributor

@zoli zoli commented Jan 26, 2025

Pull Request Description

enables cross-chain swaps SVM <-> EVM through Mayan SDK

Related Issue

Changes Made

This PR adds the following changes:

  • new cross-chain swap tool
  • added new ETHEREUM_PRIVATE_KEY to config object for EVM to SVM swaps

Implementation Details

Using Mayan SDK now the agent can swap cross-chain SVM to SVM or SVM to EVM and vice versa.

Transaction executed by agent

Example transaction:
Multiple transactions (you can see all of them in Mayan Explorer)

Prompt Used

swap 0.02 0x0000000000000000000000000000000000000000 from solana to 0x0000000000000000000000000000000000000000 polygon destination 0x0cae42c0ce52e6e64c1e384ff98e686c6ee225f0
swap 0.02 0x0000000000000000000000000000000000000000 from solana to HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3 solana destination 4ZgCP2idpqrxuQNfsjakJEm9nFyZ2xnT4CrDPKPULJPk

Additional Notes

Checklist

  • I have tested these changes locally
  • I have updated the documentation
  • I have added a transaction link
  • I have added the prompt used to test it

zoli added 2 commits January 26, 2025 11:22
enables cross-chain swaps SVM <-> EVM
* main:
  chore: pkg + docs
  priority fees added
  feat: Adds Allora Network price inference tool
@michaelessiet
Copy link
Collaborator

Hey @zoli please can you make it so that both token symbols and token addresses can be accepted in the prompt. e.g bridge 0.1 SOL on solana to USDC on Polygon with this wallet as it's destination 0xasdf

@zoli
Copy link
Contributor Author

zoli commented Jan 26, 2025

Hey @zoli please can you make it so that both token symbols and token addresses can be accepted in the prompt. e.g bridge 0.1 SOL on solana to USDC on Polygon with this wallet as it's destination 0xasdf

Sure, I was a bit afraid that it might happen a mistake in recognizing the token.
It would be nice if there was a sort of quote confirmation process to, It seems currently there isn't anyway to break a prompt into more than one step.

@michaelessiet
Copy link
Collaborator

Hey @zoli please can you make it so that both token symbols and token addresses can be accepted in the prompt. e.g bridge 0.1 SOL on solana to USDC on Polygon with this wallet as it's destination 0xasdf

Sure, I was a bit afraid that it might happen a mistake in recognizing the token. It would be nice if there was a sort of quote confirmation process to, It seems currently there isn't anyway to break a prompt into more than one step.

Yes, currently there is no way to break a prompt into multiple steps but having it be an option of either of the 2 would be nice. The developer using the kit could then choose whether they want to use token addresses or token names, and the end user if they're using the kit as is and parsing the actions to their agent could choose to use symbols as they're more memorable and a better user experience.

zoli added 2 commits January 28, 2025 19:33
* main:
  chore: remove unused import
  Update README.md: change 15+ actions to 60+ actions
  do not log kp
  fix: spot position balance signs
  fix: spot position balance type and signs
  fix: overall drift account usd balance
  fix: spot position balance type
  fix: perp position precision
  fix: drift user account balances and position amounts
@zoli zoli marked this pull request as ready for review January 28, 2025 16:04
@zoli
Copy link
Contributor Author

zoli commented Jan 28, 2025

@michaelessiet I've implemented using token symbol instead of contract address but one thing to note is most of the times the ai (in my case gpt4-4o-mini) before passing the symbol to the agent action replaces the symbol with contract address and mostly the address is wrong. I mostly specified in my prompts to not replace token symbols and then it worked fine.

Other than the above I think this is ready to get merged.

@michaelessiet
Copy link
Collaborator

michaelessiet commented Jan 28, 2025

Sweet. Please can you remove anything EVM related as this will bloat the SDK with unnecessary dependencies. Solana Agent Kit only wants to support Solana on-chain actions so there is no need to implement EVM -> Solana bridging, only Solana -> EVM or Solana -> Solana are necessary

@zoli
Copy link
Contributor Author

zoli commented Jan 28, 2025

Done.

@thearyanag thearyanag self-requested a review January 29, 2025 06:39
@thearyanag
Copy link
Member

@michaelessiet I've implemented using token symbol instead of contract address but one thing to note is most of the times the ai (in my case gpt4-4o-mini) before passing the symbol to the agent action replaces the symbol with contract address and mostly the address is wrong. I mostly specified in my prompts to not replace token symbols and then it worked fine.

Other than the above I think this is ready to get merged.

hey @zoli, had to reverse the previous commit, we want the evm to svm bridging as discussed internally.

on times where the ai mis-interprets it's mostly due to the tool description

zoli added 2 commits January 29, 2025 11:42
* main:
  fix: convert position mint to pub key
  chore: orca actions added
@zoli
Copy link
Contributor Author

zoli commented Jan 29, 2025

Done all requested changes.

@thearyanag thearyanag merged commit 76e7400 into sendaifun:main Jan 29, 2025
2 checks passed
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.

3 participants