Contract Exchange System Development | Digital Currency Contract Exchange Construction

The contract trading system is a digital asset derivative product. Users can determine the rise and fall, choose to buy long or sell short contracts to obtain the benefits of digital asset prices. The contract trading system uses a price difference delivery model. When the contract expires, all open positions will be closed at the arithmetic average price of the last period of index price instead of physical delivery.
What are the types of contract trading systems?
1. Spot contract
The transaction method in which standardized spot contracts are the subject matter, and collective auction transactions are conducted through the trading platform for unified transaction, transfer, and settlement, and the price quotation is displayed in real time. The essence of spot contract transactions is to serve the modern trading industry by financial means.
2. Futures contracts
Futures trading is an advanced trading method developed based on spot trading and forward contract trading as the prototype. It refers to the form of buying and selling futures contracts in the form of open competition through brokers in the commodity exchanges for the transfer of market price fluctuation risks, and for those high-volume homogeneous commodities.
3. CFDs
generally refer to not involving The exchange of physical commodities or securities is a transaction method in which only the difference between the settlement price and the contract price is settled in cash.
4. Futures leveraged contracts
Futures leverage means that futures are traded on margin. For 10% of margin, it is 10 times leverage. There are many leverages of 20 times and 100 times on the market. The greater the multiple, the greater the risk.

   function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private {
    users[referrerAddress].x3Matrix[level].referrals.push(userAddress);

    if (users[referrerAddress].x3Matrix[level].referrals.length < 3) {
        emit NewUserPlace(userAddress, referrerAddress, 1, level, uint8(users[referrerAddress].x3Matrix[level].referrals.length));
        return sendETHDividends(referrerAddress, userAddress, 1, level);
    }
    
    emit NewUserPlace(userAddress, referrerAddress, 1, level, 3);
    //close matrix
    users[referrerAddress].x3Matrix[level].referrals = new address[](0);
    if (!users[referrerAddress].activeX3Levels[level+1] && level != LAST_LEVEL) {
        users[referrerAddress].x3Matrix[level].blocked = true;
    }

    //create new one by recursion
    if (referrerAddress != owner) {
        //check referrer active level
        address freeReferrerAddress = findFreeX3Referrer(referrerAddress, level);
        if (users[referrerAddress].x3Matrix[level].currentReferrer != freeReferrerAddress) {
            users[referrerAddress].x3Matrix[level].currentReferrer = freeReferrerAddress;
        }
        
        users[referrerAddress].x3Matrix[level].reinvestCount++;
        emit Reinvest(referrerAddress, freeReferrerAddress, userAddress, 1, level);
        updateX3Referrer(referrerAddress, freeReferrerAddress, level);
    } else {
        sendETHDividends(owner, userAddress, 1, level);
        users[owner].x3Matrix[level].reinvestCount++;
        emit Reinvest(owner, address(0), userAddress, 1, level);
    }
}

Guess you like

Origin blog.csdn.net/m0_51754086/article/details/109285725