🟠
Add new dex
This page describes creation of new DEX pool.
These contract methods are called only by
admin
of that contract.Creation of pool consist of some parameters for seeting up DEX config.
Constant A used for manipulating with swap function. As larger the value of A, as more the function tends to be constant sum invariant. This constant is stored inside the contact as
where
- number of DEX underlying tokens. You could read more about this constant at Curve whitepaper and an explanation of Curve formulas.

Understanding StableSwap (Curve)
An explanation of Curve formulas
This param is a set of FA12/FA2 tokens that would be traded on DEX.
Set
type in Tezos contract is the sorted list of unique values, so you must keep in mind that for setting up tokens_info
and when calling DEX.When you want to initialise pool, you should setup initial
reserves
, rate
and precision_multiplier
in correct way:Let 4TBC
= 2TXZ
= 1TEH
(from example)
Then calculate
of these ratios
Token info for
TBC
precision_multiplier
-rate
-reserves
-
Token info for
TXZ
precision_multiplier
-rate
-reserves
-
Token info for
TEH
precision_multiplier
-rate
-reserves
-
Then you should receive
LP tokens.
Details of how to calculate values are in this table. (You can copy and play with this sheet)
https://docs.google.com/spreadsheets/d/16sfuK6o8mWxOtG4pagxvRiUoswmA4SUO4aFzDa8yTD8/edit?usp=sharing
docs.google.com
Stable exchange with switching of amount of tokens
Last modified 1yr ago