Cross rate calculations
A synthetic cross rate can be calculated from any two FX currency pairs that share a common currency. Consider a trader who wishes to exchange GBP for RMB through the intermediate currency of USD. The currency pairs that will make up the legs of the cross will be GBP/USD, and USD/RMB. As the two currencies are given in different terms, the exchange rate will be determined by multiplying in the cross. For example:

GBP/USD0.62039 - 0.62041
USD/RMB0.15170 - 0.15175
The quote for the bid price for the exchange GBP/RMB is calculated by multiplying the bid price from leg 1, by the bid price from leg 2:
0.62039 x 0.15170 = 0.09411
The quote for the ask price is likewise calculated by multiplying the ask price from leg 1 with the ask price from leg 2:
0.62041 x 0.15175 = 0.09415
Which results in a calculated cross rate for GBP/RMB of:
GBP/RMB0.09411 - 0.09415
There are 4 different ways in which a cross rate can be calculated from two legs. For example, using USD as a common currency, the following combinations can be used to calculate the EUR/JPY cross rate:
1. EUR/USD + USD/JPY = EUR/JPY

output.bidPrice := leg1.bidPrice * leg2.bidPrice
output.bidQty := (min((leg1.bidPrice * leg1.bidQty),
(1* leg2.bidQty)) / leg1.bidPrice).floor()
2. EUR/USD + JPY/USD = EUR/JPY

output.bidPrice := leg1.bidPrice * (1/leg2.bidPrice)
output.bidQty := (min((leg1.bidPrice * leg1.bidQty),
3. USD/EUR + USD/JPY = EUR/JPY