WrapFi

Search…

TMM Design

In order to stabilize the price and boost liquidity of IBTs, WrapFi proposed the Tracking Market Maker (TMM) algorithm which is improved from the PMM algorithm. TMM has three unique strengths:

1.Exchange Rate Tracking

As we mentioned above, there are actually two price discovery markets for IBT assets. The primary market price is the IBT/DT Exchange Rate announced by the asset issuers. The other often referred to as secondary market price, exists in DEXes. The latter is supported by the former and adjusted by the demand of buyers/sellers. WrapFi will track the primary market price of IBTs so that the price discovery mechanism on WrapFi can also reflect the fluctuation of the real price of the primary market.

PMM's price curve:

In other cases *R=1*

A sharp, accurate, and secure Orcale integrated in TMM algorithm is indispensable for each IBT pair. Since the underlying chain and exchange rate mechanism of each IBT asset may vary, WrapFi will customize an oracle mechanism that can capture the corresponding primary market price (Price Fetching Script) for each IBT asset. The Script will be run by a group of SSV (StaFi Special Validators) on the StaFi chain through a verifiable random number VRF（Verifiable Random Function） algorithm. Finally, the trade price between IBTs and Deposited Tokens will be determined by PMM algorithm.

For WrapFi's oracle system, it is very important to assign random numbers for SSVs, in order to ensure absolute randomness and effectiveness. Only in this case can users trust the data uploaded by SSVs to be well-intentioned. To discourage the collusion of multiple SSVs, WrapFi will adopt a Verifiable Random Function (VRF) algorithm to ensure absolute security and verifiability in terms of the random number generation process, as well as the number's uniqueness. The VRF algorithm adopts elliptic curve encryption and zero-knowledge proof, thereby realizing the decentralization and security of the Oracle pricing mechanism.

The VRF algorithm encompasses three parts:

Assuming that the base point of the elliptic curve is O and the order is n, function G is as follows:

A1: Choose a random number

A2: Generate private and public elliptic curve keys. The former is k and the latter is

Input: message m, private key k;

Output: random number v, proof;

B1: Choose a random number

B2: Use the hash function h1 to calculate H=h1(m), and map m to a point H on the elliptic curve;

B3: Calculate rH, rO;

B4: Use the function h2 to encode the input into an integer s.

B5: calculation

B6: calculation

B7: Use the function h3 to encode the point on the elliptic curve into an integer. Then we have a random number value=h3(V), and proof is (V;t;s).

Input: message m', proof proof'

Output: valid or invalid

C1: Use the hash function h1 to map the message m' to a point H' on the elliptic curve;

C2: calculate:

C3: Calculate:

C4: If s=s', it indicates that the random number and out is valid, and the verification has passed. If not, the random number and the output are invalid and the verification has not passed.

Apart from the VRF algorithm, SSV must stake certain amount FIS tokens as pledge, which further enhance the security and stability of WrapFi oracle. If any SSV does evil, it will be fined from the deposit.

WrapFi will set different levels of LP commission fees by the liquidity of each IBT pair. This will dynamically adjust the commission income of the LP providers. When an IBT trading pair comparatively stagnant, the LP Commission Fee will increase, encouraging more LPs to join and vice versa.

Last modified 1yr ago

Copy link

On this page

1.Exchange Rate Tracking

2.Customized VRF Oracles.

3.Dynamic LP Fees