# 🔄 Solana User Action

**User Actions** represent the high-level operations performed by users within a blockchain transaction.\
Instead of showing raw transaction logs, our API decodes each relevant event into a clear and readable action.\
Examples include: **Swap**, **Supply**, **Borrow**, and more.\
Each User Action provides detailed information such as involved tokens, amounts, signer, and recipient, allowing developers and analysts to integrate, display, or analyze blockchain activity effortlessly.

**1. JSON schema**<br>

<table><thead><tr><th width="222.837646484375">Field</th><th width="146.07421875">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>type</strong></td><td>string</td><td>Protocol type. Examples: <code>DEX</code>, <code>LENDING</code>, <code>STAKING</code>, <code>STABLE_COIN ..</code>.<br><a href="https://txdecoder.gitbook.io/docs/chains-and-protocols/protocol-type">List of Protocol Type</a></td></tr><tr><td><strong>protocol</strong></td><td>string</td><td>Protocol name. Example: <code>Uniswap V2</code>, <code>Aave V3</code>.<br><a href="https://txdecoder.gitbook.io/docs/chains-and-protocols/supported-protocols">Protocol list</a></td></tr><tr><td><strong>source</strong></td><td>string</td><td>Protocol/platform identifier. Example: <code>Uniswap V2</code>, <code>PancakeSwap V2</code> </td></tr><tr><td><strong>action</strong></td><td>string</td><td>User action. Examples: <code>swap</code>, <code>add_liquidity</code>, <code>remove_liquidity</code>, <code>supply</code>, <code>borrow</code>, <code>repay</code>.</td></tr><tr><td><strong>participants</strong></td><td>Array&#x3C;Object></td><td>List of participants involved in the action. <br>• <strong>address</strong> (string) – Ethereum address <br>• <strong>type</strong> (string) – role of the address (<code>signer</code>, <code>suplier</code>, <code>borrower</code>).</td></tr><tr><td><strong>pool_id</strong></td><td>string</td><td>Unique pool/market/vault identifier depending on the protocol.</td></tr><tr><td><strong>tokens</strong></td><td>Array&#x3C;Object></td><td>List of tokens involved.<br> • <strong>address</strong> (string) – token contract address <br> • <strong>symbol</strong> (optional) (string) – token symbol<br> • <strong>name</strong> (optional) (string) – token name<br> • <strong>decimals</strong> (number) – token decimals<br> • <strong>amount</strong> (string) – raw token amount <br> • <strong>ui_amount</strong> (string) – ui token amount<br> • <strong>type</strong> (optional string) –  if  there are multiple tokens involved in the action, type of the token in the action: swap_from, swap_to</td></tr><tr><td><strong>value_usd</strong></td><td>number</td><td>USD value of the action </td></tr><tr><td><strong>extra_data</strong></td><td>object</td><td>Additional metadata (e.g., fee, oracle_price, collateral_factor).</td></tr><tr><td><strong>slot</strong></td><td>number</td><td>Slot number</td></tr><tr><td><strong>tx_hash</strong></td><td>string</td><td>Transaction hash.</td></tr><tr><td><strong>instruction_index</strong></td><td>number</td><td>Instruction index</td></tr><tr><td><strong>inner_instruction_index</strong></td><td>string</td><td>Inner instruction index</td></tr><tr><td><strong>timestamp</strong></td><td>number</td><td>Block timestamp (UNIX seconds).</td></tr><tr><td><strong>program_id</strong></td><td>string</td><td>Address of program</td></tr></tbody></table>

<br>

**2. JSON example**

```javascript
{
  "62rEp1EhDR1nh1hxthGUu8SA4e7J6RFSCs6bC1vRao92zNtUNsiXFKHP25GvnxSkKZXrZdmMsFaJtWNiozXH9gKu": [
    {
      "type": "STABLE_COIN",
      "protocol": "USDC",
      "source": "USDC",
      "action": "mint",
      "tokens": [
        {
          "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "name": "USD Coin",
          "symbol": "USDC",
          "decimals": 6,
          "amount": "250000000000000",
          "ui_amount": "250000000"
        }
      ],
      "participants": [
        {
          "address": "42XHrxUX5skic589HER817BWiJ5xvhJurrFVKjYCPwnb",
          "type": "signer"
        },
        {
          "address": "7VHUFJHWu2CuExkJcJrzhQPJ2oygupTWkL2A2For4BmE",
          "token_account": "3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa",
          "type": "mint_to"
        }
      ],
      "program_id": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "value_usd": 250000000,
      "instruction_index": 1,
      "inner_instruction_index": null,
      "tx_hash": "62rEp1EhDR1nh1hxthGUu8SA4e7J6RFSCs6bC1vRao92zNtUNsiXFKHP25GvnxSkKZXrZdmMsFaJtWNiozXH9gKu",
      "slot": 390914952,
      "timestamp": 1767392423
    }
  ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://txdecoder.gitbook.io/docs/data-schema/solana-user-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
