Giter Club home page Giter Club logo

moneyonrails's Issues

FtxClient.open_orders 不一定會回傳所有的訂單

app\jobs\grid_close_job.rb
line17
open_orders = FtxClient.open_orders(@sub_account, market: @grid_setting["market_name"])["result"].select {|order| order["createdAt"] > @grid_setting.created_at}

可能是filter order["createdAt"] 的問題

grid index view 可以簡化成一個template

      <div class="card">
        <div class="stat-widget-two card-body">
          <div class="stat-content">
            <div class="stat-text"><%= "#{coin_name}" %>可用餘額</div>
            <div class="stat-digit">
              <% spot_precision = decimals(@grid_setting.size_step) %>
              <% spot_data = balances[coin_name] %>
              
              <% spot_available_usdValue = spot_data["spot_amount"] == 0 ? 0 : (spot_data["usdValue"] / spot_data["spot_amount"]) * spot_data["available_amount"] %>
              <%= spot_data["available_amount"].round(spot_precision) %> / <i class="far fa-dollar-sign"></i><%= spot_available_usdValue.round(2) %>
            </div>
          </div>
          <div class="progress">
            <% percent = (spot_available_usdValue / balances["totalusdValue"]) * 100.round(0) %>
            <div class="progress-bar bg-success" style="width: <%= percent %>%" role="progressbar" aria-valuenow="<%= percent %>" aria-valuemin="0" aria-valuemax="100">
              in USD
            </div>
          </div>
        </div>
      </div>

會員架構

在功能皆正常運作的前提下加入使用者驗證

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.