Cyclodextrin-based nanosponges are cross-linked polymeric porous nanomaterials obtained by condensation of cyclodextrins with a polyfunctional reagent (cross-linker). Owing to their high surface area, they are attractive for encapsulation applications aimed at increasing the stability, solubility, and bioavailability of drugs. Due to the structural complexity of these emerging materials, computer modeling can provide atomistic-level insights into both the flexibility of nanosponges and their interactions with encapsulated drugs. In this contribution, we focus on nanosponges of β-cyclodextrin cross-linked with citric acid and provide full-atom models for linear and cyclic topologies. We use extensive molecular dynamics (MD) simulations to analyze the flexibility of these constructs and their interactions with encapsulated melatonin, a neurohormone involved in sleep-wake cycle regulation also used as an antioxidant and immunomodulator. We characterize the main interactions responsible for melatonin binding and show that it benefits from multivalence and crowding effects.