Skip to content

Commit

Permalink
update(add short positions)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermake committed Sep 10, 2024
1 parent 0199df8 commit 6005f80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common/components/modals/short/ShortFormComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</p>
<p class="align-center mb-2 mt-[14px] flex justify-end text-neutral-typography-200">
<span>{{ calculateLique }}</span>
<span class="text-[#8396B1]"> &nbsp;|&nbsp; {{ percentLique }} </span>
<span class="text-[#8396B1]"> &nbsp;|&nbsp; -{{ percentLique }} </span>
<Tooltip :content="$t('message.liquidation-price-tooltip')" />
</p>
</div>
Expand Down Expand Up @@ -369,7 +369,10 @@ function getLquidation() {

const percentLique = computed(() => {
const asset = props.modelValue.selectedCurrency;
const price = new Dec(oracle.prices[asset!.ibcData as string]?.amount ?? "0", asset.decimal_digits);
const [_, protocol] = props.modelValue.selectedDownPaymentCurrency.key.split("@");
const lpn = AssetUtils.getLpnByProtocol(protocol);

const price = new Dec(oracle.prices[lpn.key]?.amount ?? "0", asset.decimal_digits);
const lprice = getLquidation();

if (lprice.isZero() || price.isZero()) {
Expand Down

0 comments on commit 6005f80

Please sign in to comment.