-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
OTSea DEX on Base #7390
base: main
Are you sure you want to change the base?
OTSea DEX on Base #7390
Conversation
dbt_subprojects/dex/models/trades/base/platforms/otsea_base_base_trades.sql
Show resolved
Hide resolved
dbt_subprojects/dex/models/trades/base/platforms/otsea_base_base_trades.sql
Outdated
Show resolved
Hide resolved
Thank you for addressing the issue. I have made the modifications for the
token address
…On Sun, 29 Dec 2024 at 15:52, 0xRob ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In
dbt_subprojects/dex/models/trades/base/platforms/otsea_base_base_trades.sql
<#7390 (comment)>
:
> +
+WITH token_swaps AS (
+ SELECT
+ evt_block_number AS block_number,
+ CAST(evt_block_time AS timestamp(3) with time zone) AS block_time,
+ evt_tx_from AS maker,
+ evt_tx_to AS taker,
+ swapped AS token_sold_amount_raw,
+ received AS token_bought_amount_raw,
+ account AS token_sold_address,
+ token AS token_bought_address,
+ contract_address AS project_contract_address,
+ evt_tx_hash AS tx_hash,
+ evt_index AS evt_index
+ FROM
+ {{ source('otsea_base', 'OTSeaV2_evt_SwappedTokensForETH') }}
Seems like this only covers 1 event type, are there other events that this
should cover? (swapping for other token, swapping eth for token,..).
------------------------------
In
dbt_subprojects/dex/models/trades/base/platforms/otsea_base_base_trades.sql
<#7390 (comment)>
:
> + partition_by = ['block_month'],
+ materialized = 'incremental',
+ file_format = 'delta',
+ incremental_strategy = 'merge',
+ unique_key = ['block_date', 'blockchain', 'project', 'version', 'tx_hash', 'evt_index']
+) }}
+
+WITH token_swaps AS (
+ SELECT
+ evt_block_number AS block_number,
+ CAST(evt_block_time AS timestamp(3) with time zone) AS block_time,
+ evt_tx_from AS maker,
+ evt_tx_to AS taker,
+ swapped AS token_sold_amount_raw,
+ received AS token_bought_amount_raw,
+ account AS token_sold_address,
This isn't accurate as it takes the swappers address as the token address
—
Reply to this email directly, view it on GitHub
<#7390 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNGN7KMTSHF7E22NWR4M3CD2H7EPNAVCNFSM6AAAAABUIL5OG6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMRUHEYTQOJXGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be the ideal implementation for OTSea on Base.
However, currently OTSea event sources are limited.
We need to fix the address value first:
https://dune.com/queries/4514265
swapped AS token_sold_amount_raw, | ||
received AS token_bought_amount_raw, | ||
CAST(account AS varbinary) AS token_sold_address, | ||
CAST('0x0000000000000000000000000000000000000000' AS varbinary) AS token_bought_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAST('0x0000000000000000000000000000000000000000' AS varbinary) AS token_bought_address, | |
0x0000000000000000000000000000000000000000 AS token_bought_address, |
evt_tx_to AS taker, | ||
swapped AS token_sold_amount_raw, | ||
received AS token_bought_amount_raw, | ||
CAST('0x0000000000000000000000000000000000000000' AS varbinary) AS token_sold_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAST('0x0000000000000000000000000000000000000000' AS varbinary) AS token_sold_address, | |
0x0000000000000000000000000000000000000000 AS token_sold_address, |
@@ -0,0 +1,3 @@ | |||
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,otsea,1,2024-05-01 00:00,2024-05-02 00:00,2024-05-02 07:41,13923182,88652482269503546099290,4000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0x0000000000000000000000000000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d,161 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify the trade:
https://basescan.org/tx/0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d
@@ -0,0 +1,3 @@ | |||
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,otsea,1,2024-05-01 00:00,2024-05-02 00:00,2024-05-02 07:41,13923182,88652482269503546099290,4000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0x0000000000000000000000000000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d,161 | |||
base,otsea,1,2024-05-01 00:00,2024-05-09 00:00,2024-05-09 23:24,14253851,122404014850000000,1000000000000000000,0xf41c500e45868f7cf73098c5699c1343d6d30051,0x0000000000000000000000000000000000000000,0xf41c500e45868f7cf73098c5699c1343d6d30051,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0x9d02c7614fc425df8614259e6b80890d13db5b8545a9095e3529d430fb6fc44f,226 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify the trade:
https://basescan.org/tx/0x9d02c7614fc425df8614259e6b80890d13db5b8545a9095e3529d430fb6fc44f#eventlog
One trading token should be 0xfD0F44da2a76e61585032dE6E54174a4b0c1CfB8
.
Okay, I'll look into the issue and resolve it as soon as possible!!
…On Fri, 3 Jan 2025 at 23:24, Huang Geyang ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In dbt_subprojects/dex/seeds/trades/otsea_base_base_trades_seed.csv
<#7390 (comment)>
:
> @@ -0,0 +1,3 @@
+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,otsea,1,2024-05-01 00:00,2024-05-02 00:00,2024-05-02 07:41,13923182,88652482269503546099290,4000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0x0000000000000000000000000000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d,161
Please verify the trade:
https://basescan.org/tx/0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d
------------------------------
In dbt_subprojects/dex/seeds/trades/otsea_base_base_trades_seed.csv
<#7390 (comment)>
:
> @@ -0,0 +1,3 @@
+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,otsea,1,2024-05-01 00:00,2024-05-02 00:00,2024-05-02 07:41,13923182,88652482269503546099290,4000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0x0000000000000000000000000000000000000000,0x9c1a0802fbe08bf7c68bb336820b7b2a7e4eb697,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xb6038c12bff786acb485fef9402d4215c97242a757c3f21ffebd0fe1aee7e92d,161
+base,otsea,1,2024-05-01 00:00,2024-05-09 00:00,2024-05-09 23:24,14253851,122404014850000000,1000000000000000000,0xf41c500e45868f7cf73098c5699c1343d6d30051,0x0000000000000000000000000000000000000000,0xf41c500e45868f7cf73098c5699c1343d6d30051,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0xa836af59d35b3da3c9fb5cfd6f84d9e3bd8c5fd5,0x9d02c7614fc425df8614259e6b80890d13db5b8545a9095e3529d430fb6fc44f,226
Please verify the trade:
https://basescan.org/tx/0x9d02c7614fc425df8614259e6b80890d13db5b8545a9095e3529d430fb6fc44f#eventlog
One trading token should be 0xfD0F44da2a76e61585032dE6E54174a4b0c1CfB8.
—
Reply to this email directly, view it on GitHub
<#7390 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNGN7KPMIQF25E66TSOXITT2I3FDZAVCNFSM6AAAAABUIL5OG6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMRZGQ4DKNZSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you for contributing to Spellbook 🪄
Please open the PR in draft and mark as ready when you want to request a review.
Description:
[...]
quick links for more information: