# BabaFishing 分佣算法 **Published by:** [babaz-dev](https://paragraph.com/@babaz-dev/) **Published on:** 2022-05-12 **URL:** https://paragraph.com/@babaz-dev/babafishing-2 ## Content 每日UTC 0 点结算奖金池,进行分佣结算。奖金池如果大于1000马蹄币,多余的部分则按如下算法进行分佣结算:totalProfit = 池子中大于1000的马蹄币做为当日总收益totalCommission = totalProfit * 0.96,百分之九十六做为当日佣金数数,百分之4归平台totalSpend = 计算出当日所有玩家的消费总数playerSpend = 计算出当日每个玩家花费的钱(存在一个玩家一天玩多次)playerSpendPercentage = 计算出每个玩家花费的总消费中的占比playerProfit = playerSpendPercentage * totalSpend,按消费占比乘以总收益,计算出每个玩家实际贡献的收益player = 循环计算当日每个玩家,计算上家佣金(最多支持三级佣金)totalUpstream = 当前玩家的所有上家数量循环上家,最多支持三个上家没有上家,NFT的持有者,本次佣金归平台1个上家,本次所有佣金(playerProfit ) 归上家2个上家,playerProfit 的60%归上家,playerProfit 的40%归上上家3个上家,playerProfit 的60%归上家,playerProfit 的30%归上上家,playerProfit 的10%归上上上家计算好佣金后,合约进行马蹄币结算计算完后每日会为每一个收益人生成结算单,方便随时查看例如,当天所有玩家花了3460马蹄币,奖金池在UTC 0 点结算时收益是500马蹄币,则以下是三级分佣的佣金分配计算表:三级分佣模型例子 ## Publication Information - [babaz-dev](https://paragraph.com/@babaz-dev/): Publication homepage - [All Posts](https://paragraph.com/@babaz-dev/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@babaz-dev): Subscribe to updates - [Twitter](https://twitter.com/jorylee001): Follow on Twitter