SwapOrder.inverted
This commit is contained in:
@@ -86,7 +86,11 @@ const feeGroups = {} // keyed by ticker without the final fee field. values are
|
||||
// symbol is keyed by the `ticker` which is defined as 'chain_id|pool_addr' for absolute uniqueness.
|
||||
|
||||
export function tickerForOrder(chainId, order) {
|
||||
return tickerKey(chainId, order.route.exchange, order.tokenIn, order.tokenOut, order.route.fee, true)
|
||||
let [base, quote] = [order.tokenIn, order.tokenOut]
|
||||
const inv = base > quote
|
||||
if (inv !== order.inverted)
|
||||
[base, quote] = [quote, base]
|
||||
return tickerKey(chainId, order.route.exchange, base, quote, order.route.fee, false)
|
||||
}
|
||||
|
||||
export function tickerKey(chainId, exchange, tokenAddrA, tokenAddrB, fee, chooseInversion=false ) {
|
||||
|
||||
Reference in New Issue
Block a user