There are no loopholes for investment gains. If you are talking about offsetting losses and delaying gains, those options would likely be available to endowment funds.