# Creating Subgraph Queries

Queries for the Carbon DeFi Subgraph can be generated using The Graph's interactive explorer. The following explains how to interact&#x20;

### To Generate Queries

1. Navigate to the interactive explorer: [Carbon DeFi Subgraph](https://thegraph.com/explorer/subgraphs/3oYNFcwAGk5mVtzzMTDjanoMRsZRCGk88EFRn75dLRyp?view=Playground\&chain=arbitrum-one)
2. Click the folder icon on the right to open the explorer:<br>

   <figure><img src="https://4042452300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs76ZPTyf99g2TmZJrMzB%2Fuploads%2FaFj1LbS0xuPUwtQHqjMA%2FScreenshot%202023-06-28%20164646.png?alt=media&#x26;token=e105908e-c3e7-47eb-b019-119b5c21d7e8" alt=""><figcaption></figcaption></figure>
3. **Select or deselect** variable names to adjust the query. \
   For example to see the latest trades and some of their relevant details, select **trades** and one or more variables below it. <br>

   <figure><img src="https://4042452300-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs76ZPTyf99g2TmZJrMzB%2Fuploads%2FdxewXikmxaMefxwoXL4p%2Fimage.png?alt=media&#x26;token=05db74de-0270-4b86-9523-02ed2681a081" alt=""><figcaption></figcaption></figure>
4. **Click** the **play button** to see an example of the results of your current query. Once satisfied, continue.
5. Copy the query into your code. \
   For example, in Python:

   ```python
   query = """

   {
     trades {
       sourceToken {
         symbol
       }
       targetToken {
         symbol
       }
       sourceAmount
       targetAmount
       transactionHash
     }
   }
   """
   ```
