Skip to content

Commit

Permalink
chore: add additional aggregator fee wallets for flokibot (#7343)
Browse files Browse the repository at this point in the history
* chore-add-additional-openocean-fee-wallet-for-flokibot

* fix: add missing referrer

* chore: use same fee wallets across all custom routers + aggregators

* fix: remove duplicated source

---------

Co-authored-by: 0xRob <[email protected]>
  • Loading branch information
whalehunting and 0xRobin authored Dec 20, 2024
1 parent 8843bf1 commit 9c81e91
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ with
(
to = {{ treasury_fee_wallet_1 }}
or to = {{ treasury_fee_wallet_2 }}
or to = {{ aggregator_fee_wallet_1 }}
or to = {{ buyback_fee_wallet_1 }}
)
and tx_success = true
Expand All @@ -56,20 +57,38 @@ with
where
(
varbinary_position(data, {{ aggregator_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_2 }}) > 0
or varbinary_position(data, {{ buyback_fee_wallet_1 }}) > 0
)
and call_success
{% if is_incremental() %}
and {{ incremental_predicate('call_block_time') }}
{% else %} and call_block_time >= timestamp '{{project_start_date}}'
{% endif %}
),
openocean_aggregator_trades as (
select evt_block_time as block_time, evt_tx_hash as tx_hash
from {{ source('openocean_v2_base', 'OpenOceanExchange_evt_Swapped') }}
where
referrer = {{ aggregator_fee_wallet_1 }}
or referrer = {{ treasury_fee_wallet_1 }}
or referrer = {{ treasury_fee_wallet_2 }}
or referrer = {{ buyback_fee_wallet_1 }}
{% if is_incremental() %}
and {{ incremental_predicate('evt_block_time') }}
{% else %} and evt_block_time >= timestamp '{{project_start_date}}'
{% endif %}
),
trade_transactions as (
select block_time, address, null as tx_hash
from bot_contracts
union all
select block_time, null as address, tx_hash
from oneinch_aggregator_trades
union all
select block_time, null as address, tx_hash
from openocean_aggregator_trades
),
bot_trades as (
select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ with
from {{ source('bnb', 'traces') }}
where
(
to = {{ treasury_fee_wallet_1 }}
to = {{ aggregator_fee_wallet_1 }}
or to = {{ treasury_fee_wallet_1 }}
or to = {{ treasury_fee_wallet_2 }}
or to = {{ treasury_fee_wallet_3 }}
or to = {{ buyback_fee_wallet_1 }}
)
and tx_success = true
Expand All @@ -58,8 +60,10 @@ with
where
(
varbinary_position(data, {{ aggregator_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_2 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_3 }}) > 0
or varbinary_position(data, {{ buyback_fee_wallet_1 }}) > 0
)
and call_success
{% if is_incremental() %}
Expand All @@ -71,7 +75,11 @@ with
select evt_block_time as block_time, evt_tx_hash as tx_hash
from {{ source('openocean_v2_bnb', 'OpenOceanExchange_evt_Swapped') }}
where
referrer = {{ treasury_fee_wallet_3 }}
referrer = {{ aggregator_fee_wallet_1 }}
OR referrer = {{ treasury_fee_wallet_1 }}
OR referrer = {{ treasury_fee_wallet_2 }}
OR referrer = {{ treasury_fee_wallet_3 }}
OR referrer = {{ buyback_fee_wallet_1 }}
{% if is_incremental() %}
and {{ incremental_predicate('evt_block_time') }}
{% else %} and evt_block_time >= timestamp '{{project_start_date}}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ with
(
to = {{ treasury_fee_wallet_1 }}
or to = {{ treasury_fee_wallet_2 }}
or to = {{ aggregator_fee_wallet_1 }}
or to = {{ buyback_fee_wallet_1 }}
)
and tx_success = true
Expand All @@ -56,7 +57,9 @@ with
where
(
varbinary_position(data, {{ aggregator_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_1 }}) > 0
or varbinary_position(data, {{ treasury_fee_wallet_2 }}) > 0
or varbinary_position(data, {{ buyback_fee_wallet_1 }}) > 0
)
and call_success
{% if is_incremental() %}
Expand All @@ -68,7 +71,10 @@ with
select evt_block_time as block_time, evt_tx_hash as tx_hash
from {{ source('openocean_v2_ethereum', 'OpenOceanExchangeProxy_evt_Swapped') }}
where
referrer = {{ treasury_fee_wallet_2 }}
referrer = {{ treasury_fee_wallet_1 }}
or referrer = {{ treasury_fee_wallet_2 }}
or referrer = {{ aggregator_fee_wallet_1 }}
or referrer = {{ buyback_fee_wallet_1 }}
{% if is_incremental() %}
and {{ incremental_predicate('evt_block_time') }}
{% else %} and evt_block_time >= timestamp '{{project_start_date}}'
Expand Down

0 comments on commit 9c81e91

Please sign in to comment.