function recoverFunds(uint matchId) external {
        var m = matches[matchId];

        if (m.finalized || m.firstTradeTimestamp == 0) {
            return;
        }

        uint recoveryTimestamp = uint(m.firstTradeTimestamp) + ((matchId & 0xFF) * 7 * 86400);

        if (uint(block.timestamp) > recoveryTimestamp) {
            uint8 finalPrice = uint8((matchId & 0xFF00) >> 8);
            require(finalPrice <= 100);

            m.finalized = true;
            m.finalPrice = finalPrice;
            LogFinalizeMatch(matchId, finalPrice);
        }
    }