Closed nud3l closed 1 year ago
- Fees paid
@nud3l : This information is not available on the events (DexGeneral.AssetSwap
and DexStable.CurrencyExchange
). Should we create an issue in interbtc
to add that info to the events?
Naturally, squid can query the chain, but we need to be very careful of the processing cost. If possible I'd like to avoid making squid processing slower due to additional lookups.
Good point. Just for me to check: the vector of amounts
in the pallet is just the in and out the amount and does not contain the fee? @gregdhill maybe you know more as well. This is was I was looking at: https://github.com/interlay/interbtc/blob/master/crates/dex-general/src/swap/mod.rs#L266
- From asset
- To asset
- From amount
- To amount
One more point to clarify: For multi-path swaps (e.g. KBTC -> KSM -> KINT), do we want to ignore the intermediate swaps and only track the first input / last output (KBTC in, KINT out, ignore KSM values)?
I thought that multi-hop would fire multiple events, so if it's multi-hop we would see:
For now, we would not need any aggregation/special handling of this as right now we are just interested in the fees that we collect in the AMM.
I thought that multi-hop would fire multiple events
For DexStable.CurrencyExchange
events we only have in/out amounts in an event as far as I recall.
For DexGeneral.AssetSwap
the entire path is included as far as I understood.
In fact, I split the path into "pairwise swaps" for cumulative values inside squid. See code sample here.
DexGeneral.AssetSwap
amounts
vector includes the feePairCreated
DexStable.CurrencyExchange
NewSwapFee
and NewAdminFee
update fee rates, not included in CreatePool
DexStable.CurrencyExchangeUnderlying
PR: #114
Sample query and result shown in this comment
We want to track historical swap data including: