> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# List Transactions

> List recorded transactions for a market, newest first

Returns the market's recorded activity with pagination counters. Records are written when a transaction is confirmed through this API or observed during a chain sync. A transaction that is broadcast but never confirmed with `txHash` is not recorded here until the next reconciliation pass.

## Path Parameters

<ParamField path="marketId" type="string" required>Market ID.</ParamField>

## Query Parameters

<ParamField query="limit" type="integer" default="50">
  Records to return. Minimum 1, maximum 200.
</ParamField>

<ParamField query="offset" type="integer" default="0">
  Records to skip. Minimum 0.
</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="transactions" type="array">
      Transaction records ordered by `timestamp` descending.

      <Expandable>
        <ResponseField name="id" type="string">Record ID.</ResponseField>
        <ResponseField name="marketId" type="string">Market ID.</ResponseField>
        <ResponseField name="positionId" type="string">Linked position, when the action belonged to a loan. Null otherwise.</ResponseField>
        <ResponseField name="txType" type="string">Action type. See the table below.</ResponseField>
        <ResponseField name="userAddress" type="string">Address that performed the action, lowercased. Oracle syncs triggered through this API record `api`.</ResponseField>
        <ResponseField name="amount" type="string">Amount in the relevant asset for the action, as a decimal string.</ResponseField>
        <ResponseField name="txHash" type="string">Transaction hash.</ResponseField>
        <ResponseField name="timestamp" type="string">ISO 8601 timestamp.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="total" type="integer">Total records for this market.</ResponseField>
    <ResponseField name="hasMore" type="boolean">Whether more records exist beyond this page.</ResponseField>
    <ResponseField name="limit" type="integer">Applied limit.</ResponseField>
    <ResponseField name="offset" type="integer">Applied offset.</ResponseField>
  </Expandable>
</ResponseField>

## Transaction Types

| `txType`               | Written when                             |
| ---------------------- | ---------------------------------------- |
| `SUPPLY`               | Liquidity added to the pool              |
| `WITHDRAW`             | LP shares redeemed                       |
| `BORROW`               | A loan is opened or increased            |
| `REPAY`                | Debt is repaid                           |
| `CLOSE`                | A fully repaid loan is closed            |
| `COLLATERAL_ADDED`     | Collateral is posted to an existing loan |
| `COLLATERAL_WITHDRAWN` | Collateral is released from a loan       |
| `LIQUIDATION`          | A loan is liquidated                     |
| `ORACLE_SYNC`          | A NAV price is pushed on-chain           |

<Note>
  `amount` is denominated in the market's borrow asset for `SUPPLY`, `WITHDRAW`, `BORROW`, and `REPAY`, in collateral token units for `COLLATERAL_ADDED` and `COLLATERAL_WITHDRAWN`, and carries the submitted price for `ORACLE_SYNC`. `CLOSE` records `0`.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/lending-external-securities/api/markets/{marketId}/transactions?limit=20" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities/api/markets/${marketId}/transactions?limit=20&offset=0`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "transactions": [
        {
          "id": "sectx_001",
          "marketId": "clx_secmarket_001",
          "positionId": null,
          "txType": "ORACLE_SYNC",
          "userAddress": "api",
          "amount": "104.82",
          "txHash": "0xabc...def",
          "timestamp": "2025-06-15T11:30:00.000Z"
        },
        {
          "id": "sectx_002",
          "marketId": "clx_secmarket_001",
          "positionId": "secpos_014",
          "txType": "BORROW",
          "userAddress": "0xabc...def",
          "amount": "50000",
          "txHash": "0x123...789",
          "timestamp": "2025-06-15T10:05:00.000Z"
        }
      ],
      "total": 214,
      "hasMore": true,
      "limit": 20,
      "offset": 0
    }
  }
  ```
</ResponseExample>
