feat: 手续费改为逐笔USD累算 + Vite React前端 + system_orders表 + README

This commit is contained in:
jackyu66git
2026-05-04 04:34:27 +08:00
parent 15a4684208
commit 0288dc8284
18 changed files with 2919 additions and 521 deletions
+14
View File
@@ -94,6 +94,20 @@ func (d *DB) migrate() error {
CREATE INDEX IF NOT EXISTS idx_trades_status ON trades(status);
CREATE INDEX IF NOT EXISTS idx_trades_opened ON trades(opened_at);
CREATE INDEX IF NOT EXISTS idx_orders_trade_id ON orders(trade_id);
CREATE TABLE IF NOT EXISTS system_orders (
id INTEGER PRIMARY KEY AUTOINCREMENT,
trade_id INTEGER NOT NULL REFERENCES trades(id),
type TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'filled',
spread REAL,
long_price REAL,
short_price REAL,
long_order_id INTEGER REFERENCES orders(id),
short_order_id INTEGER REFERENCES orders(id),
created_at DATETIME NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_system_orders_trade ON system_orders(trade_id);
`
_, err := d.Exec(schema)
if err != nil {