Pitaya (Hylocereus) is the most economically important fleshy-fruited tree of the Cactaceae family that is grown worldwide, and it has attracted significant attention because of its betalain-abundant fruits. Nonetheless, the lack of a pitaya reference genome significantly hinders studies focused on its evolution, as well as the potential for genetic improvement of this crop. Herein, we employed various sequencing approaches, namely, PacBio-SMRT, Illumina HiSeq paired-end, 10× Genomics, and Hi-C (high-throughput chromosome conformation capture) to provide a chromosome-level genomic assembly of ‘GHB’ pitaya (H. undatus, 2n = 2x = 22 chromosomes). The size of the assembled pitaya genome was 1.41 Gb, with a scaffold N50 of ~127.15 Mb. In total, 27,753 protein-coding genes and 896.31 Mb of repetitive sequences in the H. undatus genome were annotated. Pitaya has undergone a WGT (whole-genome triplication), and a recent WGD (whole-genome duplication) occurred after the gamma event, which is common to the other species in Cactaceae. A total of 29,328 intact LTR-RTs (~696.45 Mb) were obtained in H. undatus, of which two significantly expanded lineages, Ty1/copia and Ty3/gypsy, were the main drivers of the expanded genome. A high-density genetic map of F1 hybrid populations of ‘GHB’ × ‘Dahong’ pitayas (H. monacanthus) and their parents were constructed, and a total of 20,872 bin markers were identified (56,380 SNPs) for 11 linkage groups. More importantly, through transcriptomic and WGCNA (weighted gene coexpression network analysis), a global view of the gene regulatory network, including structural genes and the transcription factors involved in pitaya fruit betalain biosynthesis, was presented. Our data present a valuable resource for facilitating molecular breeding programs of pitaya and shed novel light on its genomic evolution, as well as the modulation of betalain biosynthesis in edible fruits.