常见问题
- 领取奖金有时间限制吗?
没有时间限制,可以在任何时间来领取。 - 利息是如何计算的?
上行池的支付比率=两个池的总价值÷上行池的价值
下行池的支付比率=两个池的总价值÷下行池的价值
例如,如果一轮的下线有15BNB,而总奖金池为150BNB,下线支付比率将为(150/15)=10x。
支付金额=支付比率×头寸×(1-库务费)
在上述情况下,如果一轮以下跌结果结束,如果您向下跌头寸承诺2 BNB,您将获得(2*10)×(1-0.03)=19.4 BNB的赔付。您的利润将为174亿英镑(19.4-2英镑)。
财政费目前设定为3%:这可能会有变化,将在PancakeSwap的官方沟通渠道上公布。国库费用用于回购和烧掉蛋糕代币。 - 手续费是如何计算的?
每轮总奖金的3%将被燃烧。
代码解析
function betBear(uint256 epoch, uint256 amount) external whenNotPaused nonReentrant notContract {
require(epoch == currentEpoch, "Bet is too early/late");
require(_bettable(epoch), "Round not bettable");
require(amount >= minBetAmount, "Bet amount must be greater than minBetAmount");
require(ledger[epoch][msg.sender].amount == 0, "Can only bet once per round");
if(roundsNumber[epoch][Position.Bear] > 0 && (roundsNumber[epoch][Position.Bull] == 0)){
return;
}
tokens.safeTransferFrom(msg.sender, address(this), amount);
Round storage round = rounds[epoch];
round.totalAmount = round.totalAmount + amount;
round.bearAmount = round.bearAmount + amount;
BetInfo storage betInfo = ledger[epoch][msg.sender];
betInfo.position = Position.Bear;
betInfo.amount = amount;
userRounds[msg.sender].push(epoch);
player[msg.sender] = true;
roundsNumber[epoch][Position.Bear] += 1;
emit BetBear(msg.sender, epoch, amount);
}
function betBull(uint256 epoch, uint256 amount) external payable whenNotPaused nonReentrant notContract {
require(epoch == currentEpoch, "Bet is too early/late");
require(_bettable(epoch), "Round not bettable");
require(amount >= minBetAmount, "Bet amount must be greater than minBetAmount");
require(ledger[epoch][msg.sender].amount == 0, "Can only bet once per round");
if(roundsNumber[epoch][Position.Bull] > 0 && (roundsNumber[epoch][Position.Bear] == 0)){
return;
}
tokens.safeTransferFrom(msg.sender, address(this), amount);
Round storage round = rounds[epoch];
round.totalAmount = round.totalAmount + amount;
round.bullAmount = round.bullAmount + amount;
BetInfo storage betInfo = ledger[epoch][msg.sender];
betInfo.position = Position.Bull;
betInfo.amount = amount;
userRounds[msg.sender].push(epoch);
player[msg.sender] = true;
roundsNumber[epoch][Position.Bull] += 1;
emit BetBull(msg.sender, epoch, amount);
}
function executeRound() external whenNotPaused onlyOperator {
require(
genesisStartOnce && genesisLockOnce,
"Can only run after genesisStartRound and genesisLockRound is triggered"
);
(uint80 currentRoundId, int256 currentPrice) = _getPriceFromOracle();
oracleLatestRoundId = uint256(currentRoundId);
_safeLockRound(currentEpoch, currentRoundId, currentPrice);
_safeEndRound(currentEpoch - 1, currentRoundId, currentPrice);
_calculateRewards(currentEpoch - 1);
currentEpoch = currentEpoch + 1;
_safeStartRound(currentEpoch);
}
function genesisStartRound() external whenNotPaused onlyOperator {
require(!genesisStartOnce, "Can only run genesisStartRound once");
currentEpoch = currentEpoch + 1;
_startRound(currentEpoch);
genesisStartOnce = true;
}
function claim(uint256[] calldata epochs) external nonReentrant notContract {
uint256 reward;
uint256 rcm1Amt;
uint256 rcm2Amt;
uint256 rcm3Amt;
uint256 marketAmt;
for (uint256 i = 0; i < epochs.length; i++) {
require(rounds[epochs[i]].times.startTimestamp != 0, "Round has not started");
require(block.timestamp > rounds[epochs[i]].times.closeTimestamp, "Round has not ended");
uint256 addedReward = 0;
if (rounds[epochs[i]].oracleCalled) {
if(claimable(epochs[i], msg.sender)){
Round memory round = rounds[epochs[i]];
if(round.isBet){
require(refundable(epochs[i], msg.sender), "Not eligible for refund");
addedReward = ledger[epochs[i]][msg.sender].amount;
recommendOtherAmt[msg.sender] = ledger[epochs[i]][msg.sender].amount * failureFee / 10000;
}else{
addedReward = (ledger[epochs[i]][msg.sender].amount * round.rewardAmount) / round.rewardBaseCalAmount;
marketAmt = addedReward / (10000 - totalFee) * marketFee / 10000000;
rcm1Amt = addedReward / (10000 - totalFee) * recommend1Fee / 10000000;
rcm2Amt = addedReward / (10000 - totalFee) * recommend2Fee / 10000000;
rcm3Amt = addedReward / (10000 - totalFee) * recommend3Fee / 10000000;
distributionProfit(rcm1Amt, rcm2Amt, rcm3Amt, marketAmt, msg.sender);
}
}else if(isLotteryFailure(epochs[i], msg.sender)){
recommendOtherAmt[msg.sender] = ledger[epochs[i]][msg.sender].amount * failureFee / 10000;
}
}
else {
require(refundable(epochs[i], msg.sender), "Not eligible for refund");
addedReward = ledger[epochs[i]][msg.sender].amount;
}
ledger[epochs[i]][msg.sender].claimed = true;
reward += addedReward;
emit Claim(msg.sender, epochs[i], addedReward);
}
if (reward > 0) {
_safeTransfeTokens(tokens, address(msg.sender), reward);
}
}
其他问题
- 如果没有人进入相反的预测会发生什么?
如果一轮中只有一方持仓,那么该方就输了,损失的资金将被送到总奖池。
例如:用户A进入向上位置,没有其他人进入向下位置。用户A输了,并且没有相反的头寸可供支付奖金。资金被送到总奖池。 - 如果锁定价格和收盘价格完全相同,会发生什么情况?
在锁定价格与收盘价格完全相同的极少数情况下,没有人获胜,所有进入头寸的资金都将被送到财政部,用于烧掉蛋糕回购。 - 我可以改变或取消我的竞猜吗?
不,一旦你进入一个位置,你就不能改变方向
笔者整理了常见的一些智能合约并进行分类,如有需要请自取。
点击跳转