MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / CalcMatchFee

Method CalcMatchFee

src/tx/dextx.cpp:964–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962 }
963
964 bool CDealItemExecuter::CalcMatchFee(const uint256 &orderId, const CDEXOrderDetail &order,
965 const COrderOperatorParams &orderOperatorParams,
966 const OrderSide &takerSide, uint64_t amount,
967 uint64_t &orderFee) {
968
969 uint64_t feeRatio = GetOperatorFeeRatio(order, orderOperatorParams, takerSide);
970 if (!CheckOperatorFeeRatioRange(context, orderId, feeRatio, DEAL_ITEM_TITLE))
971 return false;
972 if (!CalcAmountByRatio(amount, feeRatio, PRICE_BOOST, orderFee))
973 return context.pState->DoS(100, ERRORMSG("%s, the calc_deal_fee overflow! amount=%llu, "
974 "fee_ratio=%llu, side=%s", DEAL_ITEM_TITLE, amount, feeRatio,
975 kOrderSideHelper.GetName(order.order_side)),
976 REJECT_INVALID, "calc-deal-fee-overflow");
977 return true;
978 }
979
980 bool CDealItemExecuter::CalcWusdFrictionFee(uint64_t amount, uint64_t &frictionFee) {
981 uint64_t frictionFeeRatio;

Callers

nothing calls this directly

Calls 4

GetOperatorFeeRatioFunction · 0.85
CalcAmountByRatioFunction · 0.85
DoSMethod · 0.80

Tested by

no test coverage detected