code: def _spot_index(
      spot,
      time_diff,
      base_deposit,
      terms_deposit,
      base_daycount,
      terms_daycount,
  ):
      import numpy as np
  
      out = np.zeros((len(spot)))
      out[0] = 100
  
      for i in range(1, len(out)):
          # Calculate total return index as product of yesterday, changes in spot and carry accrued
          out[i] = out[i - 1] * (
              1
              + (1 + base_deposit[i] * time_diff[i] / base_daycount)
              * (spot[i] / spot[i - 1])
              - (1 + terms_deposit[i] * time_diff[i] / terms_daycount)
          )
  
      return out
  
file_path: finmarketpy/finmarketpy/curve/fxspotcurve.py
imports: import pandas
  from numba import guvectorize
  from findatapy.market import Market, MarketDataRequest
  from findatapy.timeseries import Calculations
  from finmarketpy.util.marketconstants import MarketConstants
label_desc: Use image node_id 2 for calling a global function with example usage: _spot_index(spot, time_diff, base_deposit, terms_deposit, base_daycount, terms_daycount) and returns: out