Skip to content

Commit fa676c3

Browse files
authored
Merge pull request #39 from pattern-tech/feat/adding-goldrush
Feat/adding goldrush
2 parents 4978250 + 1f89ed8 commit fa676c3

File tree

8 files changed

+202
-196
lines changed

8 files changed

+202
-196
lines changed

api/README.md

+88-15
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,68 @@ To install the required dependencies, run:
88

99
```sh
1010
cp .env.example .env
11+
cp config.json.example config.json
1112
pip install -r requirements.txt
1213
```
1314

14-
Note: Fill up the .env file according to your config
15-
16-
Check the services dependency and make sure all services are up with config provided in `.env` file
17-
- postgres
18-
- minio
19-
- qdrant
15+
Note: Fill up the .env and config.json file according to your config
16+
17+
### Configuration
18+
Configuration file is in `config.json`. Edit it according to your needs.
19+
20+
Notes:
21+
- Add your own tool services or use existing ones
22+
- Add provided agents. (on top of each service tool is an agent so the name of agent should be same as service name)
23+
- Choose the llm provider
24+
<table>
25+
<thead>
26+
<tr>
27+
<th>Supported Provider</th>
28+
<th>Recommended Model</th>
29+
</tr>
30+
</thead>
31+
<tbody>
32+
<tr>
33+
<td>openai</td>
34+
<td>gpt-4o-mini</td>
35+
</tr>
36+
<tr>
37+
<td>google</td>
38+
<td>gemini-2.0-flash</td>
39+
</tr>
40+
<tr>
41+
<td>together</td>
42+
<td>deepseek-ai/DeepSeek-R1-Distill-Llama-70B-free</td>
43+
</tr>
44+
<tr>
45+
<td>ollama</td>
46+
<td>llama3.3</td>
47+
</tr>
48+
<tr>
49+
<td>groq</td>
50+
<td>llama-3.3-70b-versatile</td>
51+
</tr>
52+
<tr>
53+
<td>firework</td>
54+
<td>accounts/fireworks/models/firefunction-v2</td>
55+
</tr>
56+
<tr>
57+
<td>huggingface</td>
58+
<td>meta-llama/Llama-3.3-70B-Instruct</td>
59+
</tr>
60+
</tbody>
61+
</table>
2062

2163
### Running the Application
2264

23-
#### Locally
65+
#### method 1) Locally
66+
67+
Check the services dependency and make sure all services are up with config provided in `.env` file
68+
69+
depend services:
70+
- postgres
2471

72+
##### Run main app
2573
If you have `make` installed on your machine, you can start the application using:
2674

2775
```sh
@@ -34,7 +82,7 @@ Otherwise, you can manually run it with:
3482
python3 -m uvicorn src.main:app --host 0.0.0.0 --reload
3583
```
3684

37-
#### Docker Compose
85+
#### method 2) Docker Compose
3886

3987
If you have docker compose installed, run:
4088

@@ -57,15 +105,40 @@ We support both Swagger and Scalar documentation:
57105

58106
## AI Features
59107

60-
### 1. Ethereum Blockchain Queries
108+
### 1. EtherScan Agent
109+
110+
Agent for handling Ethereum blockchain-related queries and tasks.:
111+
112+
- Get the current Unix timestamp
113+
- Convert a natural language date string into a Unix timestamp
114+
- Retrieve the source code of a smart contract
115+
- Retrieve the ABI of a smart contract
116+
- Retrieve the ABI of a specific event from a smart contract
117+
- Fetch events for a given smart contract event within a block range
118+
- Retrieve the latest Ethereum block number
119+
- Convert a Unix timestamp to the nearest Ethereum block number
120+
121+
### 2. Moralis Agent
122+
123+
Agent for handling Ethereum blockchain-related queries and tasks.:
124+
125+
- Get active chains for a wallet address across all chains
126+
- Get token balances for a specific wallet address and their prices in USD. (paginated)
127+
- Get the stats for a wallet address.
128+
- Retrieve the full transaction history of a specified wallet address, including sends, receives, token and NFT transfers and contract interactions.
129+
- Get the contents of a transaction by the given transaction hash.
130+
- Get ERC20 approvals for one or many wallet addresses and/or contract addresses, ordered by block number in descending order.
131+
132+
### 3. GoldRush Agent
61133

62-
This feature allows handling Ethereum blockchain-related queries and tasks, including:
134+
Agent for handling Ethereum blockchain-related queries and tasks.:
63135

64-
- Retrieving smart contract source code
65-
- Fetching contract ABIs (Application Binary Interface)
66-
- Getting contract events and their details
67-
- Querying contract transactions
68-
- Converting between timestamps and block numbers
136+
- Get activity across all chains for address
137+
- fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address
138+
- Fetch transactions for a given wallet address (paginated)
139+
- Fetch a summary of transactions (earliest and latest) for a given wallet address.
140+
- Fetch a single transaction including its decoded event logs
141+
- Fetch list of approvals across all token contracts categorized by spenders for a wallet’s assets
69142

70143
### 2. Web Search Integration
71144

api/config.json.sample

+13-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@
1010
"url": "https://api.covalenthq.com",
1111
"api_key": ""
1212
},
13+
{
14+
"name": "moralis",
15+
"url": "https://deep-index.moralis.io/api/v2",
16+
"api_key": ""
17+
},
18+
{
19+
"name": "eth_rpc",
20+
"url": "https://eth.llamarpc.com",
21+
"api_key": ""
22+
},
1323
{
1424
"name": "exa",
1525
"url": "https://api.exa.ai",
@@ -24,7 +34,7 @@
2434
"name": "tavily",
2535
"url": "https://api.tavily.com",
2636
"api_key": ""
27-
}
37+
},
2838
],
2939
"llm": {
3040
"provider": "openai",
@@ -37,6 +47,7 @@
3747
},
3848
"agents": [
3949
"etherscan",
40-
"goldrush"
50+
"goldrush",
51+
"moralis"
4152
]
4253
}

api/hello_copy/__init__.py

-17
This file was deleted.

api/hello_copy/main.py

-101
This file was deleted.

api/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ langchain-google-genai==2.0.7
3030
langchain-google-vertexai==2.0.9
3131
langchain-groq==0.2.4
3232
langchain-huggingface==0.1.2
33-
sentry-sdk==2.22.0
33+
sentry-sdk==2.22.0
34+
siwe==4.4.0

api/src/agentflow/agents/goldrush_agent.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def goldrush_agent(query: str):
1414
An agent for handling Ethereum blockchain-related queries and tasks.
1515
This agent can perform the following tasks:
1616
17-
- Fetch wallet activity for a given address
17+
- Get activity across all chains for address
1818
- fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address
19-
- Fetch the transactions involving an address including the decoded log events in a paginated fashion
20-
- Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet
21-
- Fetch and render a single transaction including its decoded event logs
22-
- Fetch a list of approvals across all token contracts categorized by spenders for a wallet’s assets
19+
- Fetch transactions for a given wallet address (paginated)
20+
- Fetch a summary of transactions (earliest and latest) for a given wallet address.
21+
- Fetch a single transaction including its decoded event logs
22+
- Fetch list of approvals across all token contracts categorized by spenders for a wallet’s assets
2323
2424
Args:
2525
query (str): query about Ethereum blockchain tasks.

api/src/agentflow/providers/ether_scan_tools.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from langchain.tools import tool
99
from typing import List, Any, Optional, Dict
1010

11-
from src.agentflow.utils.shared_tools import handle_exceptions
1211
from src.util.configuration import Config
12+
from src.agentflow.utils.shared_tools import handle_exceptions
1313

1414

1515
_config = Config.get_config()

0 commit comments

Comments
 (0)