Documentation ¶
Index ¶
Constants ¶
const SqlMarketsInsertTemplate = "INSERT INTO markets (market_id, exchange_name, base, quote) VALUES ('%s', '%s', '%s', '%s')"
insert statements
SqlMarketsInsertTemplate inserts into the markets table
const SqlMarketsTableCreate = "" /* 133-byte string literal not displayed */
tables
const SqlQueryMarketsById = "SELECT market_id, exchange_name, base, quote FROM markets WHERE market_id = $1 LIMIT 1"
queries
SqlQueryMarketsById queries the markets table
const SqlStrategyMirrorTradeTriggersInsertTemplate = "" /* 129-byte string literal not displayed */
SqlStrategyMirrorTradeTriggersInsertTemplate inserts into the strategy_mirror_trade_triggers table
const SqlStrategyMirrorTradeTriggersTableCreate = "" /* 199-byte string literal not displayed */
const SqlTradesIndexCreate = "CREATE INDEX IF NOT EXISTS date ON trades (market_id, date_utc)"
indexes
const SqlTradesIndexCreate2 = "CREATE INDEX IF NOT EXISTS trades_mdd ON trades (market_id, DATE(date_utc), date_utc)"
const SqlTradesIndexCreate3 = "CREATE UNIQUE INDEX IF NOT EXISTS trades_amt ON trades (account_id, market_id, txid)"
We don't include account_id in the primary key of the trades table because the account_id will initially be null until we clean that up (later) For now we add it as a unique index on which we will later base the primary key. This does not provide us with any immediate benefit because the PK is a subset of this unique index and we don't use this index for queries yet (we will later)
const SqlTradesIndexDrop = "DROP INDEX IF EXISTS date"
const SqlTradesInsertTemplate = "" /* 207-byte string literal not displayed */
SqlTradesInsertTemplate inserts into the trades table
const SqlTradesTableAlter1 = "ALTER TABLE trades ADD COLUMN account_id TEXT"
const SqlTradesTableAlter2 = "ALTER TABLE trades ADD COLUMN order_id TEXT"
const SqlTradesTableCreate = "" /* 350-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.