交易机器人 - automatic_investment_plan 定投机器人

Table Define

  1. aip_coinpairs 支持定投的交易对

id, coin_from, coin_to, min_invest_value, max_invest_value, created, created_at, updated, updated_at

  1. aip_coinpair_prices 支持定投交易对的历史价格存储(日线), 用于前端显示

id, coin_from, coin_to, open_price, high_price, low_price, close_price, volume, interval, invest_price(以 (open+close) / 2 和 用户实际投资金额孰大存储), ctime, created, created_at, updated, updated_at

  1. aip_interval 定投周期配置表

id, aip_type, name, description, created, created_at, updated, updated_at

1: Daily 每日, 2: Weekly 每周(当前是周几就是每周几), 3: 1st and 15th of the month(每月 2 次, 如果当前是 114 号, 当前投一笔替代月初 1st 笔, 当前是 15月底, 当前投一笔替代 15th 笔), Monthly 每月(当前是几号就是每月几号, 如果是不存在的日期, 就用月末最后一天)

  1. aip_strategy 用户定投策略 ps: 需要存储用户操作记录

id, uid, coin_from, coin_to, aip_type, status(0 暂停, 1 开启), aip_type_value(周几,几号?), invest_value, created, created_at, updated, updated_at

  1. aip_trade_pending 定投准备执行记录(此处锁定资产, 资产锁定失败则不定投 => 为什么冻结资产? 因为所有定投者一同投出, 然后按份额领回, 保证所有定投价格相同)

id, strategy_id, uid, coin_from, coin_to, aip_type, status(0 初始化, 1 锁定资产成功, 2 锁定资产失败), invest_value(交易额), created, created_at

  1. aip_trade_done 定投结果记录

id, strategy_id, uid, coin_from, coin_to, aip_type, status(3 交易成功, 4 交易失败), invest_value(交易额), trade_amount(交易数量), price(成交价), fee(手续费), fee_coin(手续费币种), created, created_at, updated, updated_at

Donate - Support to make this site better.
捐助 - 支持我让我做得更好.