Skip to content

Commit

Permalink
AN-3841/bridge-curation (#328)
Browse files Browse the repository at this point in the history
* updated contracts

* token symbol

* all bridge filter

* wormhole seed

* filter
  • Loading branch information
drethereum authored Jan 11, 2024
1 parent 50423ee commit 4cb5986
Show file tree
Hide file tree
Showing 104 changed files with 3,860 additions and 2 deletions.
41 changes: 41 additions & 0 deletions data/silver_bridge__meson_chain_id_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
chain,short_coin_type
Aptos,0x027d
Arbitrum,0x2329
Aurora,0x0a0a
Avalanche,0x2328
Base,0x2105
Bitcoin,0x0000
BNB Chain,0x02ca
Celo,0xce10
Coinweb,0x08ae
Conflux,0x01f7
Crypto Chain,0x018a
EOS,0x00c2
Ethereum,0x003c
Evmos,0x11bc
Fantom,0x03ef
Flow,0x021b
Gnosis,0x02bc
Harmony,0x03ff
Linea,0xe708
Manta,0x0263
Mantle,0x1388
Metis,0x0440
Moonbeam,0x0504
Moonriver,0x0505
Nautilus,0x56ce
Near,0x018d
opBNB,0x00cc
Optimism,0x0266
Polygon POS,0x03c6
Polygon zkEVM,0x044d
Scroll,0x2750
SKALE Europa,0x9296
SKALE Nebula,0xb4b1
Solana,0x01f5
Sui,0x0310
Terra,0x014a
Thorchain,0x03a3
Tron,0x00c3
zkSync Era,0x0324
zkFair,0xa70e
98 changes: 98 additions & 0 deletions data/silver_bridge__standard_dst_chain_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
destination_chain,standard_destination_chain
acala,acala
algorand,algorand
aptos,aptos
arbitrum,arbitrum
arbitrum nova,arbitrum nova
arbitrum one,arbitrum
archway,archway
astar,astar
aurora,aurora
aurora mainnet,aurora
avalanche,avalanche
avalanche c-chain,avalanche
base,base
bnb,bsc
bnb chain,bsc
bnb smart chain mainnet,bsc
boba bnb mainnet,boba
boba network,boba
bsc,bsc
canto,canto
carbon,carbon
celo,celo
celo mainnet,celo
coinweb,coinweb
conflux,conflux
conflux espace,conflux
crab network,crab
crescent,crescent
cronos mainnet,cronos
crypto chain,crypto
dfk chain,dfk
dogechain mainnet,dogechain
eos,eos
ethereum,ethereum
ethereum mainnet,ethereum
evmos,evmos
fantom,fantom
fantom opera,fantom
filecoin,filecoin
fuse,fuse
gnosis,gnosis
harmony mainnet shard 0,harmony
huobi eco chain mainnet,huobi eco
injective,injective
juno,juno
karura,karura
kava,kava
klaytn,klaytn
klaytn mainnet cypress,klaytn
kujira,kujira
linea,linea
manta,manta
mantle,mantle
metis,metis
metis andromeda mainnet,metis
moonbeam,moonbeam
moonriver,moonriver
nautilus,nautilus
near,near
neutron,neutron
oasis,oasis
okxchain mainnet,okxchain
ontology mainnet,ontology
op mainnet,optimism
opbnb,opbnb
optimism,optimism
osmosis,osmosis
polygon,polygon
polygon mainnet,polygon
polygon pos,polygon
polygon zkevm,polygon zkevm
ronin,ronin
scroll,scroll
secret-snip,secret
sei,sei
skale europa,skale europa
skale nebula,skale nebula
solana,solana
stargaze,stargaze
starknet,starknet
sui,sui
telos evm mainnet,telos
terra,terra
terra-2,terra2
terra2,terra2
tezos,tezos
tron,tron
umee,umee
waves,waves
xpla,xpla
xrpl,xrpl
zkfair,zkfair
zksync era,zksync era
zksync era mainnet,zksync era
zksync lite,zksync lite
zora,zora
zzz,zzz
13 changes: 13 additions & 0 deletions data/silver_bridge__stargate_chain_id_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
chain_name,chain_id
Arbitrum,110
Avalanche,106
Base,184
BNB,102
Ethereum,101
Fantom,112
Kava,177
Linea,183
Mantle,181
Metis,151
Optimism,111
Polygon,109
37 changes: 37 additions & 0 deletions data/silver_bridge__wormhole_chain_id_seed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
chain_name,wormhole_chain_id
acala,12
algorand,8
aptos,22
arbitrum,23
aurora,9
avalanche,6
avalanche,43114
base,30
bsc,4
celo,14
cosmoshub,4000
ethereum,2
evmos,4001
fantom,10
gnosis,25
injective,19
karura,11
klaytn,13
kujira,4002
moonbeam,16
near,15
neon,17
oasis,7
optimism,24
osmosis,20
polygon,5
polygon,137
pythnet,26
rootstock,33
sei,32
sepolia,10002
solana,1
sui,21
terra,3
terra2,18
xpla,28
83 changes: 83 additions & 0 deletions models/doc_descriptions/bridge/evm_bridge_activity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{% docs evm_bridge_table_doc %}

A convenience table that aggregates bridge activity from event_logs, traces and transfers, including bridge deposits and transfers sent from the following protocols: ACROSS, ALLBRIDGE, AXELAR, CELER, CBRIDGE, HOP, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture.

{% enddocs %}

{% docs evm_bridge_platform %}

The platform or protocol from which the bridge transaction or event originates.

{% enddocs %}

{% docs evm_bridge_origin_from %}

The from address where the transaction originated from. This may be an EOA or contract address, however in most cases this is the user that initiated the bridge deposit or transfer.

{% enddocs %}

{% docs evm_bridge_sender %}

The address that initiated the bridge deposit or transfer. This address is the sender of the tokens/assets being bridged to the destination chain. This may be an EOA or contract address.

{% enddocs %}

{% docs evm_bridge_receiver %}

The designated address set to receive the deposit or transfer. This may be an EOA or contract address.

{% enddocs %}

{% docs evm_bridge_destination_chain_receiver %}

The designated address set to receive the bridged tokens on the target chain after the completion of the bridge transaction. For non-evm chains, the hex address is decoded/encoded to match the data format of the destination chain, where possible. This may be an EOA or contract address.

{% enddocs %}

{% docs evm_bridge_destination_chain %}

The name of the blockchain network to which the assets are being bridged. It could be any EVM compatible chain or other blockchain networks that the bridging protocol supports.

{% enddocs %}

{% docs evm_bridge_destination_chain_id %}

The numeric identifier associated with the destination blockchain network. This is specific to the chain and helps in uniquely identifying it.

{% enddocs %}

{% docs evm_bridge_address %}

The address of the contract responsible for handling the bridge deposit or transfer. This contract mediates the transfer and ensures that assets are sent and received appropriately.

{% enddocs %}

{% docs evm_bridge_token_address %}

The address associated with the token that is being bridged. It provides a unique identifier for the token within its origin blockchain.

{% enddocs %}

{% docs evm_bridge_token_symbol %}

The symbol representing the token being bridged. This provides a shorthand representation of the token.

{% enddocs %}

{% docs evm_bridge_amount_unadj %}

The raw, non-decimal adjusted amount of tokens involved in the bridge transaction.

{% enddocs %}

{% docs evm_bridge_amount %}

The decimal adjusted amount of tokens involved in the bridge transaction, where available.

{% enddocs %}

{% docs evm_bridge_amount_usd %}

The value of the bridged tokens in USD at the time of the bridge transaction, where available.

{% enddocs %}
1 change: 1 addition & 0 deletions models/doc_descriptions/general/__overview__.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ There is more information on how to use dbt docs in the last section of this doc
### DeFi Tables (polygon.defi)
- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.defi__dim_dex_liquidity_pools)
- [ez_dex_swaps](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.defi__ez_dex_swaps)
- [ez_bridge_activity](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.defi__ez_bridge_activity)

