bancor eos版

https://github.com/bancorprotocol/contracts_eos

setup.sh里面有细节,目前看只部署在Jungle testnet,应该还在测试

http://jungle.cryptolions.io上可以查到bnttoken4eos,https://eostracker.io还没有

用的都是relay token,设置的CW都是0.5


real_type convert_to_exchange(real_type balance, real_type in, real_type supply, int64_t weight ) {

  real_type R(supply);

  real_type C(balance+in);

  real_type F(weight/1000.0);

  real_type T(in);

  real_type ONE(1.0);

  real_type E = -R * (ONE - pow( ONE + T / C, F) );

  return E;

}

real_type convert_from_exchange( real_type balance, real_type in, real_type supply, int64_t weight) {

  real_type R(supply - in);

  real_type C(balance);

  real_type F(1000.0/weight);

  real_type E(in);

  real_type ONE(1.0);

  real_type T = C * (pow( ONE + E/R, F) - ONE);

  return T;

}

这里更象EOS RAM的定价模型,按公式

real_type C(balance+in); real_type R(supply - in);都没有必要啊,看来是采纳了BM的建议

你可能感兴趣的:(bancor eos版)