Skip to content

Commit

Permalink
Fix bug causing wrong token_bought_amount_raw (duneanalytics#4284)
Browse files Browse the repository at this point in the history
  • Loading branch information
couralex6 authored Sep 7, 2023
1 parent e0bc52b commit 4d8f277
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/shibaswap/ethereum/shibaswap_ethereum_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d8f277

Please sign in to comment.