Skip to content

Commit

Permalink
Fix stablebase and saddle_finance id mapping (#7400)
Browse files Browse the repository at this point in the history
* Fix stablebase mapping

* Fix mapping

* Fix seed

* Fix saddle_finance mapping
  • Loading branch information
Hosuke authored Jan 3, 2025
1 parent 70f01d0 commit 368e174
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dbt_subprojects/dex/models/trades/base/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ models:
blockchain: base
sector: dex
project: stablebase
contributors: principatel
contributors: principatel, hosuke
config:
tags: ["base", "dex", "trades", "stablebase"]
description: stablebase base trades
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index']
) }}

-- Id mapping:
-- 0 USDbC https://basescan.org/token/0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca
-- 1 DAI https://basescan.org/token/0x50c5725949a6f0c72e6c4a641f24049a917db0cb
-- 2 axlUSDC https://basescan.org/token/0xeb466342c4d449bc9f53a865d5cb90586f405215

WITH token_swaps AS (
SELECT
evt_block_number AS block_number,
Expand All @@ -16,8 +21,16 @@ WITH token_swaps AS (
evt_tx_to AS taker,
tokensSold AS token_sold_amount_raw,
tokensBought AS token_bought_amount_raw,
CAST(soldId AS varbinary) AS token_sold_address,
CAST(boughtId AS varbinary) AS token_bought_address,
CASE soldId
WHEN 0 THEN 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca
WHEN 1 THEN 0x50c5725949a6f0c72e6c4a641f24049a917db0cb
WHEN 2 THEN 0xeb466342c4d449bc9f53a865d5cb90586f405215
END AS token_sold_address,
CASE boughtId
WHEN 0 THEN 0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca
WHEN 1 THEN 0x50c5725949a6f0c72e6c4a641f24049a917db0cb
WHEN 2 THEN 0xeb466342c4d449bc9f53a865d5cb90586f405215
END AS token_bought_address,
contract_address AS project_contract_address,
evt_tx_hash AS tx_hash,
evt_index AS evt_index
Expand Down
2 changes: 1 addition & 1 deletion dbt_subprojects/dex/models/trades/optimism/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ models:
blockchain: optimism
sector: dex
project: saddle_finance
contributors: princi
contributors: princi, hosuke
config:
tags: [ 'optimism', 'dex', 'trades', 'saddle_finance']
description: "saddle finance optimism base trades"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
unique_key = ['tx_hash', 'evt_index']
) }}

-- Id mapping:
-- 0 DAI https://optimistic.etherscan.io/token/0xda10009cbd5d07dd0cecc66161fc93d7c9000da1
-- 1 USDC.e https://optimistic.etherscan.io/token/0x7f5c764cbc14f9669b88837ca1490cca17c31607
-- 2 USDT https://optimistic.etherscan.io/token/0x94b008aa00579c1307b0ef2c499ad98a8ce58e58

WITH token_swaps AS (
SELECT
evt_block_number AS block_number,
Expand All @@ -16,8 +21,16 @@ WITH token_swaps AS (
evt_tx_to AS taker,
tokensSold AS token_sold_amount_raw,
tokensBought AS token_bought_amount_raw,
CAST(soldId AS varbinary) AS token_sold_address,
CAST(boughtId AS varbinary) AS token_bought_address,
CASE soldId
WHEN 0 THEN 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1
WHEN 1 THEN 0x7f5c764cbc14f9669b88837ca1490cca17c31607
WHEN 2 THEN 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58
END AS token_sold_address,
CASE boughtId
WHEN 0 THEN 0xda10009cbd5d07dd0cecc66161fc93d7c9000da1
WHEN 1 THEN 0x7f5c764cbc14f9669b88837ca1490cca17c31607
WHEN 2 THEN 0x94b008aa00579c1307b0ef2c499ad98a8ce58e58
END AS token_bought_address,
contract_address AS project_contract_address,
evt_tx_hash AS tx_hash,
evt_index AS evt_index
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index
optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0x0000000000000000000000000000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000000000000000000000000001,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3
optimism,saddle_finance,1,2022-08-01 00:00,2022-08-05 00:00,2022-08-05 19:11,17943155,74907384,74857799085655995549,0xda10009cbd5d07dd0cecc66161fc93d7c9000da1,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0xd131f1bcdd547e067af447dd3c36c99d6be9fdeb,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xf6c2e0adc659007ba7c48446f5a4e4e94dfe08b5,0xbccdcd4ab61e5ad3384eb173156c3c0507d3bb3f2d2f5a406379e74aafbec38d,3
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
blockchain,project,version,block_month,block_date,block_time,block_number,token_sold_amount_raw,token_bought_amount_raw,token_sold_address,token_bought_address,maker,taker,project_contract_address,tx_hash,evt_index
base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000000,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31
base,stablebase,1,2023-08-01,2023-08-28,2023-08-28 19:18:00.000,3230470,129976172599579374396,135180385,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x19fbc29d72476365a62151ffdbf4764e54774a81,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0x8c59cc9b958635710957e751a9b4e77cd771baf2,0xc2dec669877f4edfcb7debd2eb23288a0fba8cd57d6f3fb3e45e8b15a6458d43,31

0 comments on commit 368e174

Please sign in to comment.