Real Madrid have agreed a deal to sign Brazilian wonderkid Endrick on a five-year contract from Palmeiras, sources have told ESPN.