HydraDX-node icon indicating copy to clipboard operation
HydraDX-node copied to clipboard

Unify all trading events into the one generic one

Open mrq1911 opened this issue 1 year ago • 5 comments

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)

mrq1911 avatar Feb 06 '24 11:02 mrq1911

We should probably include fee as part of this

jak-pan avatar Feb 06 '24 13:02 jak-pan

related to https://github.com/galacticcouncil/Basilisk-node/issues/469

jak-pan avatar Feb 21 '24 17:02 jak-pan

Add id if the tx was fired from router

jak-pan avatar Feb 23 '24 15:02 jak-pan

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)

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?

jak-pan avatar Apr 22 '24 16:04 jak-pan

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.

jak-pan avatar Apr 22 '24 16:04 jak-pan