Skip to content

Conversation

@kamalbuilds
Copy link

@kamalbuilds kamalbuilds commented Mar 17, 2025

Pull Request Description

Successfully integrated the Sega DEX into the sonic-agent-kit :

Changes Made

This PR adds the following changes:

  1. Creating a new directory structure for Sega DEX tools
  2. Implementing the core API client functionality:
    • Swap computation and transaction generation
    • Token price and information lookup
    • Pool information retrieval
    • Leaderboard and statistics access
    • Faucet interaction for testnet/devnet
  3. Adding corresponding type definitions
  4. Extending the SonicAgentKit class with Sega DEX methods
  5. Creating comprehensive documentation with examples

Features Added:

  1. Swap Computation: Calculate swaps with flexible parameters
  2. Smart Routing: Find optimal swap routes for better rates
  3. Transaction Generation: Generate ready-to-sign swap transactions
  4. Token Information: Access price data and token metadata
  5. Pool Information: Access detailed pool data and statistics
  6. User Statistics: Get volume and activity data for wallets
  7. Leaderboard: View top users and your relative ranking
  8. Faucet Integration: Request testnet tokens for development

Implementation Details

New Files Created:

  1. src/tools/sega/swap_compute.ts - API functions for computing swaps
  2. src/tools/sega/swap_transaction.ts - API functions for generating swap transactions
  3. src/tools/sega/get_token_price.ts - API functions for token price and information
  4. src/tools/sega/get_pool_info.ts - API functions for pool information
  5. src/tools/sega/get_stats.ts - API functions for leaderboard and statistics
  6. src/tools/sega/index.ts - Export file for Sega DEX tools
  7. docs/examples/sega-dex-examples.md - Documentation with usage examples

Updated Files:

  1. src/tools/index.ts - Added export for Sega DEX tools
  2. src/agent/index.ts - Added Sega DEX methods to SonicAgentKit class
  3. src/types/index.ts - Added Sega DEX type definitions

Transaction executed by agent

Example transaction:

Prompt Used

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

@kamalbuilds
Copy link
Author

@thearyanag please review

@thearyanag
Copy link
Member

hey @kamalbuilds —— can you also include files under langchain folder

https://github.com/sendaifun/sonic-agent-kit/tree/main/src/langchain

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.

2 participants