-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat: unified trade events #910
base: master
Are you sure you want to change the base?
Conversation
@@ -747,7 +757,7 @@ pub mod pallet { | |||
/// - `amount`: The amount of `asset_out`. | |||
/// - `max_limit`: maximum amount of `asset_in` to be sold in exchange for `asset_out`. | |||
/// | |||
/// Emits `BuyExecuted` when successful. | |||
/// Emits `pallet_trade_event::Swapped` when successful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep both for a bit
@@ -1111,6 +1127,18 @@ impl<T: Config> AMM<T::AccountId, AssetId, AssetPair, BalanceOf<T>> for Pallet<T | |||
fee_amount: transfer.fee.1, | |||
}); | |||
|
|||
pallet_trade_event::Pallet::<T>::deposit_trade_event( | |||
transfer.origin.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking to add second account because of the Intents... We might have 2 accounts trading directly. cc @enthusiastmartin wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also easier to track when if have multiple pools with same assets
transfer.amount, | ||
transfer.amount_b, | ||
vec![transfer.fee], | ||
None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch id?
/// Amount of the Hub asset has been updated. | ||
HubAmountUpdated { | ||
hub_amount_in: Balance, | ||
hub_amount_out: Balance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch-id? (I would probably rename it to event-id or something similar)
); | ||
|
||
Ok(()) | ||
Self::do_sell(origin, asset_in, asset_out, amount, min_buy_amount, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch id?
Fixes #755