Skip to content
Closed
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
4 changes: 3 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"preview": "vite preview",
"lint": "eslint",
"format": "prettier --write \"**/*.{ts,tsx}\"",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@creit.tech/stellar-wallets-kit": "^2.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import { useOracleCandles } from "../../hooks/useOracleCandles"
import { useLiveBar } from "../../hooks/useLiveBar"
import { usePositions } from "../../hooks/usePositions"
import { useOrders } from "../../hooks/useOrders"
import { useWalletStore } from "@/features/wallet/store/wallet-store"
import {
buildCandleOptions,
buildChartOptions,
getChartPalette,
positionLineColor,
} from "../../lib/chart-theme"
import type { CandlestickData, IChartApi, IPriceLine, ISeriesApi, UTCTimestamp } from "lightweight-charts"
import type { OhlcBar } from "../../lib/oracle"
import { formatUsd } from "@/shared/lib/format"
import { ENV } from "@/app/config/env"
import type { CandlestickData, IChartApi, IPriceLine, ISeriesApi, UTCTimestamp } from "lightweight-charts"
import type { OhlcBar } from "../../lib/oracle"
import { useWalletStore } from "@/features/wallet/store/wallet-store"

type ChartLine = {
id: string
Expand Down
12 changes: 7 additions & 5 deletions apps/web/src/features/trade/components/orderbook/DepthLadder.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { useState } from "react"

import { cn } from "@workspace/ui/lib/utils"
import { useOrderBook } from "../../hooks/useOrderBook"
import type {OrderBookLevel} from "../../hooks/useOrderBook";
import { formatUsd } from "@/shared/lib/format"

import { useOrderBook } from "../../hooks/useOrderBook"
import { useRecentTrades } from "../../hooks/useRecentTrades"
import { useState } from "react"
import type { OrderBookLevel } from "../../hooks/useOrderBook"

type Props = {
symbol: string | undefined
Expand Down Expand Up @@ -217,9 +219,9 @@ export function DepthLadder({ symbol, compact = false }: Props) {
const { trades } = useRecentTrades(symbol)

// OB-054: Determine reference price — prefer last trade, fall back to mid price
const lastTradePrice = trades[0]?.price ?? null
const lastTradePrice = trades[0]?.price
const referencePrice = lastTradePrice ?? midPrice
const referencePriceLabel = lastTradePrice !== null ? "Last" : midPrice !== null ? "Mid" : "Mark"
const referencePriceLabel = lastTradePrice ? "Last" : midPrice ? "Mid" : "Mark"

// OB-056: Cumulative depth inspection state
const [hoveredLevel, setHoveredLevel] = useState<{ level: OrderBookLevel; side: "bid" | "ask" } | null>(null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState, useRef } from "react"
import { useEffect, useMemo, useRef, useState } from "react"
import {
Dialog,
DialogContent,
Expand Down Expand Up @@ -132,8 +132,8 @@ export function ConfirmationDialog({
sizeUsd,
entryPrice,
leverage,
triggerPrice: triggerPrice ?? "",
collateralAmount: fromAmount ?? "",
triggerPrice,
collateralAmount: fromAmount,
}

if (!inputSnapshotRef.current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe("useSourceFreshness", () => {
const { result, rerender } = renderHook(
({ symbol }: { symbol: string | undefined }) => useSourceFreshness(symbol),
{
initialProps: { symbol: "BTC" as string | undefined },
initialProps: { symbol: "BTC" },
},
)
expect(result.current).not.toBeNull()
Expand Down