Commit 4913860
authored
Add more defillama endpoints (#63)
* fix: Remove is enabled check for raw data requests
- Leave enabled check only for llm agent usage
- Raw data tool will be enabled if a corresponding api key has been provided in env
* feat: Enhance DefiLlamaTool for multi-token price retrieval and historical data
- Introduced support for fetching prices of multiple tokens in a single request.
- Added a new method for retrieving historical token prices based on a specified timestamp.
- Updated schemas to validate input parameters for both current and historical price requests.
- Improved error handling to provide detailed feedback for low confidence price data.
- Expanded unit tests to cover new functionalities, including multi-token and historical price fetching.
* refactor: Update DefiLlamaTool schemas and parsing logic
- Removed historical price response schema in favor of a unified price response schema.
- Enhanced token identifier description to include native token format.
- Updated parsing logic to utilize the new schema for historical price retrieval.
- Simplified type inference in the parseResult method to focus solely on the price response schema.
* chore: Update .dockerignore and .gitignore to include .cursor
* feat: Add TimestampConverterTool for timestamp conversions
- Introduced TimestampConverterTool to convert between ISO strings and numeric timestamps (milliseconds or seconds).
- Updated ToolName enum to include TIMESTAMP_CONVERTER.
- Registered the new tool in availableTools and updated specialtyDomains to include it.
- Added comprehensive unit tests to validate conversion functionality and error handling.
* feat: Introduce CalculatorTool for arithmetic operations
- Added CalculatorTool to perform various arithmetic operations including addition, subtraction, multiplication, division, power, square root, and percentage calculations.
- Updated ToolName enum to include CALCULATOR.
- Registered the new tool in availableTools for easy access.
- Implemented comprehensive unit tests to validate functionality and error handling for all operations.
* feat: Add Utility domain for general-purpose tools
- Introduced a new domain, UTILITY, to encompass general-purpose utility tools.
- Added capabilities for mathematical calculations, time conversions, and data formatting.
- Registered tools including Calculator and TimestampConverter under the new domain, enhancing the toolset for common operations.
* fix: Update default search width parameter in DefiLlamaTool
- Changed the default value of the SearchWidthParamSchema from "4h" to "6h".
- Enhanced the description to clarify accepted candle notation and provide examples for better user understanding.
* feat: Add get_token_price_chart tool to DefiLlamaTool
- Introduced a new tool for fetching token price charts from DefiLlama, supporting multiple tokens and customizable parameters.
- Enhanced schemas to validate input for the new chart tool, including options for start and end timestamps, span, period, and search width.
- Implemented error handling for low confidence price data and API/network errors.
- Expanded unit tests to cover various scenarios for the new tool, ensuring robust functionality and error management.
* feat: Add get_token_price_percentage_change tool to DefiLlamaTool
- Introduced a new tool for fetching percentage changes in token prices over specified time periods.
- Enhanced schemas to validate input parameters, including coins, timestamp, lookForward, and period.
- Implemented error handling for API/network errors and low confidence data.
- Updated unit tests to cover various scenarios for the new percentage change tool, ensuring robust functionality and error management.1 parent 3129ca1 commit 4913860
File tree
11 files changed
+1551
-77
lines changed- src
- registry
- tools
- __tests__
11 files changed
+1551
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
75 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
0 commit comments