Dan Cody is a successful man who made his fortunes in mining during the various rushes out west for gold, silver, copper, etc. After accumulating his wealth and growing a bit older, Cody's mind begins to go. At this point various women attempt to separate Cody from his money.
Cody's peak of wealth represents also the point at which he lost control of his life. This is ironic to some extent.
During this period, Cody is convinced by a girlfriend to begin sailing. He does this and meets Gatsby. While Gatsby is with Cody, one of Gatsby's roles is to act as "jailor" for Cody when he is drunk.
...Dan Cody sober knew what lavish doings Dan Cody might soon be about...
In this way, the idea that Cody was a double for himself or a person with two distinct sides is established. This becomes ironic as Gatsby has taken on a new name and become a sort of double person as well.