mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
change column to net_asset_in_* to avoid confusion
This commit is contained in:
parent
f196cc9ccd
commit
30c9d251fe
|
@ -2,8 +2,8 @@
|
|||
-- +begin
|
||||
ALTER TABLE `nav_history_details`
|
||||
MODIFY COLUMN `net_asset` DECIMAL(32, 8) DEFAULT 0.00000000 NOT NULL,
|
||||
MODIFY COLUMN `balance_in_usd` DECIMAL(32, 2) DEFAULT 0.00000000 NOT NULL,
|
||||
MODIFY COLUMN `balance_in_btc` DECIMAL(32, 20) DEFAULT 0.00000000 NOT NULL;
|
||||
CHANGE COLUMN `balance_in_usd` `net_asset_in_usd` DECIMAL(32, 2) DEFAULT 0.00000000 NOT NULL,
|
||||
CHANGE COLUMN `balance_in_btc` `net_asset_in_btc` DECIMAL(32, 20) DEFAULT 0.00000000 NOT NULL;
|
||||
-- +end
|
||||
|
||||
-- +begin
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
-- +begin
|
||||
CREATE TABLE `nav_history_details`
|
||||
(
|
||||
gid bigint unsigned auto_increment PRIMARY KEY,
|
||||
`exchange` VARCHAR NOT NULL DEFAULT '',
|
||||
`subaccount` VARCHAR NOT NULL DEFAULT '',
|
||||
time DATETIME(3) NOT NULL DEFAULT (strftime('%s', 'now')),
|
||||
currency VARCHAR NOT NULL,
|
||||
balance_in_usd DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
balance_in_btc DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
balance DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
available DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
locked DECIMAL DEFAULT 0.00000000 NOT NULL
|
||||
`gid` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
`exchange` VARCHAR(30) NOT NULL DEFAULT '',
|
||||
`subaccount` VARCHAR(30) NOT NULL DEFAULT '',
|
||||
`time` DATETIME(3) NOT NULL DEFAULT (strftime('%s', 'now')),
|
||||
`currency` VARCHAR(30) NOT NULL,
|
||||
`net_asset_in_usd` DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
`net_asset_in_btc` DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
`balance` DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
`available` DECIMAL DEFAULT 0.00000000 NOT NULL,
|
||||
`locked` DECIMAL DEFAULT 0.00000000 NOT NULL
|
||||
);
|
||||
-- +end
|
||||
-- +begin
|
||||
|
|
|
@ -31,8 +31,8 @@ func (s *AccountService) InsertAsset(time time.Time, session string, name types.
|
|||
subaccount,
|
||||
time,
|
||||
currency,
|
||||
balance_in_usd,
|
||||
balance_in_btc,
|
||||
net_asset_in_usd,
|
||||
net_asset_in_btc,
|
||||
balance,
|
||||
available,
|
||||
locked,
|
||||
|
|
|
@ -11,15 +11,21 @@ import (
|
|||
)
|
||||
|
||||
type Asset struct {
|
||||
Currency string `json:"currency" db:"currency"`
|
||||
Total fixedpoint.Value `json:"total" db:"total"`
|
||||
InUSD fixedpoint.Value `json:"inUSD" db:"in_usd"`
|
||||
InBTC fixedpoint.Value `json:"inBTC" db:"in_btc"`
|
||||
Currency string `json:"currency" db:"currency"`
|
||||
Total fixedpoint.Value `json:"total" db:"total"`
|
||||
|
||||
NetAsset fixedpoint.Value `json:"netAsset" db:"net_asset"`
|
||||
|
||||
// InUSD is net asset in USD
|
||||
InUSD fixedpoint.Value `json:"inUSD" db:"net_asset_in_usd"`
|
||||
|
||||
// InBTC is net asset in BTC
|
||||
InBTC fixedpoint.Value `json:"inBTC" db:"net_asset_in_btc"`
|
||||
|
||||
Time time.Time `json:"time" db:"time"`
|
||||
Locked fixedpoint.Value `json:"lock" db:"lock" `
|
||||
Available fixedpoint.Value `json:"available" db:"available"`
|
||||
Borrowed fixedpoint.Value `json:"borrowed" db:"borrowed"`
|
||||
NetAsset fixedpoint.Value `json:"netAsset" db:"net_asset"`
|
||||
PriceInUSD fixedpoint.Value `json:"priceInUSD" db:"price_in_usd"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user