-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 28, 2025 at 06:04 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `mtm_dashboard`
--

-- --------------------------------------------------------

--
-- Table structure for table `xts_order_book`
--

CREATE TABLE `xts_order_book` (
  `AppOrderID` bigint(20) NOT NULL,
  `LoginID` varchar(20) DEFAULT NULL,
  `ClientID` varchar(20) DEFAULT NULL,
  `ExchangeOrderID` bigint(20) DEFAULT NULL,
  `TradingSymbol` varchar(50) DEFAULT NULL,
  `ExchangeInstrumentID` int(11) DEFAULT NULL,
  `ExchangeSegment` varchar(20) DEFAULT NULL,
  `OrderSide` varchar(10) DEFAULT NULL,
  `OrderType` varchar(10) DEFAULT NULL,
  `ProductType` varchar(10) DEFAULT NULL,
  `TimeInForce` varchar(10) DEFAULT NULL,
  `OrderPrice` float DEFAULT NULL,
  `OrderQuantity` int(11) DEFAULT NULL,
  `OrderStopPrice` float DEFAULT NULL,
  `OrderStatus` varchar(20) DEFAULT NULL,
  `OrderAverageTradedPrice` float DEFAULT NULL,
  `CumulativeQuantity` int(11) DEFAULT NULL,
  `LeavesQuantity` int(11) DEFAULT NULL,
  `OrderGeneratedDateTime` datetime DEFAULT NULL,
  `ExchangeTransactTime` datetime DEFAULT NULL,
  `OrderUniqueIdentifier` bigint(20) DEFAULT NULL,
  `LastUpdateDateTime` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- RELATIONSHIPS FOR TABLE `xts_order_book`:
--

-- --------------------------------------------------------

--
-- Table structure for table `xts_positions`
--

CREATE TABLE `xts_positions` (
  `id` int(11) NOT NULL,
  `LoginID` varchar(20) DEFAULT NULL,
  `AccountID` varchar(20) DEFAULT NULL,
  `TradingSymbol` varchar(100) DEFAULT NULL,
  `ExchangeSegment` varchar(20) DEFAULT NULL,
  `ExchangeInstrumentId` int(11) DEFAULT NULL,
  `ProductType` varchar(10) DEFAULT NULL,
  `Marketlot` int(11) DEFAULT NULL,
  `BuyAveragePrice` float DEFAULT NULL,
  `SellAveragePrice` float DEFAULT NULL,
  `OpenBuyQuantity` int(11) DEFAULT NULL,
  `OpenSellQuantity` int(11) DEFAULT NULL,
  `Quantity` int(11) DEFAULT NULL,
  `BuyAmount` float DEFAULT NULL,
  `SellAmount` float DEFAULT NULL,
  `NetAmount` float DEFAULT NULL,
  `RealizedMTM` float DEFAULT NULL,
  `UnrealizedMTM` float DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- RELATIONSHIPS FOR TABLE `xts_positions`:
--

-- --------------------------------------------------------

--
-- Table structure for table `xts_settings`
--

CREATE TABLE `xts_settings` (
  `id` int(11) NOT NULL,
  `userID` varchar(50) DEFAULT NULL,
  `appKey` varchar(100) DEFAULT NULL,
  `secretKey` varchar(100) DEFAULT NULL,
  `token` text DEFAULT NULL,
  `token_expiry` datetime DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- RELATIONSHIPS FOR TABLE `xts_settings`:
--

--
-- Indexes for dumped tables
--

--
-- Indexes for table `xts_order_book`
--
ALTER TABLE `xts_order_book`
  ADD PRIMARY KEY (`AppOrderID`);

--
-- Indexes for table `xts_positions`
--
ALTER TABLE `xts_positions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `xts_settings`
--
ALTER TABLE `xts_settings`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `xts_positions`
--
ALTER TABLE `xts_positions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `xts_settings`
--
ALTER TABLE `xts_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;


--
-- Metadata
--
USE `phpmyadmin`;

--
-- Metadata for table xts_order_book
--

--
-- Dumping data for table `pma__table_uiprefs`
--

INSERT INTO `pma__table_uiprefs` (`username`, `db_name`, `table_name`, `prefs`, `last_update`) VALUES
('root', 'mtm_dashboard', 'xts_order_book', '{\"sorted_col\":\"`xts_order_book`.`OrderStatus` ASC\"}', '2025-07-23 11:19:43');

--
-- Metadata for table xts_positions
--

--
-- Metadata for table xts_settings
--

--
-- Metadata for database mtm_dashboard
--
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
