Curve Encoding
Pricing of services on the zap platform is determined via a pricing mechanism set by the provider known as a Bonding Curve. This section details how a user can setup their bonding curve.
Last updated
Pricing of services on the zap platform is determined via a pricing mechanism set by the provider known as a Bonding Curve. This section details how a user can setup their bonding curve.
Last updated
NOTE: If you're using Zap tools like the web-admin or cli, you wont need to know how to parse our curve encodings but a brief breakdown follows where encode/decode a few examples. Tldr; we provide some examples at the bottom of this page
Zap curves are piece-wise functions where each piece-wise segment is a sum-of-powers polynomial.
So if you have a function like 2+x^2, you'd want to put it in the form
If you just wanted a stable price, you'd just stick a constant, ala 3
Since Zap bonding curves are piece-wise functions, our curves are encoded via integer encoded as follows
where
n1 is the number of terms in the first polynomial
c0, c1, ... are the coefficients of their respective n terms
l1 is the x limit of the first polynomial function
n2 is the number of terms in the second polynomial
etc, etc
For the following examples we have equation + encoding
This curve has 1 polynomial function, 3x^2. This takes 3 terms in the sum of powers repesentation
Hence we have 3 terms in the 1st polynomial, [3,0,0,3,10000000000]
and c0=0, c1=0, and c2=3, [3,0,0,3,10000000000]
Since the x-limit of the first term is 10000000000, we use this for our l1 term , [3,0,0,3,10000000000]
Here we have 5 different piece-wise functions but they are all constants, so each consists of 1 term