-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factory: Apply format change to readme
- Loading branch information
--local
committed
Dec 11, 2023
1 parent
11278eb
commit 74ea4f9
Showing
1 changed file
with
37 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,88 @@ | ||
# FACTORY | ||
#Dex Factory | ||
|
||
## Main functionality | ||
```The main purpose of the factory contract is to provide the tooling required for managing, creating, querying of liquidity pools.``` | ||
|
||
The main purpose of the factory contract is to provide the tooling required for managing, creating, querying of liquidity pools. | ||
|
||
## Messages | ||
|
||
## Main methods: | ||
#### 1. initialize | ||
`initialize` | ||
|
||
**params:** | ||
* admin: `Address` of the contract administrator to be | ||
* multihop_wasm_hash: `BytesN<32>` hash of the multihop contract to be deployed initially | ||
|
||
**return type:** | ||
void | ||
|
||
**description:** | ||
Used for the initialization of the factory contract - this sets the factory contract as initialized, deploys a multihop contract and sets up the initial factory configuration. The configuration includes admin and address of multihop contract | ||
Params: | ||
- `admin`: `Address` of the contract administrator to be | ||
- `multihop_wasm_hash`: `BytesN<32>` hash of the multihop contract to be deployed initially | ||
|
||
<hr> | ||
|
||
#### 2. create_liquidity_pool | ||
**params:** | ||
`create_liquidity_pool` | ||
|
||
* lp_init_info: `LiquidityPoolInitInfo` struct representing information for the new liquidity pool | ||
Params: | ||
- `lp_init_info`: `LiquidityPoolInitInfo` struct representing information for the new liquidity pool | ||
|
||
**return type:** | ||
Return type: | ||
`Address` of the newly created liquidity pool | ||
|
||
**description:** | ||
Description: | ||
|
||
Creates a new liquidity pool with 'LiquidityPoolInitInfo'. After deployment of the liquidity pool it updates the liquidity pool list. | ||
|
||
<hr> | ||
|
||
#### 3. query_pools | ||
|
||
**params:** | ||
* None | ||
`query_pools` | ||
|
||
**return type:** | ||
Return type: | ||
`Vec<Address>` of all the liquidity pools created by the factory | ||
|
||
**description:** | ||
Description: | ||
Queries for a list of all the liquidity pool addresses that have been created by the called factory contract. | ||
|
||
<hr> | ||
|
||
#### 4. query_pool_details | ||
`query_pool_details` | ||
|
||
**params:** | ||
Params: | ||
- `pool_address`: `Address` of the liquidity pool we search for | ||
|
||
* pool_address: `Address` of the liquidity pool we search for | ||
Return type: | ||
Struct `LiquidityPoolInfo` containing the information about a given liquidity pool. | ||
|
||
**return type:** | ||
`LiquidityPoolInfo` Struct containing the information about a given liquidity pool. | ||
|
||
**description:** | ||
Description: | ||
Queries for specific liquidity pool information that has been created by the called factory contract. | ||
|
||
<hr> | ||
|
||
#### 5. query_all_pools_details | ||
|
||
**params:** | ||
|
||
* None | ||
`query_all_pools_details` | ||
|
||
**return type:** | ||
`Vec<LiquidityPoolInfo>` List of structs containing the information about all liquidity pools created by the factory. | ||
Return type: | ||
`Vec<LiquidityPoolInfo>` list of structs containing the information about all liquidity pools created by the factory. | ||
|
||
**description:** | ||
Description: | ||
Queries for all liquidity pools information that have been created by the called factory contract. | ||
|
||
<hr> | ||
|
||
#### 6. query_for_pool_by_token_pair(env: Env, token_a: Address, token_b: Address) -> Address; | ||
`query_for_pool_by_token_pair(env: Env, token_a: Address, token_b: Address)`; | ||
|
||
**params:** | ||
Params: | ||
- token_a: `Address` of the first token in the pool | ||
- token_b: `Address` of the second token in the pool | ||
|
||
* token_a: `Address` of the first token in the pool | ||
* token_b: `Address` of the second token in the pool | ||
|
||
**return type:** | ||
Return type: | ||
`Address` of the found liquidity pool that holds the given token pair. | ||
|
||
**description:** | ||
Description: | ||
Queries for a liquidity pool address by the tokens of that pool. | ||
|
||
<hr> | ||
|
||
#### 7. get_admin | ||
|
||
**params:** | ||
|
||
* None | ||
`get_admin` | ||
|
||
**return type:** | ||
Return type: | ||
`Address` of the admin for the called factory. | ||
|
||
**description:** | ||
Queries for admin address of the called factory contract | ||
<hr> | ||
|
||
#### 8. get_config | ||
|
||
**params:** | ||
|
||
* None | ||
|
||
**return type:** | ||
`Config` of the called factory. | ||
`get_config` | ||
|
||
**description:** | ||
Queries for the config of the called factory contract | ||
Return type: | ||
Struct `Config` of the called factory. |