Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed Apr 18, 2024
1 parent 8c04763 commit cc8c4f0
Show file tree
Hide file tree
Showing 29 changed files with 701 additions and 585 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VEGA_SIM_VEGA_TAG=1d53ad7f2b6b6bb8215b8994c9f5f91418599a8b
VEGA_SIM_VEGA_TAG=10995-liquidation-range
VEGA_SIM_CONSOLE_TAG=develop
VEGA_DEFAULT_KEY_NAME='Key 1'
VEGA_SIM_NETWORKS_INTERNAL_TAG=main
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Jinja2 = "*"
nbmake = "*"
matplotlib = "*"
pytest-xdist = "*"
vegapy = {git = "https://github.com/cdummett/vegapy/", branch="develop"}
vegapy = {git = "https://github.com/cdummett/vegapy/", branch="feat/liquidation-slippage-range"}


[build-system]
Expand Down
1 change: 1 addition & 0 deletions vega_sim/api/governance.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def __propose_market(
disposal_fraction="1",
full_disposal_size=1000000000,
max_fraction_consumed="0.5",
disposal_slippage_range="0.5",
),
mark_price_configuration=vega_protos.markets.CompositePriceConfiguration(
composite_price_type=vega_protos.markets.COMPOSITE_PRICE_TYPE_LAST_TRADE,
Expand Down
3 changes: 3 additions & 0 deletions vega_sim/api/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ class LiquidationStrategy(Config):
"disposal_fraction": 0.1,
"full_disposal_size": 0,
"max_fraction_consumed": 0.1,
"disposal_slippage_range": 0.5,
}
}

Expand All @@ -643,13 +644,15 @@ def load(self, opt: Optional[str] = None):
self.disposal_fraction = config["disposal_fraction"]
self.full_disposal_size = config["full_disposal_size"]
self.max_fraction_consumed = config["max_fraction_consumed"]
self.disposal_slippage_range = config["disposal_slippage_range"]

def build(self):
return build.markets.liquidation_strategy(
disposal_time_step=self.disposal_time_step,
disposal_fraction=self.disposal_fraction,
full_disposal_size=self.full_disposal_size,
max_fraction_consumed=self.max_fraction_consumed,
disposal_slippage_range=self.disposal_slippage_range,
)


Expand Down
2 changes: 2 additions & 0 deletions vega_sim/builders/markets.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ def liquidation_strategy(
disposal_fraction: float,
full_disposal_size: float,
max_fraction_consumed: float,
disposal_slippage_range: float,
) -> vega_protos.markets.LiquidationStrategy:
return vega_protos.markets.LiquidationStrategy(
disposal_time_step=int(disposal_time_step),
disposal_fraction=str(disposal_fraction),
full_disposal_size=num_to_padded_int(full_disposal_size, 1),
max_fraction_consumed=str(max_fraction_consumed),
disposal_slippage_range=str(disposal_slippage_range),
)


Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/BTCUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/EGLPUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@
"disposalFraction": "0.1",
"fullDisposalSize": "10000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"compositePriceType": "COMPOSITE_PRICE_TYPE_LAST_TRADE",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/ETHUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/INJUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/LDOUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/SNXUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/mainnet/SOLUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/ESHRUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"disposalFraction": "0.1",
"fullDisposalSize": "10000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.2",
},
"liquidityFeeSettings": {"method": "METHOD_MARGINAL_COST"},
"liquidityMonitoringParameters": {
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/HLPUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"disposalFraction": "0.1",
"fullDisposalSize": "10000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.2",
},
"liquidityFeeSettings": {"method": "METHOD_MARGINAL_COST"},
"liquidityMonitoringParameters": {
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/future/BTCUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"compositePriceType": "COMPOSITE_PRICE_TYPE_LAST_TRADE",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/future/ETHUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"compositePriceType": "COMPOSITE_PRICE_TYPE_LAST_TRADE",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/perpetual/BTCUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
1 change: 1 addition & 0 deletions vega_sim/configs/research/perpetual/ETHUSDT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"disposalFraction": "1",
"fullDisposalSize": "1000000",
"maxFractionConsumed": "0.1",
"disposalSlippageRange": "0.03",
},
"markPriceConfiguration": {
"decayWeight": "1",
Expand Down
Loading

0 comments on commit cc8c4f0

Please sign in to comment.