diff --git a/contracts/pool_stable/README.md b/contracts/pool_stable/README.md index 9324d008..337ac733 100644 --- a/contracts/pool_stable/README.md +++ b/contracts/pool_stable/README.md @@ -3,7 +3,7 @@ ## Main functionality This contract is being used for managing stable coins within the Phoenix DEX. It offers liquidity provision, trading assets and pool management functionalities. -## Main methods: +## Messages: `initialize` Params: diff --git a/contracts/stake/README.md b/contracts/stake/README.md index 0330f021..194a7ea2 100644 --- a/contracts/stake/README.md +++ b/contracts/stake/README.md @@ -1,213 +1,213 @@ # STAKING ## Main functionality -```Provides staking capabilities, reward distribution and reward management functionalities to the Phoenix DEX.```w +Provides staking capabilities, reward distribution and reward management functionalities to the Phoenix DEX. -## Main methods: -#### 1. initialize +## Messages: +`initialize` -**params:** -* admin: `Address` of the administrator for the contract -* lp_token: `Address` of the liquidity pool used with this stake contract -* min_bond: `i128` value showing the minimum required bond - * max_distributions: `u32` value showing the maximum number of distributions - * min_reward: `i128` the minimum amount of rewards the user can withdraw. +Params: +- `admin`: `Address` of the administrator for the contract +- `lp_token`: `Address` of the liquidity pool used with this stake contract +- `min_bond`: `i128` value showing the minimum required bond +- `max_distributions`: `u32` value showing the maximum number of distributions +- `min_reward`: `i128` the minimum amount of rewards the user can withdraw. -**return type:** +Return type: void -**description:** +Description: Used to set up the staking contract with the initial parameters.
-#### 2. bond +`bond` -**params:** -* sender: `Address` of the user that sends tokens to the stake contract. -* tokens: `i128` value representing the number of tokens the user sends. +Params: +- `sender`: `Address` of the user that sends tokens to the stake contract. +- `tokens`: `i128` value representing the number of tokens the user sends. -**return type:** +Return type: void -**description:** +Description: Allows for users to stake/bond their lp tokens
-#### 3. unbond +`unbond` -**params:** -* sender: `Address` of the user that wants to unbond/unstake their tokens. -* stake_amount: `i128` value representing the numbers of stake to be unbond. -* stake_timestamp: `u64`value used to calculate the correct stake to be removed +Params: +- `sender`: `Address` of the user that wants to unbond/unstake their tokens. +- `stake_amount`: `i128` value representing the numbers of stake to be unbond. +- `take_timestamp`: `u64`value used to calculate the correct stake to be removed -**return type:** +Return type: void -**description:** +Description: Allows the user remove their staked tokens from the stake contract, with any rewards they may have earned, based on the amount of staked tokens and stake's timestamp.
-#### 4. create_distribution_flow +`create_distribution_flow` -**params:** -* sender: `Address` of the user that creates the flow -* manager: `Address` of the user that will be managing the flow -* asset: `Address` of the asset that will be used in the distribution flow +Params: +- `sender`: `Address` of the user that creates the flow +- `manager`: `Address` of the user that will be managing the flow +- `asset`: `Address` of the asset that will be used in the distribution flow -**return type:** +Return type: void -**description:** +Description: Creates a distribution flow for sending rewards, that are managed by a manager for a specific asset.
-#### 5. distribute_rewards +`distribute_rewards` -**params:** -* None +Params: +None -**return type:** +Return type: void -**description:** +Description: Sends the rewards to all the users that have stakes, on the basis of the current reward distribution rule set and total staked amount.
-#### 6. withdraw_rewards +`withdraw_rewards` -**params:** -* sender: `Address` of the user that wants to withdraw their rewards +Params: +- `sender`: `Address` of the user that wants to withdraw their rewards -**return type:** +Return type: void -**description:** +Description: Allows for users to withdraw their rewards from the stake contract.
-#### 7. fund_distribution +`fund_distribution` -**params:** -* sender: `Address` of the user that calls this method. -* start_time: `u64` value representing the time in which the funding has started. -* distribution_duration: `u64` value representing the duration for the distribution in seconds -* token_address: `Address` of the token that will be used for the reward distribution -* token_amount: `i128` value representing how many tokens will be allocated for the distribution time +Params: +- `sender`: `Address` of the user that calls this method. +- `start_time`: `u64` value representing the time in which the funding has started. +- `distribution_duration`: `u64` value representing the duration for the distribution in seconds +- `token_address`: `Address` of the token that will be used for the reward distribution +- `token_amount`: `i128` value representing how many tokens will be allocated for the distribution time -**return type:** +Return type: void -**description:** +Description: Sends funds for a reward distribution.
## Queries: -#### 1. query_config +`query_config` -**params:** -* None +Params: +None -**return type:** +Return type: `ConfigResponse` struct. -**description:** +Description: Queries the contract `Config`
-#### 2. query_admin +`query_admin` -**params:** -* None +Params: +None -**return type:** +Return type: `Address` struct. -**description:** +Description: Returns the address of the admin for the given stake contract.
-#### 3. query_staked +`query_staked` -**params:** -* address: `Address` of the stake contract we want to query +Params: +- `address`: `Address` of the stake contract we want to query -**return type:** +Return type: `StakedResponse` struct. -**description:** +Description: Provides information about the stakes of a specific address.
-#### 4. query_total_staked +`query_total_staked` -**params:** -* None +Params: +None -**return type:** +Return type: `i128` -**description:** +Description: Returns the total amount of tokens currently staked in the contract.
-#### 5. query_annualized_rewards +`query_annualized_rewards` -**params:** -* None +Params: +None -**return type:** +Return type: `AnnualizedRewardsResponse` struct -**description:** +Description: Provides an overview of the annualized rewards for each distributed asset.
-#### 6. query_withdrawable_rewards +`query_withdrawable_rewards` -**params:** -* address: `Address` whose rewards we are searching +Params: +- `address`: `Address` whose rewards we are searching -**return type:** +Return type: `WithdrawableRewardsResponse` struct -**description:** +Description: Queries the amount of rewards that a given address can withdraw.
-#### 7. query_distributed_rewards +`query_distributed_rewards` -**params:** -* asset: `Address` of the token for which we query +Params: +- `asset`: `Address` of the token for which we query -**return type:** +Return type: `u128` -**description:** +Description: Reports the total amount of rewards distributed for a specific asset.
-#### 8. query_undistributed_rewards +`query_undistributed_rewards` -**params:** -* asset: `Address` of the token for which we query +Params: +- `asset`: `Address` of the token for which we query -**return type:** +Return type: `u128` -**description:** +Description: Queries the total amount of remaining rewards for a given asset.