> For the complete documentation index, see [llms.txt](https://docs.8pay.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.8pay.network/api/invest/executions.md).

# Executions

A strategy is executed at regular intervals for an indefinite number of times, untile cancellation.

In order for executions to be performed, the user will need to have enough funds on its gas-wallet to pay for blockchain fees.

An execution can fail if the user hasn’t got enough funds on his wallet. In that case 8Pay will retry every 6 hours.

## Get a list of executions

<mark style="color:blue;">`GET`</mark> `https://api.8pay.network/v1/:chain/dollar-cost-average/executions`

#### Path Parameters

| Name  | Type   | Description                                 |
| ----- | ------ | ------------------------------------------- |
| chain | string | [chain identifier](/api/overview.md#chains) |

#### Query Parameters

| Name | Type   | Description                                           |
| ---- | ------ | ----------------------------------------------------- |
| from | number | filter by `timestamp` (default 0)                     |
| to   | number | filter by `timestamp` (default current timestamp)     |
| sort | string | `asc` or `desc` based on `timestamp` (default `desc`) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "strategyId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "timestamp": 1684819496,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed",
            "inputToken": "USDT",
            "fee": "1",
            "swaps": [
                {
                    "inputAmount": "100",
                    "outputAmount": "5000",
                    "outputToken": "8PAY"
                }
            ]
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}
```

{% endtab %}
{% endtabs %}

## Get executions of a strategy

<mark style="color:blue;">`GET`</mark> `https://api.8pay.network/v1/:chain/dollar-cost-average/strategies/:strategyId/executions`

#### Path Parameters

| Name       | Type   | Description                                 |
| ---------- | ------ | ------------------------------------------- |
| strategyId | string | ID of the strategy                          |
| chain      | string | [chain identifier](/api/overview.md#chains) |

#### Query Parameters

| Name | Type   | Description                                           |
| ---- | ------ | ----------------------------------------------------- |
| from | number | filter by `timestamp` (default 0)                     |
| to   | number | filter by `timestamp` (default current timestamp)     |
| sort | string | `asc` or `desc` based on `timestamp` (default `desc`) |

#### Headers

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| Authorization | string | Bearer \<api-key> |

{% tabs %}
{% tab title="200 " %}

```
{
    "data": [
        {
            "strategyId": "0xe63ba761797e289076f80a7c0916a31740684806aaf507da85f81ee785fec6ba",
            "timestamp": 1684819496,
            "transactionHash": "0xbb97a142aed61a7027b0a030f3c0ab7e1b39bb776201752829d96d562ed49782",
            "transactionStatus": "confirmed",
            "inputToken": "USDT",
            "fee": "1",
            "swaps": [
                {
                    "inputAmount": "100",
                    "outputAmount": "5000",
                    "outputToken": "8PAY"
                }
            ]
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 1
}
```

{% endtab %}
{% endtabs %}
