Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Liquidity Pools is another dimension in this set of scenarios for Decentralized Exchanges. Basically it can be used in pair with or without bridges, so let's take a more clean example without them. But let's not stick to an Exchange Pair and work with multi-currency liquidity:

PlantUML diagramImage Added

Expand
titlePlant UML


No Format
nopaneltrue
@startuml
Trader -> Iroha: Register Exchange Liquidity [20XOR, 20ETH, 1BTC]
Seller -> Iroha: Place Exchange Order(1BTC, 20ETH)
Iroha -> "BTC bridge": Mint 1BTC to Seller
alt Success:
  Iroha -> Iroha: Transfer 1BTC from Seller to Trader
  alt Success:
    Iroha -> Iroha: Transfer 20ETH from Trader to Seller
  end
end
@enduml


From the high level perspective this scenario looks very similar with two previous because all of them are based on top of two Iroha functions:

  • Assets Transfer
  • Iroha Triggers

Resulting Behavior

Let's write all three scenarios as one feature description according to BDD with more details:

No Format
nopaneltrue
Feature: Decentralized Exchange
  Scenario: Buyer exchanges 20xor for 100usd
    Given:
    When:
    Then:
  Scenario: Buyer exchanges 20xor for 100usd
    Given:
    When:
    Then:
  Scenario: Buyer exchanges 20xor for 100usd
    Given:
    When:
    Then:

...