-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflow.txt
60 lines (49 loc) · 1.44 KB
/
flow.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Bitsave flow in zetachain
-- Features
- Swap token
* to stable coin
* to any other coin
- Lock token
This has been remodelled as a parent-child contract relationship
basically, we send funds and savings details to child contract
- Withdraw token
* As stable coin
* In original coin
* With interest in bitsave coin
-- Flow
* User saves in volatile token V.
* User puts in penalty percentage P they want to pay.
* User interest B is calculated.
? User can choose to save in safe or risk mode
- If safe mode:
* Token V is converted to stable coin S.
* coin S is locked in user's account for time T.
* User waits till maturity time
? If user breaks savings
- True
* S is unlocked from user's account
* Penalty P% is removed from S.
* Remaining S is converted to V.
* V is made available to user without extra interest B.
- False
* S is unlocked for user.
* S is converted to V
* Interest B is added to wallet.
- Not safe mode
* Token V is locked for user.
? If maturity failed
* Token is unlocked
* Penalty P% is removed from V.
* Remaining T is available for user.
* Interest B is not sent to user.
Else
* Token V is available for user.
* Interest B is sent to user.
Safe vs Risk
If safe,
Amount saved is amout withdrawn
- Pros
* Drop in price due to volatility of token is avoided.
- Cons
* Profit in price of token is lost.
Risk mode is opposite of safe mode.