import { Sequelize } from 'sequelize';
import { dbConnectMySQL } from '../utilities';

// Создание sql-таблицы balances
export const Fundingrate_SQL = dbConnectMySQL.define('fundingrate', {
	id: {
		type: Sequelize.INTEGER,
		autoIncrement: true,
		primaryKey: true,
		allowNull: false,
	},
	baseAsset: { type: Sequelize.STRING, allowNull: false }, // coin
	quoteAsset: { type: Sequelize.STRING, allowNull: false }, // stable Coin - USDT || USDC
	price: { type: Sequelize.STRING, allowNull: false },
	previousFR: { type: Sequelize.STRING, allowNull: false },
	currentFR: { type: Sequelize.STRING, allowNull: false },
	nextFR: { type: Sequelize.STRING, allowNull: false }, // next_funding_rate
	latestFT: { type: Sequelize.DATE, allowNull: false }, // latest_funding_time
	nextFT: { type: Sequelize.DATE, allowNull: false }, // next_funding_time
	exchangeId: { type: Sequelize.STRING, allowNull: false }, // "BinanceID", "HuobiID", "OkxID"
	exchange: { type: Sequelize.STRING, allowNull: false },
});
