forked from ACLM-Automated-Contrated-Liquidity/aclm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-sequence.puml
39 lines (35 loc) · 986 Bytes
/
main-sequence.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@startuml Main Sequence
actor User
participant Frontend as F #LightPink
participant Backend as B
participant "Smart Contract" as SC #DarkGray
participant "Chainlink Automation" as CA #SkyBlue
User -> F: Choose Network and Pool
F -> B: fetch yield estimation
F <-- B
User <-- F
CA -> CA: checkUpkeep
User -> F: Chose target price range
User <-- F: re-estimate
CA -> CA: checkUpkeep
User -> F: Connect Wallet
User <-- F
User -> F: Press "Invest"
F -> F: Calculate ticks and amounts
F -> SC: call "invest" method with params
SC -> SC: Deposit money on contract
CA -> CA: checkUpkeep
SC -> SC: Swap to target amounts
SC -> SC: Mint new position on Pool
F <-- SC: return back TX
User <-- F: show TX to the user
=== Price moved out of range... ==
CA -> CA: checkUpkeep
alt upkeep needed
SC <-- CA: performUpkeep
SC -> SC: remove out of range position
SC -> SC: rebalance tokens
SC -> SC: mint new position
note left: different position strategies may apply
end
@enduml