Skip to content

Commit db5cb71

Browse files
authored
Added how it works + feature + program ixns description
1 parent 7d35220 commit db5cb71

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
## OpenVest
2-
### Vested Token Allocations for Employees
2+
Openvest allows you to create vested token allocations for company employees. A company can create its on-chain treasury account, and use that to create vested token allocations for its employees.
33

44
## Features
5-
1. Create Vesting Account for the Company
6-
2. Choose the start time, end time, cliff period and create vesting schedule for given employee
7-
3. Employee can claim some % the token allocation after cliff ends, full allocation is unlocked at end time.
5+
- Create Treasury Account for the Company, with desired token and amount of tokens to lock in treasury
6+
- Use the Company Account to create vested token allocations for its employees
7+
- Company Owner can choose `start date & time`, `end time`, `cliff period(the duration for which tokens are locked)` and the `beneficiary(employee)`
8+
- Employee can `claim` their allocation after the cliff period ends with entire allocation claimable only during the `end time`
89

910
## How it works
10-
Linear Vesting Schedule is followed, upon employee vesting account creation, tokens are locked in the treasury and can be claimed by the employee only after the cliff ends
11+
A Linear Vesting Schedule is followed.
12+
OpenVest implements a linear vesting schedule that provides a fair and gradual token allocation mechanism.
1113

12-
At CLIFF: (C - S)/(E - S)% of total allocation
13-
At ENDTIME: 100% OF TOTAL ALLOCATION
14+
15+
Let:
16+
17+
- `A = Total token allocation`
18+
- `S = Start time`
19+
- `C = Cliff time(Start time + Cliff Period)`
20+
- `E = End time`
21+
- `T = Current time`
22+
23+
The vesting calculation follows this formula:
24+
- Amount of tokens claimable at time T = `min(A * (T - S) / (E - S), A)`
25+
26+
Where:
27+
28+
1. If `T < S`: 0 tokens vested (pre-vesting period)
29+
2. If `S ≤ T < C`: 0 tokens vested (cliff period)
30+
3. If `C ≤ T ≤ E`: Proportional tokens vested(Amount = `A * (T - S) / (E - S)`)
31+
4. If `T = E`: Full allocation vested(`Full Amount = A` is unlocked)
32+
33+
## Program Implementation
34+
The core functionality is implemented in Rust using the Anchor framework:
35+
36+
- `create_vesting_account`: Creates the company vesting account along with the associated treasury account(which would contain the total amount of tokens)
37+
38+
- `create_employee_vesting`: Creates the employee vesting account with given `start time`, `end time`, and `cliff` and `beneficiary`, along with `employee allocation`
39+
40+
- `claim_tokens`: Allows the employee to claim his allocation after the cliff period, by transfering some % of employee allocation amount of tokens from the treasury account to the employee
1441

0 commit comments

Comments
 (0)