<?xml version="1.0"?>
<Trade id="generic_fx_barrier_option">
  <TradeType>FxGenericBarrierOption</TradeType>
  <Envelope>
    <CounterParty>CPTY_A</CounterParty>
    <NettingSetId>CPTY_A</NettingSetId>
  </Envelope>
  <FxGenericBarrierOptionData>
    <!-- The underlying on which the option is written, supported are
         FX, Equity, Commodity -->
    <Underlying>
      <Type>FX</Type>
      <!-- The order of the currencies in the Name defines the
           observed underlying, i.e.:
           - for EUR-USD the observed underlying value would be 1.2
           - for USD-EUR the observed underlying value would be 0.8
           The engine will take care of reading the appropriate historical
           fixings and take the reciprocal if necessary. -->
      <Name>ECB-EUR-USD</Name>
    </Underlying>
    <!-- The pay ccy, this is required for all Payoff Types and is usually
         - the domestic currency if underlying = FX
         - the eq / comm currency if underlying = Equity, Commodity
         But we allow for quanto payoffs as well, i.e.
         - the foreign currency if underlying = FX or also
         - a third currency if underlying = FX and
         - a currency != the equity, commodity currency for these underlying types.
         See payoff description which amount is paid in which currency dependent
         on the type. -->
    <PayCurrency>USD</PayCurrency>
    <OptionData>
      <!-- Long, Short -->
      <LongShort>Long</LongShort>
      <!-- Vanilla:         (S-K) paid in PayCurrency
           AssetOrNoathing: S paid in PayCurrency
           CashOrNothing:   Amount in PayCurrency -->
      <PayoffType>Vanilla</PayoffType>
      <!--  Call, Put, only required for Vanilla -->
      <OptionType>Call</OptionType>
      <!-- The underlying vanila option expiry date -->
      <ExerciseDates>
        <ExerciseDate>2022-03-01</ExerciseDate>
      </ExerciseDates>
      <!-- Premiums to be paid unconditionally -->
      <Premiums>
        <Premium>
          <Amount>0</Amount>
          <Currency>EUR</Currency>
          <PayDate>2022-01-31</PayDate>
        </Premium>
      </Premiums>
    </OptionData>
    <!-- The settlement date. -->
    <SettlementDate>2022-03-04</SettlementDate>
    <!-- Required for PayoffType = AssetOrNothing, Vanilla.
         For FX this is the amount in foreign currency.
         For Equity, Commodity this is the number of equities, commodities. -->
    <Quantity>1000000</Quantity>
    <!-- Only required for PayoffType = Vanilla -->
    <Strike>1.08</Strike>
    <!-- Only required for PayoffType = CashOrNothing -->
    <!-- <Amount>0</Amount> -->
    <Barriers>
      <!-- 0, 1 or 2 barriers of type UpAndIn, UpAndOut, DownAndIn, DownAndOut
           with exactly one level each and with optional rebate amount.
           Barriers are monitored on the given schedule -->
      <ScheduleData>
        <Rules>
          <StartDate>2022-02-01</StartDate>
          <EndDate>2022-03-01</EndDate>
          <Tenor>1D</Tenor>
          <Calendar>TGT,US</Calendar>
          <Convention>F</Convention>
          <TermConvention>F</TermConvention>
          <Rule>Forward</Rule>
          <EndOfMonth />
          <FirstDate />
          <LastDate />
        </Rules>
      </ScheduleData>
      <BarrierData>
        <Type>DownAndIn</Type>
        <Levels>
          <Level>1.08</Level>
        </Levels>
        <!-- Optional Rebate, must be identical across all in barriers, can be different
             for different out barriers. Rebates are not allowed if both KI and KO barriers
             are defined. -->
        <Rebate>0</Rebate>
        <!-- Optional, defaults to PayCurrency -->
        <RebateCurrency>USD</RebateCurrency>
        <!-- Optional, atHit (only for "out" barriers), atExpiry defaults to atExpiry -->
        <RebatePayTime>atExpiry</RebatePayTime>
      </BarrierData>
      <BarrierData>
        <Type>UpAndOut</Type>
        <Levels>
          <Level>1.15</Level>
        </Levels>
        <Rebate>0</Rebate>
        <RebateCurrency>USD</RebateCurrency>
        <RebatePayTime>atExpiry</RebatePayTime>
      </BarrierData>
      <!-- KIKO Type, only required if we have 2 barriers, one "in" and one "out"
           KoAlways     Knock Out can always happen
           KoBeforeKi   Knock Out can only happen before KI
           KoAfterKi    Knock Out can only happen after KI    -->
      <KikoType>KoAfterKi</KikoType>
    </Barriers>
    <!-- Optional, single additional barrier that is checked on the option expiry
         and activates ("in") or zeros the option payoff ("out").
         Only type and level are relevant, no rebate is allowed here. -->
    <TransatlanticBarrier>
      <BarrierData>
        <Type>UpAndOut</Type>
        <Levels>
          <Level>1.1</Level>
        </Levels>
        <Rebate>50000</Rebate>
        <RebateCurrency>USD</RebateCurrency>
      </BarrierData>
    </TransatlanticBarrier>
  </FxGenericBarrierOptionData>
</Trade>
