Skip to content

Commit

Permalink
Add PrivaDEX milestones 1, 2, 3, 4 (#744)
Browse files Browse the repository at this point in the history
  • Loading branch information
kapilsinha authored Feb 27, 2023
1 parent b98b2c7 commit eb9859a
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
23 changes: 23 additions & 0 deletions deliveries/PrivaDEX_aggregator_milestone_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Milestone Delivery :mailbox:

**The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

* **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/PrivaDEX_aggregator.md
* **Milestone Number:** 1

**Context**
Network graph generator API: This component scrapes DEX state on Moonbeam and Astar, and combines it with bridge metadata (e.g. asset XCM definitions, HRMP channels) to generate a network graph.

**Deliverables**

| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/LICENSE | I have opted for SSPL instead of GPLv3 to explicitly define conditions for SaaS that use this component. Please see https://www.mongodb.com/licensing/server-side-public-license/faq. |
| 0b. | Documentation | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/README.md | Please see the README files in the subfolders for added details.
| 0c. | Testing and Testing Guide | 1. https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/common/README.md#docker-testing-guide <br>2. https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/chain_metadata/README.md#docker-testing-guide <br>3. https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/routing/README.md#docker-testing-guide |
| 0d. | Docker | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/Dockerfile | The Dockerfile can be used to create the Docker container and launch a bash shell inside, from which you can run unit tests, integration tests, and examples. Please see the above testing guides for details.
| 1-3. | Price feed for ArthSwap, StellaSwap, BeamSwap | https://github.com/kapilsinha/privadex/tree/milestone_submission_1_2/dex_indexer | Please see https://github.com/kapilsinha/privadex/tree/milestone_submission_1_2/dex_indexer#setup for details on how to set up the price feed for a certain parachain.
| 4. | Rust GraphQL client | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/routing/src/graphql_client.rs |
| 5. | Chain metadata store | https://github.com/kapilsinha/privadex/tree/milestone_submission_1_2/dex_aggregator/chain_metadata |
| 6. | Graph library | https://github.com/kapilsinha/privadex/tree/milestone_submission_1_2/dex_aggregator/routing/src/graph |
| 7. | Network graph construction | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/routing/src/graph_builder.rs |
21 changes: 21 additions & 0 deletions deliveries/PrivaDEX_aggregator_milestone_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Milestone Delivery :mailbox:

**The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

* **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/PrivaDEX_aggregator.md
* **Milestone Number:** 2

**Context**
Execution plan generator API: This component generates an 'execution plan' from the GraphSolution generated by the network graph API, which is a high-level sequence of instructions to convert from source to destination token.

**Deliverables**

| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/LICENSE | I have opted for SSPL instead of GPLv3 to explicitly define conditions for SaaS that use this component. Please see https://www.mongodb.com/licensing/server-side-public-license/faq. |
| 0b. | Documentation | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/README.md | Please see the README files in the subfolders for added details.
| 0c. | Testing and Testing Guide | 1. https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/routing/README.md#docker-testing-guide <br>2. https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/execution_plan/README.md#docker-testing-guide |
| 0d. | Docker | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/Dockerfile | The Dockerfile can be used to create the Docker container and launch a bash shell inside, from which you can run unit tests, integration tests, and examples. Please see the above testing guidesfor details.
| 1. | Smart order router algorithm | https://github.com/kapilsinha/privadex/tree/milestone_submission_1_2/dex_aggregator/routing/src/smart_order_router |
| 2. | GraphSolution to ExecutionPlan converter | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/execution_plan/src/execution_plan.rs |
| 3. | ExecutionPlan validator | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/execution_plan/src/validator.rs |
21 changes: 21 additions & 0 deletions deliveries/PrivaDEX_aggregator_milestone_3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Milestone Delivery :mailbox:

**The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

* **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/PrivaDEX_aggregator.md
* **Milestone Number:** 3

**Context**
Executor: This component executes all swaps, XCM bridges, and balance/asset transfers from the 'execution plan' of the previous step. The end result is that the destination token arrives in the user's wallet on the destination chain.

**Deliverables**
| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/LICENSE | I have opted for SSPL instead of GPLv3 to explicitly define conditions for SaaS that use this component. Please see https://www.mongodb.com/licensing/server-side-public-license/faq. |
| 0b. | Documentation | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/README.md | Please see the README files in the subfolders for added details.
| 0c. | Testing and Testing Guide | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/dex_aggregator/executor/README.md#docker-testing-guide |
| 0d. | Docker | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/Dockerfile | The Dockerfile can be used to create the Docker container and launch a bash shell inside, from which you can run unit tests and examples. Please see the above testing guides for details.
| 1. | Rust Ethereum interface utils | https://github.com/kapilsinha/privadex/tree/milestone_submission_3/dex_aggregator/executor/src/eth_utils |
| 2. | Rust Substrate interface utils | https://github.com/kapilsinha/privadex/tree/milestone_submission_3/dex_aggregator/executor/src/substrate_utils |
| 3. | Substrate extrinsic signature and construction utils | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/dex_aggregator/executor/src/extrinsic_call_factory.rs , https://github.com/kapilsinha/privadex/blob/milestone_submission_3/dex_aggregator/executor/src/substrate_utils/extrinsic_sig_config.rs |
| 4. | Phat Contract controller/driver | https://github.com/kapilsinha/privadex/blob/milestone_submission_3/dex_aggregator/executor/src/lib.rs#L182 | Please see https://www.youtube.com/watch?v=zTrWXj2WI3c for my test of the Phat Contract via Phat Contract UI. Due to all the dependencies involved, this will be far easier than performing this end-to-end test yourself.
28 changes: 28 additions & 0 deletions deliveries/PrivaDEX_aggregator_milestone_4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Milestone Delivery :mailbox:

**The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

* **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/PrivaDEX_aggregator.md
* **Milestone Number:** 4

**Context**
Consolidated backend API and swap UI: This component is the web interface for the end user (retail DEX trader).

**Deliverables**

| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License | https://github.com/kapilsinha/privadex-swap-ui/blob/main/LICENSE |
| 0b. | Documentation | https://github.com/kapilsinha/privadex-swap-ui/blob/main/README.md |
| 0c. | Testing and Testing Guide | https://github.com/kapilsinha/privadex-swap-ui/blob/main/README.md | The specified README indicates how to install the dependencies and start the UI.
| 0d. | Docker | N/A | Specified in the grant application that Docker is not applicable for this milestone and will be skipped
| 0e. | Article | https://medium.com/@kaprivadex/privadex-launch-ab7d6b6ad9db |
| 1. | S3 API for executor | https://github.com/kapilsinha/privadex/blob/milestone_submission_1_2/dex_aggregator/common/src/utils/s3_api.rs |
| 2. | Executor module scheduler | https://github.com/kapilsinha/privadex-swap-ui/blob/phat-contract-driver/drive_privadex_phat_contract.js |
| 3. | QuoteGetter API | https://github.com/kapilsinha/privadex-swap-ui/blob/main/src/phat_api/privadex_phat_contract_api.js | See the `quote(...)` function in this file.
| 4. | SwapRequest API | https://github.com/kapilsinha/privadex-swap-ui/blob/main/src/phat_api/privadex_phat_contract_api.js | See the `startSwap(...)` function in this file.
| 5. | GetSupportedChainTokens API | https://github.com/kapilsinha/privadex-swap-ui/blob/main/src/components/Modal/token_list.json | This file is largely auto-generated from [this script](https://github.com/kapilsinha/privadex-swap-ui/blob/main/scripts/generate_token_list.py) but short names are manually modified for clarity (e.g. specify 'Wormhole' for external USDC).
| 6. | Swap UI | https://github.com/kapilsinha/privadex-swap-ui/tree/main/src | The app is live at https://app.privadex.xyz

**Additional Information**
The UI is live at https://app.privadex.xyz and a video demo is at https://www.youtube.com/watch?v=QA5429uEZbw .

0 comments on commit eb9859a

Please sign in to comment.