Skip to content

Commit

Permalink
fix: ux visualisation examples
Browse files Browse the repository at this point in the history
* fix: correct lagging datanode

* feat: add visualisation tests

* refactor: update readme

* fix: run make black
  • Loading branch information
cdummett authored Nov 10, 2022
1 parent 9bad98b commit 672b784
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/visualisations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

This folder contains scripts used to generate market conditions required for certain visualisations (docs, blogs etc.) so that they can be easily extended and/or updated to use a new version of the UI.

- [Margin calculations](./margins.py)
- [Margin calculations](./margins.py)
- [Party closed out with out loss socialisation](./closed_out.py)
- [Party closed out with loss socialisation](./loss_socialisation.py)
2 changes: 2 additions & 0 deletions examples/visualisations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,14 @@ def propose_market(
parameter="market.fee.factors.infrastructureFee",
new_value="0.0",
)
vega.wait_for_total_catchup()
vega.update_network_parameter(
proposal_wallet=AUX_PARTY_A.wallet_name,
key_name=AUX_PARTY_A.key_name,
parameter="market.fee.factors.makerFee",
new_value="0.0",
)
vega.wait_for_total_catchup()
vega.create_simple_market(
market_name="XYZ:DAI Visualisation Example",
proposal_wallet=AUX_PARTY_A.wallet_name,
Expand Down
17 changes: 17 additions & 0 deletions tests/integration/test_visualisations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pytest
import runpy


@pytest.mark.integration
def test_closed_out():
runpy.run_path("examples/visualisations/closed_out.py")


@pytest.mark.integration
def test_loss_socialisation():
runpy.run_path("examples/visualisations/loss_socialisation.py")


@pytest.mark.integration
def test_margins():
runpy.run_path("examples/visualisations/margins.py")

0 comments on commit 672b784

Please sign in to comment.