Liquidity Pools: Technical Details
Each Dexter has an abstract number LQT, which are referred to in the frontend as token pools. When an account adds liquidity to Dexter, Dexter keeps track of how much the user has contributed by minting LQT tokens and placing them in the ownership of the account. This tokens are non-transferable. The account can keep them and at some point in the future redeem them for an equal amount of XTZ and FA1.2 token held by Dexter.
When there is no liquidity in Dexter, the next provider is free to decide how much XTZ and FA1.2 to include and set the initial exchange rate. The initial amount of LQT that it creates is wholly a function of the amount of XTZ added, but you must add at least one XTZ.
initialLiquidity = XTZ in
When there is liquidity in Dexter, the amount of LQT created and given to the liquidity is a function of:
XTZ in * total LQT in dexter / XTZ pool
Also, when you add liquidity in a Dexter contract, you decide the amount of XTZ added and a maximum amount of tokens added. The amount of tokens deposited is determined by the following formula:
XTZ in * token pool / xtz pool then round up.
If this is greater than the max you provided, the operation will fail, thus preventing a trade that would take more tokens than you are willing to add.