Every index fund is an approximation of the underlying index. They'll all have some level of error in tracking the index for a variety of reasons. Among them
- Funds are likely to have at least a small cash position both to satisfy investors that want to sell and to deal with inflows that aren't yet invested. This is some of what you're talking about. There is no particular requirement about how quickly the fund moves this cash into the market but each fund likely has internal policies that it follows. I would expect that funds would move their cash positions relatively quickly into the market throughout the day but a really small fund might behave differently.
- Funds are never going to exactly replicate the weighting of the index. It might have 0.002% less Apple stock than the index specifies and 0.003% more Microsoft. Assuming that there are net inflows (people are putting more money in than they are taking out), it may use today's inflows to buy Apple stock but not buy Microsoft stock in order to get back to balance. If there are net outflows, it may sell some Microsoft stock to get the cash to give to investors without touching its Apple position in order to get closer to balanced.
At the end of the day, the fund takes all of its assets (cash and securities), adds up the value, and divides by the number of shares outstanding to determine the price of a share of the fund. If they bought Apple earlier in the day and the price went up during the day, the price of the fund will reflect that. If Apple declined after they bought it at midday, the price of the fund will reflect that as well.
Imagine an example fund that tracks a two stock index where A is supposed to be 60% of the index and B is supposed to be 40% of the index. At the beginning of the day, the fund has
- 5.995 million shares of A @ $1/ share (59.89% of assets)
- 8.004 million shares of B @ $0.50/ share (39.98% of assets)
$10,000 in cash
Total assets = $5,995,000 + 4,002,000 + 13,000 = $10,010,000
- Total shares of the mutual fund = 1 million
- Net Asset Value (NAV) = $10.01 ($10,010,000 / 1,000,000 )
During the day, someone buys $2,000 worth of the fund and someone else puts in an order to sell 100 shares. Those orders will settle at the close of business.
The fund manager knows that roughly $1,000 is coming into the fund at the end of the day. They know that the fund is a little short of A so they use some of their cash position to buy 1000 more A shares. As luck would have it, A has actually fallen to $0.95/ share when they make this decision so they spend $995 on those shares
Now they have
- 5.996 million shares of A @ $0.95/ share
- 8.004 million shares of B @ $0.50/ share
- $9,005 in cash
By the end of the day, A has recovered and is back up to $0.97/ share while B has gone up to $0.51/ share. So when they calculate NAV
- $5,816,120 in A (58.7% of assets)
- $4,082,040 in B (41.2% of assets)
- $ 9,005 in cash
= $9,907,165 in assets
(Note that I'm going to arbitrarily round to reasonableness from here on)
We said earlier that there were 1 million shares so the price per share is now $9.907.
The investor that wanted to sell 100 shares gets $990.72.
The investor that wanted to buy $2,000 worth of shares gets 201.87 shares (2000/ 9.907)
The fund now has 9,005 - 990.72 + 2,000 in cash = $10,014.28