Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: accepted_assets_conf #498

Merged
merged 2 commits into from
Apr 27, 2023
Merged

fix: accepted_assets_conf #498

merged 2 commits into from
Apr 27, 2023

Conversation

Senna46
Copy link
Contributor

@Senna46 Senna46 commented Apr 24, 2023

Fix for build then lunch

@Senna46 Senna46 requested a review from taiki1frsh April 24, 2023 05:49
@@ -80,7 +80,7 @@ jq '.app_state.derivatives.params.pool_params.base_lpt_mint_fee = "0.001"' $NODE
jq '.app_state.derivatives.params.pool_params.base_lpt_redeem_fee = "0.001"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.pool_params.report_liquidation_reward_rate = "0.001"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.pool_params.report_levy_period_reward_rate = "0.001"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.pool_params.accepted_assets = [{"denom":"ubtc", "target_weight": "0.6"}, {"denom":"uusdc", "target_weight":"0.4"}]' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.pool_params.accepted_assets_conf = [{"denom":"ubtc", "target_weight": "0.6"}, {"denom":"uusdc", "target_weight":"0.4"}]' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.perpetual_futures.commission_rate = "0.001"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.perpetual_futures.margin_maintenance_rate = "0.5"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;
jq '.app_state.derivatives.params.perpetual_futures.imaginary_funding_rate_proportional_coefficient = "0.0005"' $NODE_HOME/config/genesis.json > temp.json ; mv temp.json $NODE_HOME/config/genesis.json;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the code patch seems to modify the parameters of a derivatives protocol. There are some minor improvements that can be suggested:

  1. It would be better to have the path to the genesis file as a variable instead of hardcoding it.
  2. It is a good practice to add comments to explain what each line of the patch is doing.

Regarding potential bug risks, it is difficult to assess without knowing the context and the specifics of the derivatives protocol. However, as long as the modified parameter values are valid and tested, there should not be any immediate bug risk.

$BINARY tx derivatives burn-lpt 1 ubtc --from=$USER1 $conf | jq .raw_log | sed 's/\\n/\n/g'
$BINARY tx derivatives burn-lpt 1 ubtc --from=$USER1 $conf | jq .raw_log | sed 's/\\n/\n/g'
$BINARY tx derivatives withdraw-from-pool 1 ubtc --from=$USER1 $conf | jq .raw_log | sed 's/\\n/\n/g'
$BINARY tx derivatives withdraw-from-pool 1 ubtc --from=$USER1 $conf | jq .raw_log | sed 's/\\n/\n/g'

# open-position perpetual-futures
$BINARY tx derivatives open-position perpetual-futures 100ubtc ubtc uusdc long --from=$USER1 $conf | jq .raw_log | sed 's/\\n/\n/g'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code patch seems to be replacing the commands for minting and burning LPT with new commands for depositing to and withdrawing from a pool using binaries. It also includes a command for opening a position in perpetual futures. Without knowledge of the system being used, it is difficult to assess if there are any bug risks or improvements that can be suggested. However, make sure to thoroughly test the new commands before deploying them in production.

@Senna46 Senna46 mentioned this pull request Apr 24, 2023
@Senna46 Senna46 merged commit 3c7be4f into newDevelop Apr 27, 2023
@Senna46 Senna46 deleted the fix/build branch April 27, 2023 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants