From 4d8f27744a3ce57f7b12d6feb5bb378fdd6f18d2 Mon Sep 17 00:00:00 2001 From: Alex Courouble <56831527+couralex6@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:12:57 -0700 Subject: [PATCH] Fix bug causing wrong token_bought_amount_raw (#4284) --- models/shibaswap/ethereum/shibaswap_ethereum_trades.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/shibaswap/ethereum/shibaswap_ethereum_trades.sql b/models/shibaswap/ethereum/shibaswap_ethereum_trades.sql index cf9fa463fff..aa138d20db4 100644 --- a/models/shibaswap/ethereum/shibaswap_ethereum_trades.sql +++ b/models/shibaswap/ethereum/shibaswap_ethereum_trades.sql @@ -23,10 +23,10 @@ WITH dexs AS t.evt_block_time AS block_time ,t.to AS taker ,f.pair AS maker - ,CASE WHEN amount1Out = UINT256 '0' THEN amount1Out ELSE amount0Out END AS token_bought_amount_raw + ,CASE WHEN amount0Out = UINT256 '0' THEN amount1Out ELSE amount0Out END AS token_bought_amount_raw ,CASE WHEN amount0In = UINT256 '0' OR amount1Out = UINT256 '0' THEN amount1In ELSE amount0In END AS token_sold_amount_raw ,NULL AS amount_usd - ,CASE WHEN amount1Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_bought_address + ,CASE WHEN amount0Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_bought_address ,CASE WHEN amount0In = UINT256 '0' OR amount1Out = UINT256 '0' THEN f.token1 ELSE f.token0 END AS token_sold_address ,t.contract_address AS project_contract_address ,t.evt_tx_hash AS tx_hash