diff options
author | zkao <zichongkao@gmail.com> | 2018-12-15 04:15:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-15 04:15:35 +0800 |
commit | 6d45beccad44e86ddd692d0cf54c09c29c5d9daf (patch) | |
tree | 66ef5002e7d407f891d991fcb6cbd10ddb9ee5c9 /packages/pipeline/src/parsers/ddex_orders | |
parent | 1efde6f59b976a074ba2ea15be867400b21dd68b (diff) | |
download | dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar.gz dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar.bz2 dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar.lz dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar.xz dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.tar.zst dexon-sol-tools-6d45beccad44e86ddd692d0cf54c09c29c5d9daf.zip |
Fix dex order quote/base asset assigning (#1432)
Diffstat (limited to 'packages/pipeline/src/parsers/ddex_orders')
-rw-r--r-- | packages/pipeline/src/parsers/ddex_orders/index.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/pipeline/src/parsers/ddex_orders/index.ts b/packages/pipeline/src/parsers/ddex_orders/index.ts index 52a998f9f..d7b97efbe 100644 --- a/packages/pipeline/src/parsers/ddex_orders/index.ts +++ b/packages/pipeline/src/parsers/ddex_orders/index.ts @@ -54,12 +54,14 @@ export function parseDdexOrder( tokenOrder.orderType = orderType; tokenOrder.price = price; - tokenOrder.baseAssetSymbol = ddexMarket.baseToken; - tokenOrder.baseAssetAddress = ddexMarket.baseTokenAddress; - tokenOrder.baseVolume = price.times(amount); + // ddex currently confuses quote and base assets. + // We switch them here to maintain our internal consistency. + tokenOrder.baseAssetSymbol = ddexMarket.quoteToken; + tokenOrder.baseAssetAddress = ddexMarket.quoteTokenAddress; + tokenOrder.baseVolume = amount; - tokenOrder.quoteAssetSymbol = ddexMarket.quoteToken; - tokenOrder.quoteAssetAddress = ddexMarket.quoteTokenAddress; - tokenOrder.quoteVolume = amount; + tokenOrder.quoteAssetSymbol = ddexMarket.baseToken; + tokenOrder.quoteAssetAddress = ddexMarket.baseTokenAddress; + tokenOrder.quoteVolume = price.times(amount); return tokenOrder; } |