There's definitely risk in the sense that YC invests in relatively risky companies, and anything that negatively impacts the long-term value of those businesses ultimately impacts YC. From, like, an accounting perspective, I have no idea when YC marks gains or losses to market or whether that timing coincides with other market participants or the companies themselves.
Either way, in the context of the top-level commenter's question, it's worth emphasizing that a change in valuation isn't a cash flow. YC doesn't get an influx of cash to invest when the value of its portfolio companies goes up, and it doesn't have to give up cash that it could otherwise invest when those companies' valuations go down.
Either way, in the context of the top-level commenter's question, it's worth emphasizing that a change in valuation isn't a cash flow. YC doesn't get an influx of cash to invest when the value of its portfolio companies goes up, and it doesn't have to give up cash that it could otherwise invest when those companies' valuations go down.