On occasion, commenters have asked to what degree the Founders were influenced by the Scotsman Adam Smith, the moral philosopher and father of modern economics. In 2004, David Prindle authored an essay on Smith's influence on James Madison, colorfully titled The Invisible Hand of James Madison. From the abstract:
"Scholars have disagreed about how to interpret James Madison's Federalist essays 10 and 51, in which he explains and justifies the underlying principles of the new Constitution. Was Madison the architect of a structure of counterpoise, which would force individuals, interests, and institutions to obstruct one another so as to avoid tyranny, or was he a republican statesman, designing a system that would recruit virtuous citizens to public office."
Prindle dismisses the dichotomy "Was Madison arguing that the Constitutional system designed to thwart bad people, or to recruit good ones?," and asserts that Madison likely intended both. Prindle's Madison encompasses both republican virtue and restraint of tyranny. To substantiate his position, Prindle examines Adam Smith's mixed motives in writing The Wealth of Nations:
"[Smith] wanted to combat the prejudice, derived from the natural law tradition, that individual interests were necessarily anti-social, and therefore furnished an excuse for government economic regulation [...] Smith wanted to show that there was a way that economies could be designed so that nations could become richer [...] he wished to demonstrate that an economy was not necessarily a zero-sum game, but could be structured so as to grow at a rate considerably faster than population increase. Morally, he wanted to refute the notion that self-seeking must always be contrary to the public interest. To help him accomplish these twin goals, he invented modern economic reasoning."
Smith summarized his idea as
"As every individual [...] by directing that industry in such a manner as its produce may be of greatest value, intends only his own gain, he is in this as in many other cases led by an invisible hand to promote an end which was no part of his intention...By pursuing his own interest he frequently promotes that of society more effectively than when he really intends to promote it."
Above, Smith is not saying that the participants in free enterprise have virtuous intents, but that their actions become virtuous due to market forces. Similarly, in Federalist 51, Madison argues "Ambition must be made to counteract ambition," because when it does, government officials must compete in a contest of virtue. Even if their intentions are not virtuous, their actions become virtuous due to competition.
Thus, there are strong parallels in Smith's approach to commerce and that of Madison's approach to politics. Given Madison's familiarity with Smith's work, it is likely that Madison's perspective was influenced by the Scotsman.
Prindle's essay is reasonably short, but more thorough than what has been posted above. It is a worthy read.