javascript-projects / Above SIHP Production.html
Above SIHP Production.html
Raw
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <title>Production Above SIHP</title>
	<link rel="shortcut icon" type="image/png" href="faviconimg/favicon.png">
  </head>
  <body class="text-light bg-dark">
    <div class="container py-4">
      <div class="row">
        <div class="col-12">
          <div class="alert alert-success mb-3 text-break">
            <h2>Donation</h2>
            <p>You liked the project and are using it? Consider donating any value, it will mean a lot to me! Thanks!</p>
            <p><b>0x487D1a65b0317a1b3EB8923A95Ab0CF3b04Ed3dD</b></p>
          </div>

          <form action="#" id="get_info_momos" class="row">
            <div class="col-12 mb-2">
              <label for="mboxPriceInUSD">MBOX price in USD:</label>
              <label id="mboxPriceInUSD"></label>
            </div>
            <div class="col-12 col-lg-4 form-group">
              <label for="resourcesPerHundredProdPerDayRARE">Resources mined for every 100 Production Rare:</label>
              <input class="form-control" type="number" id="resourcesPerHundredProdPerDayRARE" placeholder="MBOX Mining every 100 Hash Rare" step="0.01" />
            </div>
			<div class="col-12 col-lg-4 form-group">
              <label for="resourcesPerHundredProdPerDayEPIC">Resources mined for every 100 Production Epic:</label>
              <input class="form-control" type="number" id="resourcesPerHundredProdPerDayEPIC" placeholder="MBOX Mining every 100 Hash Epic" step="0.01" />
            </div>
            <div class="col-12 col-lg-4 form-group">
              <label for="maxShow">Enter the maximum number of records to display:</label>
              <input class="form-control" type="number" id="maxShow" placeholder="Enter the maximum number of records to display" value="10" />
            </div>
            <div class="col-12 col-lg-6 form-group">
              <label for="maxPrice">Enter the maximum price you want to pay:</label>
              <input class="form-control" type="number" id="maxPrice" placeholder="Enter the maximum price you want to pay" value="0" />
            </div>
            <div class="col-12 col-lg-6 form-group">
              <label for="momoRarity">Choose the rarity of momo:</label>
              <select id="momoRarity" class="custom-select">		  
                <option value="">All</option>
                <option value="1">Common</option>
                <option value="2">Uncommon</option>
                <option value="3">Unique</option>
                <option value="4">Rare</option>					
                <option value="5">Epic</option>
                <option value="6">Legendary</option>
              </select>
            </div>
            <div class="col-12 form-group">
              <div class="form-check">
                <input class="form-check-input" type="checkbox" id="observarMercado" checked value="1" />
                <label for="observarMercado" class="form-check-label">Activate market observation</label>
              </div>
            </div>
            <div class="col-12 mb-4">
              <input class="btn btn-primary" type="submit" value="Send" />
            </div>
          </form>
        </div>

        <div class="col-12">
          <div id="app"></div>
        </div>
      </div>
    </div>

    <script>
      function compareMediaPriceHash(a, b) {
        if (parseFloat(a.mediaPriceHash) < parseFloat(b.mediaPriceHash)) {
          return -1;
        }
        if (parseFloat(a.mediaPriceHash) > parseFloat(b.mediaPriceHash)) {
          return 1;
        }
        return 0;
      }

      function getTotalHashPowerInGame(){
        const totalRareResourceDistributionDaily = 50000;
        const totalRareProductionInGame = 3860000 ;
		const totalEpicResourceDistributionDaily = 20000;
        const totalEpicProductionInGame = 2460000 ;

        $.ajax({
          type: "GET",
          url: `https://nftapi.mobox.io/rank/hashrate?page=1&limit=1000000`,
          success: function (response) {
            if(response.list.length > 0){
              totalHashPowerInGame = 0;

              response.list.forEach(element => {
                totalHashPowerInGame += parseInt(element.score);
              });

              const resourcesPerHundredProdPerDayRARE = Math.floor((totalRareResourceDistributionDaily / totalRareProductionInGame * 100) * 100) / 100;
			  const resourcesPerHundredProdPerDayEPIC = Math.floor((totalEpicResourceDistributionDaily / totalEpicProductionInGame * 100) * 100) / 100;

			  
              
              $("#resourcesPerHundredProdPerDayRARE").val(resourcesPerHundredProdPerDayRARE);
              $("#resourcesPerHundredProdPerDayEPIC").val(resourcesPerHundredProdPerDayEPIC);			  
            }
          },
        });
      }
	function getKidPrice(momocode,tokenid,rarity){
	var classkidprice = ".momo-"+tokenid+"-"+rarity;
	$.ajax({
		type: "GET",
		url: "https://nftapi.mobox.io/auction/search/BNB?page=1&limit=1&category=&vType=4&sort=price&pType="+momocode,
		success: function (response) {
			//console.log(momocode)
			let kids = response.list;
			if (typeof kids !== 'undefined'){
				kids.forEach((kid, key) => {
					
					var kidpri = kid.startPrice / 1000000000;
					$(classkidprice).text("$"+kidpri.toFixed(2));
					//console.log(classkidprice);
				});
			}
		},
		error: function(response) {
			//console.log(response)
		}
	});
  }

      jQuery(document).ready(function ($) {
        $(".close").click(function(e){
          e.preventDefault();
          $(this).parents('.alert-dismissible').fadeOut();
        });

        getTotalHashPowerInGame();

        let firstLoad = true;

        $("#get_info_momos").on("submit", function (e) {
          e.preventDefault();

          const $thisForm = $(this);
		
		$.ajax({
            type: "GET",
            url: "https://nftapi.mobox.io/gem_auction/search/BNB?page=1&limit=1&type=&level=&sort=price&filter=4",
            success: function (response) {
				let ListMec = response.list;
				ListMec.forEach((mec, key) => {
				
					var mecPriceOfAmount = mec.price / 1000000000;
					var mecAmount = mec.amounts;
					mecPricePerUSD = mecPriceOfAmount/mecAmount;
					
					console.log((mecPricePerUSD).toFixed(4))
				
                    ListMec[key].mecPricePerUSD = mecPricePerUSD.toFixed(4);			
				});	
				
          $.ajax({
            type: "GET",
            url: "https://api.coingecko.com/api/v3/simple/price?ids=mobox&vs_currencies=usd",
            success: function (response) {
              $("#mboxPriceInUSD").html(response.mobox.usd);

              const resourcesPerHundredProdPerDayRARE = $("#resourcesPerHundredProdPerDayRARE").val() / 100;
              const resourcesPerHundredProdPerDayEPIC = $("#resourcesPerHundredProdPerDayEPIC").val() / 100;
			  
              const rareResourcePriceInMBOX = 0.1508 ;
			  const epicResourcePriceInMBOX = 0.38 ;
			  const mboxPriceInUSD = response.mobox.usd;

              const maxLimit = 100000;
              const maxShow = $("#maxShow").val();
              const maxPrice = $("#maxPrice").val();
              const momoRarity = $("#momoRarity").val();

              const daysRequiredForMoneyBack = $("#daysRequiredForMoneyBack").val();

              $thisForm.find("input, select").attr("disabled", true);

              if(firstLoad){
                firstLoad = false;
                $("#app").html("<i class='fas fa-spinner fa-spin'></i>");
              }

              $.ajax({
                type: "GET",
				url: "https://nftapi.mobox.io/auction/search/BNB?page=1&limit=" + maxLimit + "&category=&vType=" + momoRarity + "&sort=-time&pType=",
                success: function (response) {
                  $thisForm.find("input, select").attr("disabled", false);

                  let momosList = response.list;

                  momosList.forEach((momo, key) => {
				  	momocode = 	momo.prototype;
                    const momoPrice = momo.nowPrice / 1000000000;
                    const momoHashPower = momo.lvHashrate;
					
					const momoBHashPower = momo.hashrate;
					
					let momolevel = momo.level;
					
					const momoProduction = (momo.hashrate * 10 + momo.lvHashrate) ;
					
                    const quality = momo.quality;
                    let mediaPriceHash = 99999;

                    const mboxGeneratedDailyRARE = resourcesPerHundredProdPerDayRARE * momoProduction * rareResourcePriceInMBOX;
                    const usdPerDayRARE = (mboxGeneratedDailyRARE * mboxPriceInUSD * 0.95);
					
                    const mboxGeneratedDailyEPIC = resourcesPerHundredProdPerDayEPIC * momoProduction * epicResourcePriceInMBOX;
                    const usdPerDayEPIC = (mboxGeneratedDailyEPIC * mboxPriceInUSD * 0.95);					

                    const momoProductionWithSet = (momo.hashrate * 10 + momo.lvHashrate + 666) ;
                    const resourcesGeneratedDailyWithSet = resourcesPerHundredProdPerDayRARE * momoProductionWithSet;
					const resourcesGeneratedDailyEPIC = resourcesPerHundredProdPerDayEPIC * momoProduction;
					const mboxPerDayRAREWithSet = (resourcesGeneratedDailyWithSet * rareResourcePriceInMBOX * 0.95);
                    const usdPerDayRAREWithSet = (resourcesGeneratedDailyWithSet * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95);

                    const daysToRecoupPriceRARE = (momoPrice / usdPerDayRARE).toFixed(2);
                    const apyToRecoupPriceRARE = (usdPerDayRARE * 100 / momoPrice * 365).toFixed(2);
					
                    const daysToRecoupPriceEPIC = (momoPrice / usdPerDayEPIC).toFixed(2);
                    const apyToRecoupPriceEPIC = (usdPerDayEPIC * 100 / momoPrice * 365).toFixed(2);					

                    const roiWithSetInDays = ((momoPrice + 30) / usdPerDayRAREWithSet).toFixed(2);
					const roiWithEpicInDays = ((momoPrice) / usdPerDayEPIC).toFixed(2);
                    const apyToRecoupPriceRAREWithSet = (usdPerDayRAREWithSet * 100 / (momoPrice + 30) * 365).toFixed(2);
					
					dif180 = 0
					dif210 = 0
					dif240 = 0
					dif270 = 0
					dif300 = 0
					dif330 = 0
					dif360 = 0
					dif390 = 0
					let sihpROIr180 = ""
					let sihpROIr210 = ""
					let sihpROIr240 = ""
					let sihpROIr270 = ""
					let sihpROIr300 = ""
					let sihpROIr330 = ""
					let sihpROIr360 = ""
					let sihpROIr390 = ""

					const SIHPe330 = 240;
					const hpAtSIHPe = Math.floor((momolevel  + 1)*(0.5*SIHPe330+25)-50)+ Math.floor((7.5+3*SIHPe330/20)*(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));

                   if (momo.category == 5) {
				   
				   momoProductionAtSIHP = momoProduction
				if (momo.hashrate < SIHPe330) {
					var mecNeededToSIHP = ((((SIHPe330-26)*((SIHPe330-26)+1)/2)-((momoBHashPower-26)*((momoBHashPower-26)+1)/2)))*2;;				
					var mecCostToSIHP = (mecNeededToSIHP*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHP = (Number(momoPrice)+Number(mecCostToSIHP)).toFixed(2);
					
					
					momoProductionAtSIHP = (SIHPe330 * 10 + hpAtSIHPe) ;
					costPerProdSIHP = (totalPriceAtSIHP/momoProductionAtSIHP).toFixed(3);
					sihpROI = ((totalPriceAtSIHP) / (momoProductionAtSIHP * resourcesPerHundredProdPerDayEPIC * epicResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					
					}
					}
					
                   if (momo.category >= 1 && momo.category <= 4) {
				   
				   
					familyPrice = 30;
					SIHPr180 = 135;
					SIHPr210 = 140;				   
					SIHPr240 = 150;
					SIHPr270 = 155;
					SIHPr300 = 165;
					SIHPr330 = 170;
					SIHPr360 = 180;
					SIHPr390 = 185;					

				if (momo.hashrate < SIHPr180) {
					str180days = `180day= ${SIHPr180}hp`;
					var mecNeededToSIHPr180 = ((((SIHPr180-9)*((SIHPr180-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr180 = (mecNeededToSIHPr180*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr180 = (Number(momoPrice)+Number(mecCostToSIHPr180)).toFixed(2);

					const hpAtSIHPr180 = Math.floor((momolevel  + 1)*(0.5*SIHPr180+15)-30)+ Math.floor((3+SIHPr180/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr180 = (SIHPr180 * 10 + hpAtSIHPr180 + 666) ;
					costPerProdSIHPr180 = ((Number(totalPriceAtSIHPr180)+familyPrice)/momoProductionAtSIHPr180).toFixed(3);
					sihpROIr180 = ((totalPriceAtSIHPr180 +familyPrice) / (momoProductionAtSIHPr180 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif180 = (sihpROIr180-180).toFixed(2);					
					}
				if (momo.hashrate < SIHPr210) {
					str210days = `210day= ${SIHPr210}hp`;
					var mecNeededToSIHPr210 = ((((SIHPr210-9)*((SIHPr210-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr210 = (mecNeededToSIHPr210*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr210 = (Number(momoPrice)+Number(mecCostToSIHPr210)).toFixed(2);

					const hpAtSIHPr210 = Math.floor((momolevel  + 1)*(0.5*SIHPr210+15)-30)+ Math.floor((3+SIHPr210/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr210 = (SIHPr210 * 10 + hpAtSIHPr210 + 666) ;
					costPerProdSIHPr210 = ((Number(totalPriceAtSIHPr210)+familyPrice)/momoProductionAtSIHPr210).toFixed(3);
					sihpROIr210 = ((totalPriceAtSIHPr210 +familyPrice) / (momoProductionAtSIHPr210 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif210 = (sihpROIr210-210).toFixed(2);					
					}
				if (momo.hashrate < SIHPr240) {
					str240days = `240day= ${SIHPr240}hp`;
					var mecNeededToSIHPr240 = ((((SIHPr240-9)*((SIHPr240-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr240 = (mecNeededToSIHPr240*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr240 = (Number(momoPrice)+Number(mecCostToSIHPr240)).toFixed(2);

					const hpAtSIHPr240 = Math.floor((momolevel  + 1)*(0.5*SIHPr240+15)-30)+ Math.floor((3+SIHPr240/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr240 = (SIHPr240 * 10 + hpAtSIHPr240 + 666) ;
					costPerProdSIHPr240 = ((Number(totalPriceAtSIHPr240)+familyPrice)/momoProductionAtSIHPr240).toFixed(3);
					sihpROIr240 = ((totalPriceAtSIHPr240 +familyPrice) / (momoProductionAtSIHPr240 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif240 = (sihpROIr240-240).toFixed(2);					
					}				
				if (momo.hashrate < SIHPr270) {
					str270days = `270day= ${SIHPr270}hp`;
					var mecNeededToSIHPr270 = ((((SIHPr270-9)*((SIHPr270-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr270 = (mecNeededToSIHPr270*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr270 = (Number(momoPrice)+Number(mecCostToSIHPr270)).toFixed(2);

					const hpAtSIHPr270 = Math.floor((momolevel  + 1)*(0.5*SIHPr270+15)-30)+ Math.floor((3+SIHPr270/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr270 = (SIHPr270 * 10 + hpAtSIHPr270 + 666) ;
					costPerProdSIHPr270 = ((Number(totalPriceAtSIHPr270)+familyPrice)/momoProductionAtSIHPr270).toFixed(3);
					sihpROIr270 = ((totalPriceAtSIHPr270 +familyPrice) / (momoProductionAtSIHPr270 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif270 = (sihpROIr270-270).toFixed(2);					
					}					
				if (momo.hashrate < SIHPr300) {
					str300days = `300day= ${SIHPr300}hp`;
					var mecNeededToSIHPr300 = ((((SIHPr300-9)*((SIHPr300-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr300 = (mecNeededToSIHPr300*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr300 = (Number(momoPrice)+Number(mecCostToSIHPr300)).toFixed(2);

					const hpAtSIHPr300 = Math.floor((momolevel  + 1)*(0.5*SIHPr300+15)-30)+ Math.floor((3+SIHPr300/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr300 = (SIHPr300 * 10 + hpAtSIHPr300 + 666) ;
					costPerProdSIHPr300 = ((Number(totalPriceAtSIHPr300)+familyPrice)/momoProductionAtSIHPr300).toFixed(3);
					sihpROIr300 = ((totalPriceAtSIHPr300 +familyPrice) / (momoProductionAtSIHPr300 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif300 = (sihpROIr300-300).toFixed(2);					
					}									   				   
				if (momo.hashrate < SIHPr330) {
					str330days = `330day= ${SIHPr330}hp`;				
					var mecNeededToSIHPr330 = ((((SIHPr330-9)*((SIHPr330-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr330 = (mecNeededToSIHPr330*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr330 = (Number(momoPrice)+Number(mecCostToSIHPr330)).toFixed(2);

					const hpAtSIHPr330 = Math.floor((momolevel  + 1)*(0.5*SIHPr330+15)-30)+ Math.floor((3+SIHPr330/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr330 = (SIHPr330 * 10 + hpAtSIHPr330 + 666) ;
					costPerProdSIHPr330 = ((Number(totalPriceAtSIHPr330)+familyPrice)/momoProductionAtSIHPr330).toFixed(3);
					sihpROIr330 = ((totalPriceAtSIHPr330 +familyPrice) / (momoProductionAtSIHPr330 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif330 = (sihpROIr330-330).toFixed(2)					
					}
				if (momo.hashrate < SIHPr360) {
					str360days = `360day= ${SIHPr360}hp`;				
					var mecNeededToSIHPr360 = ((((SIHPr360-9)*((SIHPr360-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr360 = (mecNeededToSIHPr360*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr360 = (Number(momoPrice)+Number(mecCostToSIHPr360)).toFixed(2);

					const hpAtSIHPr360 = Math.floor((momolevel  + 1)*(0.5*SIHPr360+15)-30)+ Math.floor((3+SIHPr360/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr360 = (SIHPr360 * 10 + hpAtSIHPr360 + 666) ;
					costPerProdSIHPr360 = ((Number(totalPriceAtSIHPr360)+familyPrice)/momoProductionAtSIHPr360).toFixed(3);
					sihpROIr360 = ((totalPriceAtSIHPr360 +familyPrice) / (momoProductionAtSIHPr360 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif360 = (sihpROIr360-360).toFixed(2)					
					}	
				if (momo.hashrate < SIHPr390) {
					str390days = `390day= ${SIHPr390}hp`;				
					var mecNeededToSIHPr390 = ((((SIHPr390-9)*((SIHPr390-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr390 = (mecNeededToSIHPr390*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr390 = (Number(momoPrice)+Number(mecCostToSIHPr390)).toFixed(2);

					const hpAtSIHPr390 = Math.floor((momolevel  + 1)*(0.5*SIHPr390+15)-30)+ Math.floor((3+SIHPr390/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr390 = (SIHPr390 * 10 + hpAtSIHPr390 + 666) ;
					costPerProdSIHPr390 = ((Number(totalPriceAtSIHPr390)+familyPrice)/momoProductionAtSIHPr390).toFixed(3);
					sihpROIr390 = ((totalPriceAtSIHPr390 +familyPrice) / (momoProductionAtSIHPr390 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					dif390 = (sihpROIr390-390).toFixed(2)					
					}	

					var difArray = [dif180,dif210,dif240,dif270,dif300,dif330,dif360,dif390];
						
					var minimumDIF = Math.min(...difArray);					
					}
					
                    if (momosList[key].category == 5) {
                      mediaPriceHash = ((totalPriceAtSIHP) / (momoProductionAtSIHP * resourcesPerHundredProdPerDayEPIC * epicResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2);
                    }
					
                    if (momosList[key].category >= 1 && momosList[key].category <= 4) {
						if (momo.hashrate > sihpROIr240) {
							mediaPriceHash = (sihpROIr240);
						}
						else {
							mediaPriceHash = (sihpROIr390);
						}
                    }

                    momosList[key].mboxGeneratedDailyRARE = mboxGeneratedDailyRARE.toFixed(2);
                    momosList[key].mboxGeneratedDailyEPIC = mboxGeneratedDailyEPIC.toFixed(2);					
                    momosList[key].usdPerDayRARE = usdPerDayRARE.toFixed(2);
                    momosList[key].usdPerDayEPIC = usdPerDayEPIC.toFixed(2);
                    momosList[key].mediaPriceHash = mediaPriceHash;
					
                    momosList[key].daysToRecoupPriceRARE = daysToRecoupPriceRARE;
                    momosList[key].daysToRecoupPriceEPIC = daysToRecoupPriceEPIC;					
                    momosList[key].quality = quality;

                    momosList[key].resourcesGeneratedDailyWithSet = resourcesGeneratedDailyWithSet.toFixed(2);
                    momosList[key].resourcesGeneratedDailyEPIC = resourcesGeneratedDailyEPIC.toFixed(2);					
                    momosList[key].usdPerDayRAREWithSet = usdPerDayRAREWithSet.toFixed(2);
                    momosList[key].mboxPerDayRAREWithSet = mboxPerDayRAREWithSet.toFixed(2);					
                    momosList[key].roiWithSetInDays = roiWithSetInDays;
                    momosList[key].roiWithEpicInDays = roiWithEpicInDays;
                    momosList[key].apyToRecoupPriceRARE = apyToRecoupPriceRARE;
                    momosList[key].apyToRecoupPriceEPIC = apyToRecoupPriceEPIC;					
                    momosList[key].apyToRecoupPriceRAREWithSet = apyToRecoupPriceRAREWithSet;
                  });

                  momosList.sort(compareMediaPriceHash);

                  let cont = 0;

                  let htmlTableMomos = `
                    <div class="table-responsive">
                      <table class="table table-striped table-dark position-relative">
                        <thead>
                            <tr>
								<th>Hashpower</th>							
								<!--<th>Family Prices</th>-->
                                <th>Price</th>
								<th>Production</th>
								<th>Cost Per Prod</th>
                                <!--<th>MBOX/USD per day</th>-->
                                <th>Days to ROI</th>
                                <th>Days you need<br>but don't have</th>
                            </tr>
                        </thead>
                        <tbody>
                  `;

                  let daysToRoiIntRAREPrevious = daysRequiredForMoneyBack + 1;

                  momosList.forEach((momo) => {
                    const momoPrice = momo.nowPrice / 1000000000;
                    const momoPriceStr = (momo.nowPrice / 1000000000).toFixed(2) + " USD";
					const momoBHashPower = momo.hashrate;
                    const momoHashPower = momo.lvHashrate;
					let momolevel = momo.level;
					const momoProduction = (momo.hashrate * 10 + momo.lvHashrate) ; 
					const momoProductionWithSet = (momo.hashrate * 10 + momo.lvHashrate + 666) ;
                    const quality = momo.quality;
                    const mediaPriceHash = momo.mediaPriceHash;
                    const daysToRecoupPriceRARE = Math.ceil(parseFloat(momo.daysToRecoupPriceRARE)) + " Days";
                    const daysToRecoupPriceEPIC = Math.ceil(parseFloat(momo.daysToRecoupPriceEPIC)) + " Days";					
                    const apyToRecoupPriceRARE = momo.apyToRecoupPriceRARE + "%";
                    const apyToRecoupPriceEPIC = momo.apyToRecoupPriceEPIC + "%";					
                    const mboxGeneratedDailyRARE = momo.mboxGeneratedDailyRARE;
                    const mboxGeneratedDailyEPIC = momo.mboxGeneratedDailyEPIC;					
                    const usdPerDayRARE = momo.usdPerDayRARE;
                    const usdPerDayEPIC = momo.usdPerDayEPIC;					
					

                    const roiWithSetInDays = Math.ceil(parseFloat(momo.roiWithSetInDays)) + " Days";
					const roiWithEpicInDays = Math.ceil(parseFloat(momo.roiWithEpicInDays)) + " Days";
                    const apyToRecoupPriceRAREWithSet = momo.apyToRecoupPriceRAREWithSet + "%";
                    const resourcesGeneratedDailyWithSet = momo.resourcesGeneratedDailyWithSet;
                    const resourcesGeneratedDailyEPIC = momo.resourcesGeneratedDailyEPIC;	
                    const mboxPerDayRAREWithSet = momo.mboxPerDayRAREWithSet;					
                    const usdPerDayRAREWithSet = momo.usdPerDayRAREWithSet;

                    let daysToRoiIntRARE = Math.ceil(parseFloat(momo.daysToRecoupPriceRARE));
                    let daysToRoiIntEPIC = Math.ceil(parseFloat(momo.daysToRecoupPriceEPIC));	

					const costPerProdWithSet = ((momoPrice + 50) / momoProductionWithSet).toFixed(3);	
					
					let str150days = ""
					let str180days = ""
					let str210days = ""
					let str240days = ""
					let str270days = ""
					let str300days = ""
					let str330days = ""
					let str360days = ""
					let str390days = ""
					let strtotalPriceAtSIHPr150 = "" 
					let strtotalPriceAtSIHPr180 = "" 
					let strtotalPriceAtSIHPr210 = "" 
					let strtotalPriceAtSIHPr240 = "" 
					let strtotalPriceAtSIHPr270 = "" 
					let strtotalPriceAtSIHPr300 = "" 
					let strtotalPriceAtSIHPr330 = "" 
					let strtotalPriceAtSIHPr360 = "" 
					let strtotalPriceAtSIHPr390 = "" 
					let strmomoProductionAtSIHPr150 = ""
					let strmomoProductionAtSIHPr180 = ""
					let strmomoProductionAtSIHPr210 = ""
					let strmomoProductionAtSIHPr240 = ""
					let strmomoProductionAtSIHPr270 = ""
					let strmomoProductionAtSIHPr300 = ""
					let strmomoProductionAtSIHPr330 = ""
					let strmomoProductionAtSIHPr360 = ""
					let strmomoProductionAtSIHPr390 = ""	
					let strcostPerProdSIHPr150 = ""
					let strcostPerProdSIHPr180 = ""
					let strcostPerProdSIHPr210 = ""
					let strcostPerProdSIHPr240 = ""
					let strcostPerProdSIHPr270 = ""
					let strcostPerProdSIHPr300 = ""
					let strcostPerProdSIHPr330 = ""
					let strcostPerProdSIHPr360 = ""
					let strcostPerProdSIHPr390 = ""
					let strsihpROIr150 = ""
					let strsihpROIr180 = ""
					let strsihpROIr210 = ""
					let strsihpROIr240 = ""
					let strsihpROIr270 = ""
					let strsihpROIr300 = ""
					let strsihpROIr330 = ""
					let strsihpROIr360 = ""
					let strsihpROIr390 = ""
					let strdif150 = ""
					let strdif180 = ""
					let strdif210 = ""
					let strdif240 = ""
					let strdif270 = ""
					let strdif300 = ""
					let strdif330 = ""
					let strdif360 = ""
					let strdif390 = ""
					
                   if (momo.category == 5) {

					SIHPe330 = 240;				
				   
				if (momo.hashrate < SIHPe330) {
					str330days = `<br>330day= ${SIHPe330}hp`;
					var mecNeededToSIHP = ((((SIHPe330-26)*((SIHPe330-26)+1)/2)-((momoBHashPower-26)*((momoBHashPower-26)+1)/2)))*2;;				
					var mecCostToSIHP = (mecNeededToSIHP*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHP = (Number(momoPrice)+Number(mecCostToSIHP)).toFixed(2);
					
					strtotalPriceAtSIHPr330 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHP}`;

					const hpAtSIHPe = Math.floor((momolevel  + 1)*(0.5*SIHPe330+25)-50)+ Math.floor((7.5+3*SIHPe330/20)*(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHP = (SIHPe330 * 10 + hpAtSIHPe) ;
					strmomoProductionAtSIHPr330 = `<br>Prod at SIHP = ${momoProductionAtSIHPr330}`;
					costPerProdSIHP = (totalPriceAtSIHP/momoProductionAtSIHP).toFixed(3);
					strcostPerProdSIHPr330 = `<br>${costPerProdSIHPr330}`;
					sihpROI = ((totalPriceAtSIHP) / (momoProductionAtSIHP * resourcesPerHundredProdPerDayEPIC * epicResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr330 = `<br>${sihpROI}`;
					dif330 = (sihpROI-330).toFixed(2);
					strdif330 = `<br>${dif330}`;
					
					}
					}
					
                   if (momo.category >= 1 && momo.category <= 4) {	
				   
					familyPrice = 30;
					SIHPr150 = 125;
					SIHPr180 = 135;
					SIHPr210 = 140;				   
					SIHPr240 = 150;
					SIHPr270 = 155;
					SIHPr300 = 165;
					SIHPr330 = 170;
					SIHPr360 = 180;
					SIHPr390 = 185;	
					
				if (momo.hashrate < SIHPr150) {
					str150days = `<br>150day= ${SIHPr150}hp`;
					var mecNeededToSIHPr150 = ((((SIHPr150-9)*((SIHPr150-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr150 = (mecNeededToSIHPr150*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr150 = (Number(momoPrice)+Number(mecCostToSIHPr150)).toFixed(2);
					
					strtotalPriceAtSIHPr150 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr150}`;

					const hpAtSIHPr150 = Math.floor((momolevel  + 1)*(0.5*SIHPr150+15)-30)+ Math.floor((3+SIHPr150/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr150 = (SIHPr150 * 10 + hpAtSIHPr150 + 666) ;
					strmomoProductionAtSIHPr150 = `<br>Prod at SIHP = ${momoProductionAtSIHPr150}`;
					costPerProdSIHPr150 = ((Number(totalPriceAtSIHPr150)+familyPrice)/momoProductionAtSIHPr150).toFixed(3);
					strcostPerProdSIHPr150 = `<br>${costPerProdSIHPr150}`;
					sihpROIr150 = ((totalPriceAtSIHPr150 +familyPrice) / (momoProductionAtSIHPr150 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr150 = `<br>${sihpROIr150}`;
					dif150 = (sihpROIr150-150).toFixed(2);
					strdif150 = `<br>${dif150}`;
					
					}
				if (momo.hashrate < SIHPr180) {
					str180days = `<br>180day= ${SIHPr180}hp`;
					var mecNeededToSIHPr180 = ((((SIHPr180-9)*((SIHPr180-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr180 = (mecNeededToSIHPr180*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr180 = (Number(momoPrice)+Number(mecCostToSIHPr180)).toFixed(2);
					
					strtotalPriceAtSIHPr180 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr180}`;

					const hpAtSIHPr180 = Math.floor((momolevel  + 1)*(0.5*SIHPr180+15)-30)+ Math.floor((3+SIHPr180/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr180 = (SIHPr180 * 10 + hpAtSIHPr180 + 666) ;
					strmomoProductionAtSIHPr180 = `<br>Prod at SIHP = ${momoProductionAtSIHPr180}`;
					costPerProdSIHPr180 = ((Number(totalPriceAtSIHPr180)+familyPrice)/momoProductionAtSIHPr180).toFixed(3);
					strcostPerProdSIHPr180 = `<br>${costPerProdSIHPr180}`;
					sihpROIr180 = ((totalPriceAtSIHPr180 +familyPrice) / (momoProductionAtSIHPr180 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr180 = `<br>${sihpROIr180}`;
					dif180 = (sihpROIr180-180).toFixed(2);
					strdif180 = `<br>${dif180}`;
					
					}
				if (momo.hashrate < SIHPr210) {
					str210days = `<br>210day= ${SIHPr210}hp`;
					var mecNeededToSIHPr210 = ((((SIHPr210-9)*((SIHPr210-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr210 = (mecNeededToSIHPr210*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr210 = (Number(momoPrice)+Number(mecCostToSIHPr210)).toFixed(2);
					
					strtotalPriceAtSIHPr210 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr210}`;

					const hpAtSIHPr210 = Math.floor((momolevel  + 1)*(0.5*SIHPr210+15)-30)+ Math.floor((3+SIHPr210/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr210 = (SIHPr210 * 10 + hpAtSIHPr210 + 666) ;
					strmomoProductionAtSIHPr210 = `<br>Prod at SIHP = ${momoProductionAtSIHPr210}`;
					costPerProdSIHPr210 = ((Number(totalPriceAtSIHPr210)+familyPrice)/momoProductionAtSIHPr210).toFixed(3);
					strcostPerProdSIHPr210 = `<br>${costPerProdSIHPr210}`;
					sihpROIr210 = ((totalPriceAtSIHPr210 +familyPrice) / (momoProductionAtSIHPr210 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr210 = `<br>${sihpROIr210}`;
					dif210 = (sihpROIr210-210).toFixed(2);
					strdif210 = `<br>${dif210}`;				
					}
				if (momo.hashrate < SIHPr240) {
					str240days = `<br>240day= ${SIHPr240}hp`;
					var mecNeededToSIHPr240 = ((((SIHPr240-9)*((SIHPr240-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr240 = (mecNeededToSIHPr240*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr240 = (Number(momoPrice)+Number(mecCostToSIHPr240)).toFixed(2);
					
					strtotalPriceAtSIHPr240 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr240}`;

					const hpAtSIHPr240 = Math.floor((momolevel  + 1)*(0.5*SIHPr240+15)-30)+ Math.floor((3+SIHPr240/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr240 = (SIHPr240 * 10 + hpAtSIHPr240 + 666) ;
					strmomoProductionAtSIHPr240 = `<br>Prod at SIHP = ${momoProductionAtSIHPr240}`;
					costPerProdSIHPr240 = ((Number(totalPriceAtSIHPr240)+familyPrice)/momoProductionAtSIHPr240).toFixed(3);
					strcostPerProdSIHPr240 = `<br>${costPerProdSIHPr240}`;
					sihpROIr240 = ((totalPriceAtSIHPr240 +familyPrice) / (momoProductionAtSIHPr240 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr240 = `<br>${sihpROIr240}`;
					dif240 = (sihpROIr240-240).toFixed(2);
					strdif240 = `<br>${dif240}`;				
					}
				if (momo.hashrate < SIHPr270) {
					str270days = `<br>270day= ${SIHPr270}hp`;
					var mecNeededToSIHPr270 = ((((SIHPr270-9)*((SIHPr270-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr270 = (mecNeededToSIHPr270*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr270 = (Number(momoPrice)+Number(mecCostToSIHPr270)).toFixed(2);
					
					strtotalPriceAtSIHPr270 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr270}`;

					const hpAtSIHPr270 = Math.floor((momolevel  + 1)*(0.5*SIHPr270+15)-30)+ Math.floor((3+SIHPr270/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr270 = (SIHPr270 * 10 + hpAtSIHPr270 + 666) ;
					strmomoProductionAtSIHPr270 = `<br>Prod at SIHP = ${momoProductionAtSIHPr270}`;
					costPerProdSIHPr270 = ((Number(totalPriceAtSIHPr270)+familyPrice)/momoProductionAtSIHPr270).toFixed(3);
					strcostPerProdSIHPr270 = `<br>${costPerProdSIHPr270}`;
					sihpROIr270 = ((totalPriceAtSIHPr270 +familyPrice) / (momoProductionAtSIHPr270 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr270 = `<br>${sihpROIr270}`;
					dif270 = (sihpROIr270-270).toFixed(2);
					strdif270 = `<br>${dif270}`;				
					}					
				if (momo.hashrate < SIHPr300) {
					str300days = `<br>300day= ${SIHPr300}hp`;
					var mecNeededToSIHPr300 = ((((SIHPr300-9)*((SIHPr300-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr300 = (mecNeededToSIHPr300*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr300 = (Number(momoPrice)+Number(mecCostToSIHPr300)).toFixed(2);
					
					strtotalPriceAtSIHPr300 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr300}`;

					const hpAtSIHPr300 = Math.floor((momolevel  + 1)*(0.5*SIHPr300+15)-30)+ Math.floor((3+SIHPr300/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));							
					
					momoProductionAtSIHPr300 = (SIHPr300 * 10 + hpAtSIHPr300 + 666) ;
					strmomoProductionAtSIHPr300 = `<br>Prod at SIHP = ${momoProductionAtSIHPr300}`;
					costPerProdSIHPr300 = ((Number(totalPriceAtSIHPr300)+familyPrice)/momoProductionAtSIHPr300).toFixed(3);
					strcostPerProdSIHPr300 = `<br>${costPerProdSIHPr300}`;
					sihpROIr300 = ((totalPriceAtSIHPr300 +familyPrice) / (momoProductionAtSIHPr300 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr300 = `<br>${sihpROIr300}`;
					dif300 = (sihpROIr300-300).toFixed(2);
					strdif300 = `<br>${dif300}`;				
					}									   				   
				if (momo.hashrate < SIHPr330) {
					str330days = `<br>330day= ${SIHPr330}hp`;				
					var mecNeededToSIHPr330 = ((((SIHPr330-9)*((SIHPr330-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr330 = (mecNeededToSIHPr330*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr330 = (Number(momoPrice)+Number(mecCostToSIHPr330)).toFixed(2);
					
					strtotalPriceAtSIHPr330 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr330}`;

					const hpAtSIHPr330 = Math.floor((momolevel  + 1)*(0.5*SIHPr330+15)-30)+ Math.floor((3+SIHPr330/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr330 = (SIHPr330 * 10 + hpAtSIHPr330 + 666) ;
					strmomoProductionAtSIHPr330 = `<br>Prod at SIHP = ${momoProductionAtSIHPr330}`;
					costPerProdSIHPr330 = ((Number(totalPriceAtSIHPr330)+familyPrice)/momoProductionAtSIHPr330).toFixed(3);
					strcostPerProdSIHPr330 = `<br>${costPerProdSIHPr330}`;
					sihpROIr330 = ((totalPriceAtSIHPr330 +familyPrice) / (momoProductionAtSIHPr330 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr330 = `<br>${sihpROIr330}`;
					dif330 = (sihpROIr330-330).toFixed(2);
					strdif330 = `<br>${dif330}`;				
					}
				if (momo.hashrate < SIHPr360) {
					str360days = `<br>360day= ${SIHPr360}hp`;				
					var mecNeededToSIHPr360 = ((((SIHPr360-9)*((SIHPr360-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr360 = (mecNeededToSIHPr360*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr360 = (Number(momoPrice)+Number(mecCostToSIHPr360)).toFixed(2);
					
					strtotalPriceAtSIHPr360 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr360}`;

					const hpAtSIHPr360 = Math.floor((momolevel  + 1)*(0.5*SIHPr360+15)-30)+ Math.floor((3+SIHPr360/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr360 = (SIHPr360 * 10 + hpAtSIHPr360 + 666) ;
					strmomoProductionAtSIHPr360 = `<br>Prod at SIHP = ${momoProductionAtSIHPr360}`;
					costPerProdSIHPr360 = ((Number(totalPriceAtSIHPr360)+familyPrice)/momoProductionAtSIHPr360).toFixed(3);
					strcostPerProdSIHPr360 = `<br>${costPerProdSIHPr360}`;
					sihpROIr360 = ((totalPriceAtSIHPr360 +familyPrice) / (momoProductionAtSIHPr360 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr360 = `<br>${sihpROIr360}`;
					dif360 = (sihpROIr360-360).toFixed(2);
					strdif360 = `<br>${dif360}`;				
					}	
				if (momo.hashrate < SIHPr390) {
					str390days = `<br>390day= ${SIHPr390}hp`;				
					var mecNeededToSIHPr390 = ((((SIHPr390-9)*((SIHPr390-9)+1)/2)-((momoBHashPower-9)*((momoBHashPower-9)+1)/2)));				
					var mecCostToSIHPr390 = (mecNeededToSIHPr390*mecPricePerUSD).toFixed(2);
					var totalPriceAtSIHPr390 = (Number(momoPrice)+Number(mecCostToSIHPr390)).toFixed(2);
					
					strtotalPriceAtSIHPr390 = `<br>Cost of MEC+MOMO=${totalPriceAtSIHPr390}`;

					const hpAtSIHPr390 = Math.floor((momolevel  + 1)*(0.5*SIHPr390+15)-30)+ Math.floor((3+SIHPr390/10)    *(Math.floor((momolevel /5))*(Math.floor((momolevel /5)+1)*0.5)));					
					
					momoProductionAtSIHPr390 = (SIHPr390 * 10 + hpAtSIHPr390 + 666) ;
					strmomoProductionAtSIHPr390 = `<br>Prod at SIHP = ${momoProductionAtSIHPr390}`;
					costPerProdSIHPr390 = ((Number(totalPriceAtSIHPr390)+familyPrice)/momoProductionAtSIHPr390).toFixed(3);
					strcostPerProdSIHPr390 = `<br>${costPerProdSIHPr390}`;
					sihpROIr390 = ((totalPriceAtSIHPr390 +familyPrice) / (momoProductionAtSIHPr390 * resourcesPerHundredProdPerDayRARE * rareResourcePriceInMBOX * mboxPriceInUSD * 0.95)).toFixed(2)
					strsihpROIr390 = `<br>${sihpROIr390}`;
					dif390 = (sihpROIr390-390).toFixed(2);
					strdif390 = `<br>${dif390}`;					
					}	

					var difArray = [dif180,dif210,dif240,dif270,dif300,dif330,dif360,dif390];
						
					var minimumDIF = Math.min(...difArray);					
					}
                    if (cont < maxShow && (momoPrice <= maxPrice || maxPrice <= 0)) {
                      cont++;

                      let strGeneratedPerDayWithSet = "";
					  let strGeneratedPerDayWithRare = "";
                      let strGeneratedPerDayEPIC = "";					  
                      let strGeneratedPerMonthWithSet = "";
					  let strMomoProductionWithSet = "";
					  let strDaysToRecoupPriceRARE ="";
                      let DaysRoiWithSet = "";
					  let DaysRoiWithEPIC = "";
                      let apyRecuperarWithSet = "";

					  if (momo.category >= 5) {
					    daysToRoiIntEPIC = Math.ceil(parseFloat(momo.roiWithEpicInDays));
					  
					    strGeneratedPerDayEPIC = `EPIC = ${resourcesGeneratedDailyEPIC} Resources / ${usdPerDayEPIC} USD`;
						
						DaysRoiWithEPIC = `${roiWithEpicInDays}`;
					  }
					  
                      if (momo.category >= 1 && momo.category <= 4) {
                        daysToRoiIntRARE = Math.ceil(parseFloat(momo.roiWithSetInDays));

                        strGeneratedPerDayWithSet = `<br>W/ SET = ${resourcesGeneratedDailyWithSet} Resources / ${mboxPerDayRAREWithSet} MBOX / ${usdPerDayRAREWithSet} USD`;
						
						strGeneratedPerDayWithRare = `No Set = ${mboxGeneratedDailyRARE} MBOX / ${usdPerDayRARE} USD`;

                        strGeneratedPerMonthWithSet = `<br>W/ SET = ${(resourcesGeneratedDailyWithSet * 30).toFixed(2)} Resources / ${(usdPerDayRAREWithSet * 30).toFixed(2)} USD`;
						
						strMomoProductionWithSet = `W/ SET = ${momoProductionWithSet}`;
						
						strDaysToRecoupPriceRARE = `${daysToRecoupPriceRARE}`;

                        DaysRoiWithSet = `W/ SET = <br>${roiWithSetInDays}`;

                        apyRecuperarWithSet = `W/ SET = ${apyToRecoupPriceRAREWithSet}`;
                      }
					  
					  
					  if (momo.category == 4){
									fam = `<div class="card__precis">
												<div>
													<span class="card__preci momo-${momo.tokenId}-1">$-</span>
												</div>
												<div>
													<span class="card__preci momo-${momo.tokenId}-2">$-</span>
												</div>
												<div>
													<span class="card__preci momo-${momo.tokenId}-3">$-</span>
												</div>
											</div>`;


									var famcode = momo.prototype.toString().substring(1);
									for (var i=1;i<=3 ;i++ ) {
										getKidPrice(i+famcode,momo.tokenId,i);
									}
					    }
						
					    if (costPerProdSIHPr240 <= 0.17) {
							function playSound () {
								let ding = new Audio('chirpLV.mp3');
								ding.play();								
							}
							playSound();
					    }
						
							
                      htmlTableMomos += `
                        <tr>
                            <td>Level=${momolevel}<br>Base=${momoBHashPower}<br>HP=${momoHashPower}<br>${str150days}${str180days}${str210days}${str240days}${str270days}${str300days}${str330days}${str360days}${str390days}</td>							
							<!--<td>
							<div><span class="card__preci momo-${momo.tokenId}-1">$-</span></div>
							<div><span class="card__preci momo-${momo.tokenId}-2">$-</span></div>
							<div><span class="card__preci momo-${momo.tokenId}-3">$-</span></div>
							</td>-->
                            <td>${momoPriceStr}<br><br><br>${strtotalPriceAtSIHPr150}${strtotalPriceAtSIHPr180}${strtotalPriceAtSIHPr210}${strtotalPriceAtSIHPr240}${strtotalPriceAtSIHPr270}${strtotalPriceAtSIHPr300}${strtotalPriceAtSIHPr330}${strtotalPriceAtSIHPr360}${strtotalPriceAtSIHPr390}</td>						
							<td>${strMomoProductionWithSet}<br><br><br>${strmomoProductionAtSIHPr150}${strmomoProductionAtSIHPr180}${strmomoProductionAtSIHPr210}${strmomoProductionAtSIHPr240}${strmomoProductionAtSIHPr270}${strmomoProductionAtSIHPr300}${strmomoProductionAtSIHPr330}${strmomoProductionAtSIHPr360}${strmomoProductionAtSIHPr390}</td>
							<td>$${costPerProdWithSet}<br><br><br>${strcostPerProdSIHPr150}${strcostPerProdSIHPr180}${strcostPerProdSIHPr210}<b>${strcostPerProdSIHPr240}</b>${strcostPerProdSIHPr270}${strcostPerProdSIHPr300}${strcostPerProdSIHPr330}${strcostPerProdSIHPr360}${strcostPerProdSIHPr390}</td>
                            <!--<td>${strGeneratedPerDayWithRare}${strGeneratedPerDayWithSet}${strGeneratedPerDayEPIC}</td>-->
                            <td>${DaysRoiWithSet}${DaysRoiWithEPIC}<br><br>${strsihpROIr150}${strsihpROIr180}${strsihpROIr210}<b>${strsihpROIr240}</b>${strsihpROIr270}${strsihpROIr300}${strsihpROIr330}${strsihpROIr360}${strsihpROIr390}</td>
                            <td>${minimumDIF}<br><br><br>${strdif150}${strdif180}${strdif210}${strdif240}${strdif270}${strdif300}${strdif330}${strdif360}${strdif390}</td>
                        </tr>
                      `;
                    }
                  });

                  htmlTableMomos += `
                        </tbody>
                      </table>
                    </div>
                  `;

                  $("#app").html(htmlTableMomos);
					}		<!--MEC Price currly Here and right below-->
					});		<!--Again the MEC price ajax above is what these are for here -->				  
                },
              });
            },
            error: function () {
              $("#app").html("It was not possible to see the MBOX price in USD");
            },
          });
        });

        setTimeout(function () {
          $("#get_info_momos").submit();
        }, 3000);

        setInterval(function () {
          if ($("#observarMercado").is(":checked")) {
            $("#get_info_momos").submit();
          }
        }, 10000);
      });
    </script>
  </body>
</html>