The Securities and Exchange Commission was in the middle of an examination of Knight Capital's risk-management systems just as the firm’s now-infamous trading error sparked a massive loss that nearly sunk the trading house, the FOX Business Network has learned.

The previously undisclosed news that the SEC had already begun to look at Knight’s risk management procedures -- and could have pointed out its possible shortcoming before the trading error -- adds a new twist to the unfolding story.

The examination involved Knight’s compliance with the SEC’s relatively new “Market Access” rule, implemented in the wake of the so-called flash crash of 2010, where the Dow Jones Industrial Average in a matter of minutes fell around 1,000 points, only to recover much of those losses soon after.

SEC officials were conducting what is known as a “sweep” that began in the Spring of this year to determine if firms like Knight Capital (KCG) were in compliance with the rule, which regulators believe could have prevented the trading glitch if Knight had fully complied with the regulation.

SEC officials were in the process of reviewing documents concerning Knight’s compliance with the rule at the time of the errant trade. SEC examiners were expected to be on site at the firm at some later date.

An SEC spokesman declined to comment on the matter.

If Knight failed to comply with the rule, the firm could face SEC enforcement action, and shareholder lawsuits. Shares of Knight have declined nearly 70% since the erroneous trade caused the firm's chief executive, Tom Joyce, to seek a deal that brought in new investors, but heavily diluted existing ones in the process.

People close to the firm says that if risk management procedures called for under the market access rule were not implemented, Joyce would likely lose his job as well.

A Knight spokeswoman declined to comment on the matter.

Also under the spotlight, however, is the SEC. Chairwoman Mary Schapiro has called the Knight trading error “unacceptable” and her examination team has launched an inquiry into the matter, which regulators believe has shaken already-weak investor confidence in the markets.

Officials from the SEC’s enforcement division are monitoring the situation but haven’t yet launched a formal investigation, though people close to the matter say it's only a matter of time before the enforcement staff gets involved.

Some say the SEC action might be too little too late since the commission could have presumably uncovered flaws in Knight's risk management procedures earlier. An SEC official says the commission's examination of firms' compliance with the market access rule began in the Spring -- a little more than a year after the rule was adopted -- in order give firms time to comply with the regulation.

But people with knowledge of the trading error say Knight’s lack of risk management procedures was immediately evident to officials at the New York Stock Exchange, who initially discovered the trading error when the markets opened on Aug. 1.

NYSE officials identified Knight as the source of unusual trading in dozens of stocks, and that the trades were erroneous. But officials at Knight couldn’t find the exact source of the erroneous trades for more than a half hour, according to people with direct knowledge of the matter.

Executives at Knight transferred the NYSE investigators to several areas of the firm before the exact source of the error was discovered and the trade could be shut down, these people say.

“There was a lot of ‘it’s not us, let me put you in touch with this guy,’ before the thing was figured out,” said one Wall Street executive with direct knowledge of the matter.

In the aftermath of the loss, regulators examining what went wrong have begun to focus on whether Knight was in full compliance with the market access rule that, if adhered to, should have shut down the errant trade before the losses magnified.

The market access rule passed in late 2010 forces firms like Knight to put in place risk management procedures when executing large automated trades.

Under the rule, mandatory safeguards would have prevented Knight from executing such a large volume of trades -- estimated at around $5 billion -- because it would have far exceeded capital requirements.

Charles Gasparino joined FOX Business Network (FBN) in February 2010 as Senior Correspondent.