Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block_number to balancer.trades #5789

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions models/balancer/arbitrum/balancer_arbitrum_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/balancer/balancer_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/balancer/base/balancer_base_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/balancer/ethereum/balancer_ethereum_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
4 changes: 3 additions & 1 deletion models/balancer/ethereum/balancer_v1_ethereum_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ v1 AS (
(swapFee / 1e18) AS swap_fee_percentage,
swaps.evt_block_time,
swaps.evt_tx_hash,
swaps.evt_index
swaps.evt_index,
swaps.evt_block_number
FROM {{ source('balancer_v1_ethereum', 'BPool_evt_LOG_SWAP') }} swaps
LEFT JOIN swap_fees fees
ON fees.evt_tx_hash = swaps.evt_tx_hash
Expand Down Expand Up @@ -76,6 +77,7 @@ SELECT
DATE_TRUNC('DAY', evt_block_time) AS block_date,
TRY_CAST(DATE_TRUNC('MONTH', evt_block_time) AS date) AS block_month,
evt_block_time AS block_time,
trades.evt_block_number AS block_number,
erc20a.symbol AS token_bought_symbol,
erc20b.symbol AS token_sold_symbol,
CASE
Expand Down
1 change: 1 addition & 0 deletions models/balancer/gnosis/balancer_gnosis_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/balancer/optimism/balancer_optimism_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/balancer/polygon/balancer_polygon_trades.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ FROM (
block_month,
block_date,
block_time,
block_number,
token_bought_symbol,
token_sold_symbol,
token_pair,
Expand Down
1 change: 1 addition & 0 deletions models/gyroscope/gyroscope_gyro_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ WITH gyro_tokens as (
SELECT * FROM (values
(0x7CFaDFD5645B50bE87d546f42699d863648251ad, 'stataArbUSDCn', 6, 'arbitrum'),
(0xb165a74407fE1e519d6bCbDeC1Ed3202B35a4140, 'stataArbUSDT', 6, 'arbitrum'),
(0x4EA71A20e655794051D1eE8b6e4A3269B13ccaCc, 'stataBasUSDC', 6, 'base'),
(0x862c57d48becB45583AEbA3f489696D22466Ca1b, 'stataEthUSDT', 6, 'ethereum'),
(0x87A1fdc4C726c459f597282be639a045062c0E46, 'stataPolUSDT', 6, 'polygon'),
(0x2dCa80061632f3F87c9cA28364d1d0c30cD79a19, 'stataPolUSDCn', 6, 'polygon'),
Expand Down
1 change: 1 addition & 0 deletions tokens/models/tokens/arbitrum/tokens_arbitrum_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ FROM (VALUES
, (0xe2b4179dc78206e98ee3130ff64fc152923f6d23, 'POTION', 10)
, (0xef888bca6ab6b1d26dbec977c455388ecd794794, 'RGT', 18)
, (0xb86af5eb59a8e871bfa573fa656123ea86f47c3a, 'CWETHLP', 18)
, (0x211cc4dd073734da055fbf44a2b4667d5e5fe5d2, 'sUSDe', 18)
) AS temp_table (contract_address, symbol, decimals)
3 changes: 3 additions & 0 deletions tokens/models/tokens/base/tokens_base_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,7 @@ FROM (VALUES
, (0xf899b0906f43ea1381e2c13868ebf130edb6c231, 'UNISWAP', 18)
, (0x9af23c8773adc2a899cba10b60718af3cf06c647, 'FAIRINU', 18)
, (0x11c1879227d463b60db18c17c20ae739ae8e961a, 'axlBAL', 18)
, (0x54330d28ca3357F294334BDC454a032e7f353416, 'OLAS', 18)
, (0x2dc5dd89a3662567b78fc3a78e1e2c81d9e4d419, 'BANANIA', 18)
, (0x99ac4484e8a1dbd6a185380b3a811913ac884d87, 'sDAI', 18)
) AS temp_table (contract_address, symbol, decimals)
2 changes: 2 additions & 0 deletions tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3100,4 +3100,6 @@ FROM (VALUES
, (0x5DDc25297D31A8546Eb52a691F73b2EAcAb37934, 'LBM' , 18 )
, (0x9b72D68aEB2ca398EbF7D2Ae343474358ec31070, 'KAI', 18)
, (0xFBE44caE91d7Df8382208fCdc1fE80E40FBc7e9a, 'GEMAI', 18)
, (0x939CED8875d1Cd75D8b9aca439e6526e9A822A48, 'goldCOMP', 18)
, (0xD60EeA80C83779a8A5BFCDAc1F3323548e6BB62d, 'ShezUSD', 18)
) AS temp_table (contract_address, symbol, decimals)
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ WITH raw_token_list AS (
,(0x4dd03dfd36548c840b563745e3fbec320f37ba7e, 'stataOptUSDCn', 6, 'underlying')
,(0x035c93db04E5aAea54E6cd0261C492a3e0638b37, 'stataOptUSDT', 6, 'underlying')
,(0xfc2e6e6bcbd49ccf3a5f029c79984372dcbfe527, 'OLAS', 18, 'underlying')
,(0x346e03F8Cce9fE01dCB3d0Da3e9D00dC2c0E08f0, 'weETH', 18, 'underlying')
) AS temp_table (contract_address, symbol, decimals, token_type)
)
SELECT
Expand Down
1 change: 1 addition & 0 deletions tokens/models/tokens/polygon/tokens_polygon_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ FROM (VALUES
, (0xbec3a3238fac0f6a79443ade963a00456af6833e, 'USDD', 18)
, (0x87A1fdc4C726c459f597282be639a045062c0E46, 'stataPolUSDT', 6)
, (0x2dCa80061632f3F87c9cA28364d1d0c30cD79a19, 'stataPolUSDCn', 6)
, (0x27f485b62C4A7E635F561A87560Adf5090239E93, 'DFX', 18)
) AS temp_table (contract_address, symbol, decimals)
Loading