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

feat(perp): settle markets #1573

Merged
merged 27 commits into from
Oct 10, 2023
Merged

feat(perp): settle markets #1573

merged 27 commits into from
Oct 10, 2023

Conversation

Unique-Divine
Copy link
Member

@Unique-Divine Unique-Divine commented Sep 13, 2023

Context

Adds initial settlement price calculation (in draft) for continuation by @jgimeno. Please see this GH issue for more info.

Purpose

Changes

  • feat(perp): impl AMM.SettlementPrice func #wip
  • refactor(perp): rename amm.MarkPrice -> amm.InstMarkPrice to reflect that it's instantaneous
  • test: add table tests for the settlement price calculations
  • docs: document the feature in the GH issue and in markdown

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #1573 (f271a00) into master (ef307eb) will decrease coverage by 0.47%.
The diff coverage is 72.58%.

❗ Current head f271a00 differs from pull request most recent head 812fc4b. Consider uploading reports for the commit 812fc4b to get more accurate results

@@            Coverage Diff             @@
##           master    #1573      +/-   ##
==========================================
- Coverage   74.49%   74.02%   -0.47%     
==========================================
  Files         175      177       +2     
  Lines       14567    14335     -232     
==========================================
- Hits        10852    10612     -240     
- Misses       3097     3120      +23     
+ Partials      618      603      -15     
Files Coverage Δ
x/perp/v2/keeper/amm.go 92.10% <100.00%> (+0.92%) ⬆️
x/perp/v2/keeper/calc.go 94.54% <100.00%> (ø)
x/perp/v2/keeper/grpc_query.go 70.07% <100.00%> (ø)
x/perp/v2/keeper/keeper.go 96.55% <100.00%> (+4.12%) ⬆️
x/perp/v2/keeper/liquidate.go 79.05% <100.00%> (ø)
x/perp/v2/keeper/margin.go 74.80% <100.00%> (ø)
x/perp/v2/keeper/swap.go 100.00% <ø> (ø)
x/perp/v2/keeper/twap.go 86.95% <100.00%> (+0.14%) ⬆️
x/perp/v2/module/genesis.go 98.09% <100.00%> (+0.05%) ⬆️
x/perp/v2/types/genesis.go 85.36% <100.00%> (+5.36%) ⬆️
... and 7 more

... and 23 files with indirect coverage changes

@jgimeno jgimeno marked this pull request as ready for review September 18, 2023 12:57
@jgimeno jgimeno requested a review from a team as a code owner September 18, 2023 12:57
@NibiruChain NibiruChain deleted a comment from sonarcloud bot Oct 5, 2023
@matthiasmatt matthiasmatt changed the title feat(perp): uniform settlement price calculation feat(perp): settle markets Oct 9, 2023
@matthiasmatt matthiasmatt merged commit a7c9447 into master Oct 10, 2023
14 of 15 checks passed
@matthiasmatt matthiasmatt deleted the realu/uniform-settlement branch October 10, 2023 09:17
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