### NFT Tables (polygon.nft)
- [ez_nft_mints](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.nft__ez_nft_mints)
Expand Down
55 changes: 55 additions & 0 deletions models/gold/defi/defi__ez_bridge_activity.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true },
meta ={
'database_tags':{
'table':{
'PROTOCOL': 'ACROSS, ALLBRIDGE, AXELAR, CELER, CBRIDGE, HOP, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE',
'PURPOSE': 'BRIDGE'
} } }
) }}

SELECT
block_number,
block_timestamp,
origin_from_address,
origin_to_address,
origin_function_signature,
tx_hash,
event_index,
bridge_address,
event_name,
platform,
sender,
receiver,
destination_chain_receiver,
COALESCE(
standard_destination_chain,
b.destination_chain
) AS destination_chain,
destination_chain_id,
token_address,
token_symbol,
amount_unadj,
amount,
amount_usd,
COALESCE (
complete_bridge_activity_id,
{{ dbt_utils.generate_surrogate_key(
['_id']
) }}
) AS ez_bridge_activity_id,
COALESCE(
inserted_timestamp,
'2000-01-01'
) AS inserted_timestamp,
COALESCE(
modified_timestamp,
'2000-01-01'
) AS modified_timestamp
FROM
{{ ref('silver_bridge__complete_bridge_activity') }}
b
LEFT JOIN {{ ref('silver_bridge__standard_dst_chain_seed') }} C
ON b.destination_chain = C.destination_chain
Loading

0 comments on commit 4cb5986

Please sign in to comment.