Closed gkaracha closed 2 years ago
After investigating further I realized that there's another obstacle in addressing this one. The flat curve implementation requires parameters.target
, which our default cfmm implementation does not need. This affects %buy_kit
and %sell_kit
(as far as I can tell %add_liquidity
and %remove_liquidity
use more-or-less the same formulas in both implementations).
A way to address this lack of uniformity is perhaps to change the signatures of %buy_kit
and %sell_kit
to take that target as an input in both cases, and ignore it in the index
case. Note that this would affect a bazillion tests as well, which would now require an (unused) value for the target to be passed.
Note also that the same issue applies to the relevant offline views (cfmm_view_min_kit_expected_buy_kit
and cfmm_view_min_ctok_expected_cfmm_sell_kit
).
This is the continuation of https://github.com/tezos-checker/checker/issues/263.
When we are tracking a token on chain (i.e., when
tracking_type: token
inchecker.yaml
) it is desirable for the CFMM to use a flatter curve with less slippage, like the one currently used by ctez (branchnext_next
). See here and here. The most straightforward way to implement this is probably to have two CFMM implementations (indexCfmm.ml.jinja
andtokenCfmm.ml.jinja
, for the CPMM and the flat one, respectively) and copy/generate the appropriatecfmm.ml
at build time.