From d71ba025788837cb41b2a6be9ea04a11d20316d0 Mon Sep 17 00:00:00 2001 From: soispoke <66172107+soispoke@users.noreply.github.com> Date: Thu, 7 Jul 2022 10:11:07 +0200 Subject: [PATCH] fix ambiguous decimals for prices (#1257) Brief comments on the purpose of your changes: *For Dune Engine V2* I've checked that: * [ ] I tested the query on dune.com after compiling the model with dbt compile (compiled queries are written to the target directory) * [ ] I used "refs" to reference other models in this repo and "sources" to reference raw or decoded tables * [ ] if adding a new model, I added a test * [ ] the filename is unique and ends with .sql * [ ] each sql file is a select statement and has only one view, table or function defined * [ ] column names are `lowercase_snake_cased` When you are ready for a review, tag duneanalytics/data-experience. We will re-open your forked pull request as an internal pull request. Then your spells will run in dbt and the logs will be avaiable in Github Actions DBT Slim CI. This job will only run the models and tests changed by your PR compared to the production project. --- spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql b/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql index 509bc93b749..56af12bb893 100644 --- a/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql +++ b/spellbook/models/opensea/ethereum/opensea_ethereum_trades.sql @@ -5,8 +5,8 @@ evt_tx_hash || '-' || evt_index::string as unique_trade_id, 'ethereum' as blockchain, evt_tx_hash as tx_hash, evt_block_time as block_time, -om.price / power(10, decimals) * p.price AS amount_usd, -om.price / power(10, decimals) AS amount, +om.price / power(10, p.decimals) * p.price AS amount_usd, +om.price / power(10, p.decimals) AS amount, om.price AS amount_raw, terc20.symbol as token_symbol, wam.token_address as token_address,