https://github.com/astarnetwork/plo-script
PLO distribution script.
https://github.com/astarnetwork/plo-script
Last synced: about 1 year ago
JSON representation
PLO distribution script.
- Host: GitHub
- URL: https://github.com/astarnetwork/plo-script
- Owner: AstarNetwork
- License: mit
- Created: 2021-04-25T11:47:18.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-31T15:11:35.000Z (almost 4 years ago)
- Last Synced: 2024-04-14T01:58:40.770Z (about 2 years ago)
- Language: TypeScript
- Homepage:
- Size: 20.5 MB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PLO Scripts
This script calculates and distributes the compensation for Parachain Lease Offering in the Plasm network.
Parachain Lease Offering fees are distributed according to the logic of this script.
## Settings
- `config/config.json`: Specifies the mnemonic phrase of the user who will run the deployment and the file in which to save it.
- `config/subscan.json`: Set the parameters to use when hitting the Subscan API here, such as AuctionId, ParaId, fundId, etc.
- `src/model/Reward.ts`: Write the parameters to calculate the reward.
`SDN_{a,b} = \frac{KSM_{a,b}C_a}{\sum_{i=0}^{n}{\sum_{j=0}^{m_i}KSM_{i,j}C_i}}\times6,750,000`
For example:
```ts
export const SDNCrowdloanParameter: Parameter = {
started: 0,
auctionsStarted: [200000, 300000, 400000], // after won.
contributeCofficient: [6, 5, 4], // same as C[i]
supply: 6750000, // 15% of total supply
};
```
## Execute
You can run the program in the following command format.
`yarn start -e -c `
### execute option
- `auction`: Aggregates the bids for Parachain Auction.
- `crowdloan`: Aggregate contributions to the Crowdloan; note that it is different in nature from bids.
- `rewards`: Calculate the reward to be distributed to each user based on the aggregate results of bids and contributions.
- `transfer`: Distribute the actual reward from the calculated reward. This transaction will be executed only once. Also, make sure that there is enough tokens in the specified mnemonic address to cover the total amount of rewards plus the cost of gas.
### chain option
Specifies the name of the relay chain. The following relay chains are supported.
- `kusama`
- `polkadot`
- `rococo`
## Project Structure
Everything that is directly related to the tool's functionality will be inside the `src/*` folder.
`yarn start` will execute `index.ts`, which contains what ever script you imported inside the `cli/` folder.
- `src/cli/`: The main tool logic. Everything you want to execute should be in here.
- `src/helper/`: All utility functions that is used throughout different cli functions should be placed here.
- `src/model/`: Data models used internally and from external APIs should be defined here.
- `src/type/`: This is a special folder that contains the global type declarations, for example, importing `.csv` files as string within TypeScript.
- `report/`: Cached data, account data, any fixed peace of data will be placed in here, and it is recommended that all local data read/writes within a cli function points their directory to this folder.