LoRaWAN is a promising solution for large-scale ultra low power IoT deployments, based on a very robust physical layer modulation, called LoRa, patented by Semtech. Even if the technology itself is quite mature and specified, the currently deployed wireless resource allocation strategies are still coarse and based on rough heuristics. In this talk, we present some peculiar characteristics of LoRa modulation, corroborated by experimental results, which make the resource allocation problem quite original and still prone to significant improvements. In particular, we discuss interference rejection capabilities and capture effects in LoRa modulations when using different Spreading Factors, as well as their implication for optimizing the system capacity. By means of a simple single-cell and multi-cell system model, we derive some conditions on the optimal allocations of Spreading Factors and propose an innovative “sequential waterfilling” strategy for assigning Spreading Factors to End-Devices (ED) in real network deployments. While retaining an extremely simple and scalable implementation, this strategy yields a significant improvement (up to 38%) in the network capacity over the Adaptive Data Rate (ADR) used by many network operators on the basis of the design suggested by the LoRa Alliance, and appears to be extremely robust to different operating/load conditions and network topology configurations.