Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

feat: unified trade events #910

wants to merge 2 commits into from

Conversation

Roznovjak
Copy link
Contributor

Fixes #755

@Roznovjak Roznovjak self-assigned this Sep 20, 2024
@@ -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.
Copy link
Contributor

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(),
Copy link
Contributor

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?

Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

@jak-pan jak-pan Sep 20, 2024

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batch id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify all trading events into the one generic one
2 participants