You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.3 KiB
67 lines
2.3 KiB
@startuml
|
|
|
|
actor "Buyer=Taker \n[frontend]" as Buyer
|
|
participant "Buyer \n[daemon]" as BuyerApp
|
|
participant "Buyer OrderTile Feed \n[in daemon]" as BuyerOrderFeed
|
|
participant "Buyer CFD Feed \n[in daemon]" as BuyerCfdFeed
|
|
participant "Seller CFD Feed \n[in daemon]" as SellerCfdFeed
|
|
participant "Seller OrderTile Feed \n[in daemon]" as SellerOrderFeed
|
|
participant "Seller \n[daemon]" as SellerApp
|
|
actor "Seller=Maker \n[frontend]" as Seller
|
|
participant Oracle as Oracle
|
|
|
|
note over Seller : currently static order in the frontend
|
|
Seller -> SellerOrderFeed: Subscribe
|
|
note over Seller: The seller should see the current active order \nInitially there is none (until one POSTed)
|
|
Seller -> SellerApp: POST sell order
|
|
|
|
group Oracle stuff?
|
|
SellerApp -> Oracle: Attestation for sell order
|
|
Oracle --> SellerApp: Attestation pubkey
|
|
end group
|
|
|
|
SellerApp -> SellerApp: Store current order
|
|
SellerApp -> SellerOrderFeed: Push order
|
|
SellerOrderFeed --> Seller: order [Untaken]
|
|
|
|
Buyer -> BuyerApp: Start daemon & UI
|
|
BuyerApp -> BuyerOrderFeed: Subscribe
|
|
BuyerApp -> BuyerCfdFeed: Subscribe
|
|
BuyerApp -> SellerApp: Open TCP (socket) connection
|
|
SellerApp -> SellerApp: New connection
|
|
SellerApp -> BuyerApp: {TCP} Current order
|
|
|
|
note over SellerOrderFeed : Assumption: Current order \nalways available for new subscriptions
|
|
BuyerApp -> BuyerOrderFeed: push order
|
|
BuyerOrderFeed --> Buyer: order
|
|
|
|
Buyer -> Buyer: Click BUY
|
|
Buyer -> BuyerApp: POST cfd_order_request
|
|
BuyerApp -> BuyerApp: Create cfd [OrderRequest]
|
|
note over BuyerApp: Must include order_id
|
|
|
|
BuyerApp -> BuyerCfdFeed: Push cfd
|
|
BuyerCfdFeed --> Buyer: cfd [OrderRequest]
|
|
|
|
BuyerApp -> SellerApp: {TCP} cfd_order_request (order_id, quantity)
|
|
SellerApp -> SellerApp: Create cfd [OrderRequest]
|
|
SellerApp -> SellerCfdFeed: cfd [OrderRequest]
|
|
SellerCfdFeed --> Seller: cfd [OrderRequest]
|
|
Seller -> Seller: Accept cfd
|
|
Seller -> SellerApp: POST cfd [Accepted]
|
|
SellerApp -> BuyerApp: {TCP} cfd [Accepted]
|
|
SellerApp -> SellerCfdFeed: cfd [Accepted]
|
|
SellerCfdFeed --> Seller: cfd [Accepted]
|
|
BuyerApp -> BuyerCfdFeed: cfd [Accepted]
|
|
BuyerCfdFeed --> Buyer: cfd [Accepted]
|
|
|
|
ref over BuyerApp, SellerApp: {TCP} protocol setup messaging & contract publication on Bitcoin\n-> cfd in state [ContractSetup]
|
|
|
|
SellerApp -> SellerCfdFeed: cfd [Open]
|
|
SellerCfdFeed --> Seller: cfd [Open]
|
|
BuyerApp -> BuyerCfdFeed: cfd [Open]
|
|
BuyerCfdFeed --> Buyer: cfd [Open]
|
|
|
|
|
|
|
|
@enduml
|
|
|