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

Update Event Models for GMX v2 Project #7583

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ models:
- LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- Liquidation: Allows liquidation of positions if the criteria for liquidation are met.
- StopIncrease: Increase position if the stop price is reached, providing an additional execution condition.
data_tests:
- not_null
- accepted_values:
Expand Down Expand Up @@ -519,8 +520,8 @@ models:
- *size_delta_usd
- *size_delta_in_tokens
- *collateral_delta_amount
- &impact_diff_usd
name: impact_diff_usd
- &price_impact_diff_usd
name: price_impact_diff_usd
description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit
data_tests:
- not_null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ WITH evt_data_1 AS (
size_delta_usd / POWER(10, 30) AS size_delta_usd,
size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens,
collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount,
values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS impact_diff_usd,
values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS price_impact_diff_usd,
CASE
WHEN order_type = 0 THEN 'MarketSwap'
WHEN order_type = 1 THEN 'LimitSwap'
Expand All @@ -277,6 +277,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ models:
- LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- Liquidation: Allows liquidation of positions if the criteria for liquidation are met.
- StopIncrease: Increase position if the stop price is reached, providing an additional execution condition.
data_tests:
- not_null
- accepted_values:
Expand Down Expand Up @@ -519,8 +520,8 @@ models:
- *size_delta_usd
- *size_delta_in_tokens
- *collateral_delta_amount
- &impact_diff_usd
name: impact_diff_usd
- &price_impact_diff_usd
name: price_impact_diff_usd
description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit
data_tests:
- not_null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ WITH evt_data_1 AS (
size_delta_usd / POWER(10, 30) AS size_delta_usd,
size_delta_in_tokens / POWER(10, index_token_decimals) AS size_delta_in_tokens,
collateral_delta_amount / POWER(10, collateral_token_decimals) AS collateral_delta_amount,
values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS impact_diff_usd,
values_price_impact_diff_usd / POWER(10, 30 - index_token_decimals) AS price_impact_diff_usd,
CASE
WHEN order_type = 0 THEN 'MarketSwap'
WHEN order_type = 1 THEN 'LimitSwap'
Expand All @@ -277,6 +277,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ WITH evt_data_1 AS (
WHEN order_type = 5 THEN 'LimitDecrease'
WHEN order_type = 6 THEN 'StopLossDecrease'
WHEN order_type = 7 THEN 'Liquidation'
WHEN order_type = 8 THEN 'StopIncrease'
ELSE NULL
END AS order_type,
CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ models:
- LimitDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- StopLossDecrease: Decrease position if the triggerPrice is reached and the acceptablePrice can be fulfilled.
- Liquidation: Allows liquidation of positions if the criteria for liquidation are met.
- StopIncrease: Increase position if the stop price is reached, providing an additional execution condition.
data_tests:
- not_null
- accepted_values:
Expand Down Expand Up @@ -504,8 +505,8 @@ models:
- *size_delta_usd
- *size_delta_in_tokens
- *collateral_delta_amount
- &impact_diff_usd
name: impact_diff_usd
- &price_impact_diff_usd
name: price_impact_diff_usd
description: The difference in price impact in USD compared to a baseline or previous value, considering the maximum price impact limit
data_tests:
- not_null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SELECT
size_delta_usd,
size_delta_in_tokens,
collateral_delta_amount,
impact_diff_usd,
price_impact_diff_usd,
order_type,
decreased_at_time,
price_impact_usd,
Expand Down
Loading