Dynamic Pricing
This feature enables you to set a price that changes over time. Suppose you want your product to start off with a price of 10 tokens but cost 2 tokens in the second week, 14 tokens in the third week and 100 tokens in the fourth.
We will:
Set the prices array of our product to : 10, 2, 14, 100
Set the period to the number of seconds in week: 24 * 7 * 60 * 60 = 604800
Set the start time to now, you can get the current time on this website. The time for the moment this article is being written is 1697760417
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-606dc31f3b8e9f62a64d09abc9b3d239e2d4c915%252Ftime3.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=cd1c2697&sv=1)
The marketplace will use the period and the start time parameters to compute the index of the price in any moment in time. For instance:
the index during the first week: index = (current time - start time) / period = 0
Since we are still in the first week the difference between the current time and the start time will be inferior to our period (which is the duration of a week). That is why our first index is 0
during the second week: period <= current time - start time < 2 * period so:
index = (current time - start time) / period = 1
during the third week: 2 * period <= current time - start time < 3 * period so:
index = (current time - start time) / period = 2
during the fourth week: 3 * period <= current time - start time < 4 * period so:
index = (current time - start time) / period = 3
Since the index for week 1, 2, 3, 4 in the prices arrary (10, 2, 14, 100) are 0, 1, 2, 3, that translates to the following prices for our product:
week 1: 10 tokens
week 2: 2 tokens
week 3: 14 tokens
week 4: 100 tokens
You can set the parameters for your dynamic pricing when listing your product. At the end of the listing form, set the parameter View Advanced Parameters to Yes to review the advanced parameters. Find the Dynamic Prices field and input the appropriate value for your prices array, you start time and period. Obviously this is after filling in all the previous values about the product you are listing.
![](https://docs.payswap.org/~gitbook/image?url=https%3A%2F%2F3481829468-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FbuuWgsRQF3QPmDvV7XJQ%252Fuploads%252Fgit-blob-2790f60a21d624e3b492cc0ebe7ed6a4158d7366%252Fmain_page23.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=879140c&sv=1)
Validate the form
Congratulations! You have setup dynamic pricing on your product
Benefits of Dynamic Pricing
This can help you figure out the right price for your product. By testing different prices over different weeks/months/etc you can collect data on the price that makes the most sale for instance.
This can also be used to automatically appreciates an items' price over time
Last updated