You’re right
You may file Form N-400, Application for Naturalization, 90 calendar days before you complete your permanent residence requirement if your eligibility for naturalization is based upon being a:
Permanent resident for at least 5 years; or
Permanent resident for at least 3 years if you are married to a US citizen.
To determine your 90-day early filing date, begin by identifying your 5-year or 3-year date as a permanent resident. For example, if the date on your Permanent Resident Card says “July 4, 2013,” you meet the 5-year permanent resident requirement on July 4, 2018.
If you have met all other eligibility requirements, the earliest date you may apply for naturalization would be April 5, 2018, which is 90 days before July 4, 2018.
You may use the USCIS Early Filing Calculator to ensure you file your Form N-400 within the 90-day window. We will deny your form if you file more than 90 days before your anniversary date.
https://www.uscis.gov/forms/uscis-early-filing-calculator