The EB-5 rules state that the investor must at the time of filing the I-526 petition either have already invested the funds or be in the process of investing the funds which means all the required funds of $500,000.00 must be held in escrow eg all funds held in escrow until I-526 is approved.
You need to be able to show how each dollar of the $500,000 was earned and transferred to the business. That is, the $500,000 must be in your possession before filing the I-526.