package com.goldenchart.repository;

import com.goldenchart.entity.GcLiveTrade;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface GcLiveTradeRepository extends JpaRepository<GcLiveTrade, Long> {
    List<GcLiveTrade> findTop100ByDeviceIdOrderByCreatedAtDesc(String deviceId);
    Optional<GcLiveTrade> findTopByDeviceIdAndSymbolAndSideOrderByCreatedAtDesc(
            String deviceId, String symbol, String side);
    List<GcLiveTrade> findBySymbolAndSideOrderByCreatedAtDesc(String symbol, String side);
}
