# 动态定价

此功能使您可以设置随时间变化的价格。假设您希望您的产品在开始时价格为 10 令牌，但在第二周价格为 2 令牌，在第三周价格为 14 令牌，在第四周价格为 100 令牌。

我们将：

* 将产品的价格数组设置为：10、2、14、100
* 将周期设置为一周的秒数：24 \* 7 \* 60 \* 60 = 604800
* 将开始时间设置为当前时间，您可以在[此网站](https://www.epochconverter.com/)上获取当前时间。此文章撰写时的时间为 1697760417

<figure><img src="/files/G2E3th05q0iG54IrJL8A" alt=""><figcaption></figcaption></figure>

市场将使用周期和开始时间参数来计算任何时刻的价格索引。例如：

* 第一周期间的索引：索引 =（当前时间 - 开始时间）/ 周期 = 0

由于我们仍处于第一周，因此当前时间与开始时间之间的差异将小于我们的周期（一周的持续时间）。这就是为什么我们的第一个索引为 0

* 第二周期间：周期 <= 当前时间 - 开始时间 < 2 \* 周期，所以：索引 =（当前时间 - 开始时间）/ 周期 = 1
* 第三周期间：2 \* 周期 <= 当前时间 - 开始时间 < 3 \* 周期，所以：索引 =（当前时间 - 开始时间）/ 周期 = 2
* 第四周期间：3 \* 周期 <= 当前时间 - 开始时间 < 4 \* 周期，所以：索引 =（当前时间 - 开始时间）/ 周期 = 3

由于价格数组中第 1、2、3、4 周的索引（10、2、14、100）分别为 0、1、2、3，因此我们的产品的价格如下：

* 第 1 周：10 个令牌
* 第 2 周：2 个令牌
* 第 3 周：14 个令牌
* 第 4 周：100 个令牌

您可以在列出产品时设置动态定价的参数。在列表形式的末尾，将**查看高级参数**参数设置为**是**以查看高级参数。找到**动态价格**字段，并输入适合您的价格数组、起始时间和周期的相应值。显然，这是在填写关于您要列出的产品的所有先前值之后。

<figure><img src="/files/kUc275RkjafwuN1J0Tkr" alt=""><figcaption></figcaption></figure>

* 验证表单

恭喜！您已在您的产品上设置了动态定价

### 动态定价的好处

* 这可以帮助您找出产品的合适价格。通过在不同的周/月等测试不同的价格，您可以收集关于产生最多销售的价格的数据。
* 这也可以用于自动提高物品的价格。


---

# 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://docs.payswap.org/zhong-guo-ren/products/cancan/dynamic-pricing.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.
