Skip to content

Commit

Permalink
Feat/take profit trigger Long (#661)
Browse files Browse the repository at this point in the history
* refactor integration tests

* trigger Limit Decrease tested

* uncomment tests

* fix coding style
  • Loading branch information
sparqet authored Jun 17, 2024
1 parent 35a1adf commit 0be6ab7
Show file tree
Hide file tree
Showing 2 changed files with 524 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/position/decrease_position_utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fn decrease_position(mut params: UpdatePositionParams) -> DecreasePositionResult
market_utils::get_cached_token_price(
params.order.initial_collateral_token, params.market, cache.prices
);
params.position.size_in_usd = params.position.size_in_tokens * cache.collateral_token_price.min;
params.position.size_in_usd = params.position.size_in_tokens
* cache.collateral_token_price.min; //TODO remove

// cap the order size to the position size
if (params.order.size_delta_usd > params.position.size_in_usd) {
Expand Down
Loading

0 comments on commit 0be6ab7

Please sign in to comment.