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

[WIP]EulerSwap #3

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update
  • Loading branch information
haythemsellami committed Mar 12, 2025
commit e05a1143c4c9f024759b988eb6c2ff0ee12b7194
2 changes: 1 addition & 1 deletion substreams/ethereum-eulerswap/integration_test.tycho.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests:
- name: test_pool_creation
# Indexed block range
start_block: 21986045
stop_block: 21986080
stop_block: 21986064
# Same as global `initialized_accounts` but only scoped to this test.
initialized_accounts:
- "0xa66957e58b60d6b92b850c8773a9ff9b0ba96a65" # This is the USDC vault in Euler lending protocol that will hold the USDC for the pool
Expand Down
2 changes: 1 addition & 1 deletion substreams/ethereum-eulerswap/src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ fn map_protocol_changes(
.is_some() ||
// Check if this address is a vault for any component
components_store
.get_last(vault_key(&format_pool_id(addr)))
.get_last(vault_key(&store_address(addr)))
.is_some() ||
addr.eq(EVC_ADDRESS) ||
addr.eq(EULERSWAP_PERIPHERY) ||
Expand Down
13 changes: 12 additions & 1 deletion substreams/ethereum-eulerswap/src/pool_factories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use tycho_substreams::{
models::{ImplementationType, ProtocolComponent},
};
use substreams_ethereum::{Event, Function};
use crate::modules::{
EVC_ADDRESS, EVK_EVAULT_IMPL,
EVK_VAULT_MODULE_IMPL, EVK_BORROWING_MODULE_IMPL,
EVK_GOVERNANCE_MODULE_IMPL, EVK_GENERIC_FACTORY
};

/// Format a pool ID consistently
pub fn format_pool_id(pool_address: &[u8]) -> String {
Expand Down Expand Up @@ -67,7 +72,13 @@ pub fn maybe_create_component(
component = component.with_contracts(&[
pool_deployed.pool.clone(), // The deployed pool contract
pool_deployed.vault0.clone(), // Vault0 contract
pool_deployed.vault1.clone() // Vault1 contract
pool_deployed.vault1.clone(), // Vault1 contract
EVC_ADDRESS.to_vec(), // EVC address
EVK_EVAULT_IMPL.to_vec(), // eVault implementation
EVK_VAULT_MODULE_IMPL.to_vec(), // Vault module implementation
EVK_BORROWING_MODULE_IMPL.to_vec(), // Borrowing module implementation
EVK_GOVERNANCE_MODULE_IMPL.to_vec(), // Governance module implementation
EVK_GENERIC_FACTORY.to_vec() // Generic factory
]);

// Add attributes
Expand Down