HydraDX-node
HydraDX-node copied to clipboard
Unify all trading events into the one generic one
Swapped {
who: AccountId,
pool: PoolType,
operation: ( Buy | Sell ),
asset_in: AssetId,
asset_out: AssetId,
amount_in: Balance,
amount_out: Balance,
fee_rate: Permill
batch: Option<u256>
}
batch is nonce that router is setting on start of execution and resetting to None
after
add all trading events in the Omnipool, Stableswap, XYK & OTC with this one depreciate all the old trading related fees (will be removed in future)
We should probably include fee as part of this
related to https://github.com/galacticcouncil/Basilisk-node/issues/469
Add id if the tx was fired from router
Swapped { who: AccountId, pool: PoolType, operation: ( Buy | Sell ), asset_in: AssetId, asset_out: AssetId, amount_in: Balance, amount_out: Balance, fee_rate: Permill batch: Option<u256> }
batch is nonce that router is setting on start of execution and resetting to
None
afteradd all trading events in the Omnipool, Stableswap, XYK & OTC with this one depreciate all the old trading related fees (will be removed in future)
I am using swap_type: exact_in || exact_out instead of buy | sell + flag partial : bool when user indicated he is ok with partial execution + it doesn't need to be pool - we can have OTC or off chain matched swaps. So I would maybe suggest firing name of the function called in operation. I.E. XYKSell | XYKBuy or just keep the area e.g. XYK | Omnipool. + I would add some kind of id. I see batch nonce is this unique in any way?
I'm experimenting with some unique swap id for off chain solving as we will probably want to be able to accept multiple non-ordered swaps from one person to be executed once the conditions match. I would probably like to see this info. We will however need to add this to all swap calls to retain this.