![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-8.11.29-PM-1024x954.png)
Without prompt mentioning version of Dune, ChatGPT provides Dune v1 based query. Limiting the date interval is also possible.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-8.13.36-PM-1024x660.png)
With provided query, it gives an error on Dune:
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-8.17.03-PM-1024x767.png)
The error indicating the INTERVAL 3 MONTH
is not being supported. I asked to fix it, and ChatGPT identified the issue.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-8.21.25-PM-1024x745.png)
The lastly provided query gets the expecting tx count.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-8.22.26-PM-1024x764.png)
Then, I tried little more complicated query. The prompt is:
Provide a query that give transaction data of top 5 stablecoins. Time INTERVAL is 3 months. Limit 100000. Value has to be greater than 0.5 ETH.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-9.20.41-PM-1024x1012.png)
It looks correct, but if you look carefully, the token address syntax is wrong. It has to be \xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Correcting it via ChatGPT also works.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-9.29.14-PM-1024x154.png)
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-9.30.12-PM-1024x917.png)
Yep, the query works.
![](https://xflux.us/wp-content/uploads/2023/05/Screen-Shot-2023-05-04-at-9.48.40-PM-1024x758.png)
So this is final query.
SELECT
evt_tx_hash AS tx_hash,
contract_address AS token_address,
tr."from" AS from_address,
tr."to" AS to_address,
tr.value AS amount
FROM erc20."ERC20_evt_Transfer" tr
WHERE contract_address IN (
'\xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', -- USDC
'\xdac17f958d2ee523a2206206994597c13d831ec7', -- USDT
'\x6b175474e89094c44da98b954eedeac495271d0f', -- DAI
'\x57ab1ec28d129707052df4df418d58a2d46d5f51', -- sUSD
'\x8e870d67f660d95d5be530380d0ec0bd388289e1' -- PAX
)
AND tr.value > 0.5 * 1e18 -- greater than 0.5 ETH
AND evt_block_time >= CURRENT_TIMESTAMP - INTERVAL '3 months'
ORDER BY evt_block_time DESC
LIMIT 100000;