Hello!

I'm looking for a movie of 80's or 90's, where a young boy had a friend who using a magic formula could miniaturize.
He lived in a hole in the wall of the house. There is also a dangerous rat who was terrorizing.

Thank you for your help!