Skip to content

Commit

Permalink
Rename 1 column and update order_type column options (#7583)
Browse files Browse the repository at this point in the history
  • Loading branch information
AIDataMaster authored Jan 28, 2025
1 parent 5250304 commit 232908c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 9 deletions.
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

0 comments on commit 232908c

Please sign in to comment.