> For the complete documentation index, see [llms.txt](https://api.liquidium.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.liquidium.fi/liquidium-api-overview.md).

# Liquidium API Overview

## Liquidium DeFi API Documentation

### Get Collection Statistics

**GET**\
`https://app.liquidium.fi/api/public/analytics/collection-stats`

Returns statistics for all collections or a specific collection if a `slug` query parameter is provided.

#### Sample Queries

* **All Collections:**

  ```
  https://app.liquidium.fi/api/public/analytics/collection-stats
  ```
* **Specific Collection (e.g., `nodemonkes`):**

  ```
  https://app.liquidium.fi/api/public/analytics/collection-stats?slug=nodemonkes
  ```

#### Example cURL Request

```bash
curl -X 'GET'   'https://app.liquidium.fi/api/public/analytics/collection-stats?slug=nodemonkes'   
-H 'accept: application/json'   
-H 'Authorization: Bearer API-Key'
```

#### Response Codes

| Code | Description                             |
| ---- | --------------------------------------- |
| 200  | OK Success                              |
| 429  | Too Many Requests (Rate limit exceeded) |
| 400  | Invalid request parameters              |
| 401  | Unauthorized, API key required          |
| 404  | Collection not found                    |
| 500  | Server error                            |

#### Sample Response

```json
[
    {
        "slug": "bitcoin-puppets",
        "highestOfferSats": 8001000,
        "numberOfOffers": 84,
        "highestLTV": 73.4,
        "lowestLTV": 5.41,
        "activeLoans": 92,
        "totalLoans": 2147,
        "activatingLoans": 1,
        "liquidatedLoans": 418,
        "totalOffers": 9862,
        "volume24hSats": 225839800000,
        "volume7dSats": 2500519952138,
        "volume30dSats": 12675963868552,
        "volumeTotalSats": 294730484350904,
        "liquidatedAmountSats": 6469288992
    },
    {
        "slug": "dmtnatcats",
        "highestOfferSats": 1561000,
        "numberOfOffers": 84,
        "highestLTV": 80.97,
        "lowestLTV": 10.37,
        "activeLoans": 69,
        "totalLoans": 1364,
        "activatingLoans": 0,
        "liquidatedLoans": 155,
        "totalOffers": 5350,
        "volume24hSats": 50215100000,
        "volume7dSats": 530982150000,
        "volume30dSats": 2285065159050,
        "volumeTotalSats": 12251906091750,
        "liquidatedAmountSats": 318272989
    }
]
```

***

### Get Loan Activity for Specific Collection

**GET**\
`https://app.liquidium.fi/api/public/analytics/loan-activity?slug=nodemonkes`

Returns loan activity for a specific collection.

#### Example cURL Request

```bash
curl -X 'GET'   'https://app.liquidium.fi/api/public/analytics/loan-activity?slug=nodemonkes'   
-H 'accept: application/json'   
-H 'Authorization: Bearer API-Key'
```

#### Sample Response

```json
{
    "collectionName": "NodeMonkes",
    "slug": "nodemonkes",
    "lenderTaproot": "bc1ps2se3hrp65necdr8v9ga0yfd0cz600z2jdy3g5cfswe947emhpcs46ppgk",
    "borrowerTaproot": "bc1pqzycsgws57743g7v43fdgd26yt6rv3s8q8vew8ree0wsh6gj7zfssaa7je",
    "principalAmountSats": 12810000,
    "initiationTxId": "fb5312a3aa09f7d1f4ac0f5e3990d19ea805fa415ce94940af84bbde51b7ddfe",
    "startDate": "2024-09-23T10:02:11.313Z",
    "currentState": "ACTIVE",
    "repaymentTxId": null
}
```

***

### Get Loan Activity for All Collections

**GET**\
`https://app.liquidium.fi/api/public/analytics/loan-activity`

Returns loan activity for all collections.

#### Example cURL Request

```bash
curl -X 'GET'   'https://app.liquidium.fi/api/public/analytics/loan-activity'   
-H 'accept: application/json'   
-H 'Authorization: Bearer API-Key'
```

#### Sample Response

```json
[
{
    "collectionName": "Honey Badgers",
    "slug": "honey-badgers",
    "lenderTaproot": "bc1pumc0uv706r4cxdpg70r8hk3ew786jxsntw9jl77d5aukuzxx4pwqcnx7su",
    "borrowerTaproot": "bc1pgf7ta8xmtnv4jav0anwcyfm3xq2aa28a2nalpvndf6wckt3gl5lssj3gqu",
    "principalAmountSats": 595000,
    "initiationTxId": "c10adac91daa6f9d55c96a64782a8722a326c11dd3a608bc860e78cfb8c9d397",
    "startDate": "2024-09-23T16:27:53.332Z",
    "currentState": "ACTIVATING",
    "repaymentTxId": null
},
{
        "collectionName": "Ordinal Maxi Biz 🟠",
        "slug": "omb-color-orange",
        "lenderTaproot": "bc1pewc3eywdhvf6nl7shwrtfjrc07s24z52m3vts57ysn6c7ywqsd3sg87qaf",
        "borrowerTaproot": "bc1ptrhp27emfv2tshqqk8797zeq2yxjlcwfnlrdrjw9xjnr84tptthqwy80up",
        "principalAmountSats": 19600000,
        "initiationTxId": "1fa1f0308eaac1ee2c505d68a0096a0157cda0a892b5ed1ed537f2e2a0e63d31",
        "startDate": "2024-07-19T11:50:20.627Z",
        "currentState": "CLAIMED",
        "repaymentTxId": "d2fdcef649b71df3c24a0b8b707a75839e20d5806df0f8677003f9fa8df56b22"
    }
]
```

#### Field Descriptions

* **collectionName**: The name of the collection.
* **slug**: The unique identifier for the collection.
* **lenderTaproot**: The lender's taproot address.
* **borrowerTaproot**: The borrower's taproot address.
* **principalAmountSats**: The loan amount in satoshis.
* **initiationTxId**: The transaction ID for the loan initiation.
* **startDate**: The date the loan was initiated.
* **currentState**: The current state of the loan (e.g., ACTIVE, ACTIVATING,CLAIMING,CLAIMED,DEFAULT, LIQUIDATED,REPAID,REPAYING).
* **repaymentTxId**: The transaction ID for the repayment (if applicable).

***
