The theme of optimism in The Great Gatsby is certainly tied to Jay Gatsby. The fact that the character who "achieves" the biggest fraud is also the character who best expresses a type of optimism is ironic and can be taken as a comment on the drive toward identification by things that is shared by many of the characters in this novel.
(This mode of material definition of identity is at the core of Gatsby's schism and complexity. He is self-assured and rich. He has implicit faith in his own abilities. But he is a fraud through and through.)
Gatsby sets himself a task as a young man, changing his name and leaving his family behind in his pursuit of becoming a great man. The task itself is the first and most sure sign of Gatsby's optimism. He really believes he can change himself into the character he imagines.
If personality is an unbroken series of successful gestures, then there was something gorgeous about him, some heightened sensitivity to the promises of life.… [Gatsby had] an extraordinary gift for hope, a romantic readiness such as I have never found in any other person and which it is not likely I shall ever find again.
This self-belief becomes ironic when Gatsby is discovered to be a criminal making his money illegally. He has achieved the greatness he sought if that greatness is measured by prestige and wealth. Yet the person he has become is, essentially a lie, a fabrication.
Despite his status as a criminal, Gatsby persists in achieving his long-standing aim of gaining Daisy's hand. Nothing can shake his dedication to this goal, and here we see the second great sign of Gatsby's optimism.
Daisy is married and frightened of running away from her husband, Tom. She is unhappy in her marriage but otherwise secure. Gatsby is undetered by these facts. His optimism and (ironic) self-belief will not allow him either to see himself honestly and will not allow him to accept any circumstance as final unless it is the one he desires.
He believes he can have everything he dreamed of. Gatsby stands at once as the accomplishment of his own dream (and a publicly shared dream) and as a figment, an empty idea, as "only a dream".