# CIAN Yield Layer Points API

### Introduction

This API specification aims to enable DeFi projects to directly allocate points to this protocol’s address, eliminating the need to distribute points to individual users. By doing so, this protocol can better manage and unify the recording of points accumulation. Project teams must implement at least one of the two available query methods.

### Query Methods

#### Method 1: Fixed Interval Points Query

**Request Method**

`GET /points?address={address}`

(just an example)

**Request Parameters**

| Parameter | Type   | Required | Description         |
| --------- | ------ | -------- | ------------------- |
| address   | string | Yes      | User wallet address |

**Response Example**

```
{
    "points": [
        { "timestamp": 1709251200, "points": 90 },
        { "timestamp": 1709337600, "points": 100 }
    ]
}
```

or if you have several points to distribute,

```
{
    "points": [
        { "timestamp": 1709251200, "points_A": 90, "points_B": 90 },
        { "timestamp": 1709337600, "points_A": 100, "points_B": 90 }
    ]
}
```

**Description**

The interval must be no longer than one day.

***

#### Method 2: Timestamp-Based Points Query

**Request Method**

`GET /points?address={address}&timestamp={timestamp}`

(just an example)

**Request Parameters**

| Parameter | Type   | Required | Description                  |
| --------- | ------ | -------- | ---------------------------- |
| address   | string | Yes      | User wallet address          |
| timestamp | int    | Yes      | Query timestamp (in seconds) |

**Response Example**

```
{
    "points": 120
}
```

**Description**

The responses should vary from different timestamps input.

#### Additional

* The detailed info is not necessary, only the total points are needed.
