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

[LeverageLp]: add position usd value #764

Merged
merged 3 commits into from
Sep 3, 2024
Merged

Conversation

cryptokage1996
Copy link
Contributor

@cryptokage1996 cryptokage1996 commented Sep 2, 2024

add a new field in query elys.leveragelp.queryPositionsForAddress for the USD amount of the position

https://elys.atlassian.net/browse/DEV-1695

@cryptokage1996 cryptokage1996 changed the title feat: add position usd value [LeverageLp] add position usd value Sep 2, 2024
@cryptokage1996 cryptokage1996 changed the title [LeverageLp] add position usd value [LeverageLp]: add position usd value Sep 2, 2024
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.42%. Comparing base (2667e71) to head (782f18c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #764   +/-   ##
=======================================
  Coverage   42.42%   42.42%           
=======================================
  Files         628      628           
  Lines       20457    20458    +1     
=======================================
+ Hits         8679     8680    +1     
  Misses      10772    10772           
  Partials     1006     1006           
Components Coverage Δ
leveragelp_transactions 82.84% <ø> (ø)
leveragelp_lifecycle 88.29% <ø> (ø)
leveragelp_keeper 48.35% <ø> (ø)
leveragelp_queries 19.28% <ø> (ø)
accountedpool_transactions 100.00% <ø> (ø)
accountedpool_lifecycle ∅ <ø> (∅)
accountedpool_queries 68.42% <ø> (ø)
amm_transactions 57.93% <ø> (ø)
amm_lifecycle 79.16% <ø> (ø)
amm_keeper 61.13% <ø> (ø)
amm_queries 29.94% <ø> (ø)
assetprofile_transactions 78.82% <ø> (ø)
assetprofile_lifecycle ∅ <ø> (∅)
assetprofile_keeper 83.33% <ø> (ø)
assetprofile_queries 47.41% <ø> (ø)
burner_transactions 0.00% <ø> (ø)
burner_lifecycle ∅ <ø> (∅)
burner_keeper 100.00% <ø> (ø)
burner_queries 63.54% <ø> (ø)
clock_transactions 30.00% <ø> (ø)
clock_lifecycle ∅ <ø> (∅)
clock_keeper 76.92% <ø> (ø)
clock_queries ∅ <ø> (∅)
commitment_transactions 48.95% <ø> (ø)
commitment_lifecycle ∅ <ø> (∅)
commitment_keeper 19.60% <ø> (ø)
commitment_queries 9.33% <ø> (ø)
epochs_transactions ∅ <ø> (∅)
epochs_lifecycle 100.00% <ø> (ø)
epochs_keeper 81.81% <ø> (ø)
epochs_queries 85.71% <ø> (ø)
estaking_transactions 48.64% <ø> (ø)
estaking_lifecycle 71.23% <ø> (ø)
estaking_keeper 63.05% <ø> (ø)
estaking_queries 55.31% <ø> (ø)
incentive_transactions 0.00% <ø> (ø)
incentive_lifecycle ∅ <ø> (∅)
incentive_keeper 0.00% <ø> (ø)
incentive_queries ∅ <ø> (∅)
masterchef_transactions 63.63% <ø> (ø)
masterchef_lifecycle 73.75% <ø> (ø)
masterchef_keeper 89.47% <ø> (ø)
masterchef_queries 45.97% <ø> (ø)
oracle_transactions 30.00% <ø> (ø)
oracle_lifecycle 0.00% <ø> (ø)
oracle_keeper 63.88% <ø> (ø)
oracle_queries 34.95% <ø> (ø)
parameter_transactions 15.11% <ø> (ø)
parameter_lifecycle ∅ <ø> (∅)
parameter_keeper 75.00% <ø> (ø)
parameter_queries 60.00% <ø> (ø)
stablestake_transactions 73.91% <ø> (ø)
stablestake_lifecycle 75.00% <ø> (ø)
stablestake_keeper 71.42% <ø> (ø)
stablestake_queries 13.04% <ø> (ø)
tier_transactions 28.57% <ø> (ø)
tier_lifecycle 100.00% <ø> (ø)
tier_keeper 90.47% <ø> (ø)
tier_queries 22.50% <ø> (ø)
tokenomics_transactions 72.32% <ø> (ø)
tokenomics_lifecycle ∅ <ø> (∅)
tokenomics_keeper 83.33% <ø> (ø)
tokenomics_queries 70.96% <ø> (ø)
transferhook_transactions ∅ <ø> (∅)
transferhook_lifecycle ∅ <ø> (∅)
transferhook_keeper 100.00% <ø> (ø)
transferhook_queries 60.00% <ø> (ø)

@cryptokage1996 cryptokage1996 marked this pull request as ready for review September 2, 2024 13:42
@cosmic-vagabond
Copy link
Contributor

@cryptokage1996 can you share some test results in comment here thanks

@cryptokage1996
Copy link
Contributor Author

cryptokage1996 commented Sep 3, 2024

@cryptokage1996 can you share some test results in comment here thanks

elysd q leveragelp get-positions --limit 10 --reverse
pagination:
  next_key: FP//IHSVyrNtMx3LU/piXxdnFF2UAAAAAAAAPZM=
  total: "0"
positions:
- position:
    address: elys1llll3p0zvykqhxtqhlfw4qu6p9llrxrgskhx0z
    amm_pool_id: "4"
    collateral:
      amount: "194200"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "234539"
    leverage: "1.100000000000000000"
    leveraged_lp_amount: "324406279695491059"
    liabilities: "0"
    position_health: "10.990820512820512821"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "214068"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llll3p0zvykqhxtqhlfw4qu6p9llrxrgskhx0z
    amm_pool_id: "2"
    collateral:
      amount: "214900"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "215911"
    leverage: "1.100000000000000000"
    leveraged_lp_amount: "320336627582651552"
    liabilities: "0"
    position_health: "10.760012964763624577"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "232899"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llll3p0zvykqhxtqhlfw4qu6p9llrxrgskhx0z
    amm_pool_id: "5"
    collateral:
      amount: "91000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "129800"
    leverage: "1.100000000000000000"
    leveraged_lp_amount: "78157517208674003"
    liabilities: "0"
    position_health: "9.596347331583552056"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "87249"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1lllj0q7a0d4hqg0dt7umjtcnfg9lk9x2xswh2m
    amm_pool_id: "2"
    collateral:
      amount: "52000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "99670"
    leverage: "1.700000000000000000"
    leveraged_lp_amount: "115987101305482367"
    liabilities: "0"
    position_health: "2.305073631867981749"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "84328"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1lllj0q7a0d4hqg0dt7umjtcnfg9lk9x2xswh2m
    amm_pool_id: "4"
    collateral:
      amount: "117000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "83220"
    leverage: "1.100000000000000000"
    leveraged_lp_amount: "195983847012251436"
    liabilities: "0"
    position_health: "11.035207075431584318"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "129325"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1lllj0q7a0d4hqg0dt7umjtcnfg9lk9x2xswh2m
    amm_pool_id: "5"
    collateral:
      amount: "2055000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "64217"
    leverage: "1.400000000000000000"
    leveraged_lp_amount: "2352907888468956596"
    liabilities: "0"
    position_health: "3.212467868491487409"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "2626616"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llljqay4e2ek6vcaedfl5cjlzan3ghv597l59z
    amm_pool_id: "6"
    collateral:
      amount: "600000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "60527"
    leverage: "1.700000000000000000"
    leveraged_lp_amount: "1035910779989163168"
    liabilities: "0"
    position_health: "2.400275960509099560"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "964680"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llljqay4e2ek6vcaedfl5cjlzan3ghv597l59z
    amm_pool_id: "5"
    collateral:
      amount: "2000000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "55803"
    leverage: "1.500000000000000000"
    leveraged_lp_amount: "2393026781554085971"
    liabilities: "0"
    position_health: "2.665938528139388980"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "2671402"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llljqay4e2ek6vcaedfl5cjlzan3ghv597l59z
    amm_pool_id: "2"
    collateral:
      amount: "500000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "47412"
    leverage: "2.300000000000000000"
    leveraged_lp_amount: "1395963869360031133"
    liabilities: "0"
    position_health: "1.767783076923076923"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "1014927"
  updated_leverage: "1.000000000000000000"
- position:
    address: elys1llljqay4e2ek6vcaedfl5cjlzan3ghv597l59z
    amm_pool_id: "4"
    collateral:
      amount: "6220000"
      denom: ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65
    id: "42059"
    leverage: "1.700000000000000000"
    leveraged_lp_amount: "15742474232626436335"
    liabilities: "0"
    position_health: "2.370525779492168703"
    stop_loss_price: "0.000000000000000000"
  position_usd_value: "10388074"
  updated_leverage: "1.000000000000000000"

@cosmic-vagabond cosmic-vagabond merged commit 07ad6ea into main Sep 3, 2024
14 checks passed
@cosmic-vagabond cosmic-vagabond deleted the feat/position-usd-amount branch September 3, 2024 17:03
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.

3 participants