antimatter-dao / polka-pallet

DeFi Pallet for Polkadot
Apache License 2.0
10 stars 5 forks source link

Implement decentralized exchange pool base on Uniswap VIA rust and substrate #3

Open 4his2 opened 2 years ago

4his2 commented 2 years ago

Enhancement

armatrix commented 2 years ago

I will contribute the following modules:

  1. swap_with_exact_supply
  2. swap_with_exact_target
  3. add_liquidity
  4. remove_liquidity
  5. new_trading_pair & enable_trading_pair & disable_trading_pair
armatrix commented 2 years ago

Event Type:

    #[pallet::event]
    #[pallet::generate_deposit(pub (crate) fn deposit_event)]
    pub enum Event<T: Config> {
        AddPreparing(T::AccountId, CurrencyId, Balance, CurrencyId, Balance),

        AddLiquidity(T::AccountId, CurrencyId, Balance, CurrencyId, Balance, Balance),

        RemoveLiquidity(T::AccountId, CurrencyId, Balance, CurrencyId, Balance, Balance),

        Swap(T::AccountId, CurrencyIds, Balance, Balance),

        EnableTradingPair(TradingPair),

        NewTradingPair(TradingPair),

        DisableTradingPair(TradingPair),

        PreparingToEnabled(TradingPair, Balance, Balance, Balance),
    }