Files
tycho-protocol-sdk/substreams/ethereum-ekubo-v2/src/store.rs
die-herdplatte 1ff97ff43f Ekubo TWAMM & MEV-resist integration (#192)
* Add Ekubo TWAMM support

* Change order of words

* Account TWAMM order balances

* Fix tracking wrong component balance deltas

Swapped and PositionUpdated are the only events affecting pool TVL

* Fix fee addition

Fees are a .64 instead of a .128 since v2 & the result is rounded

* Consistent naming

* cargo fmt

* Add method for selecting store method from change type

* Only store the affected sale rate delta on OrderUpdated events

* Remove unnecessary parameterization

* Index Ekubo MEV-resist pools

* cargo clippy
2025-06-30 14:45:08 +00:00

13 lines
320 B
Rust

use substreams::store::StoreSetSum;
use crate::pb::ekubo::ChangeType;
pub fn store_method_from_change_type<T, S: StoreSetSum<T>>(
change_type: ChangeType,
) -> fn(&S, u64, String, T) {
match change_type {
ChangeType::Delta => StoreSetSum::sum,
ChangeType::Absolute => StoreSetSum::set,
}
}