0bps

Strategy vault / Other

Binance Small Asset Conversion

JavaScript strategy by xunfeng91.

JavaScriptOther
Author
xunfeng91
Complexity
Starter · 37 lines
Parameters
0

The original spec has no written description. Read the source below.

Source JavaScript

//Convert small assets toBNB
function autoswaptobnb() {
    var ret = exchange.IO("api", "POST", "/sapi/v1/asset/dust-btc")
    Sleep(100)
    var dustarr = []

    for (var i = 0; i < ret.details.length; i++) {
        dustarr.push(ret.details[i].asset)
    }
    if (dustarr.length > 0) {
      Log("Will perform a small asset conversion", dustarr)
      var obj
      if (dustarr.length == 1) {
        obj = "asset=" + dustarr[0] + "&timestamp=" + new Date().getTime()
      }
      if (dustarr.length > 1) {
        obj = dustarr[0]
        for (var i = 1; i < dustarr.length; i++) {
          obj = obj + "," + dustarr[i]
        }
        //obj = obj + "&timestamp=" + new Date().getTime()
      }
      //var params = {
      //      "asset":obj,
      //     "timestamp":new Date().getTime()
      //      }
      var params = "asset=" + obj + "&timestamp=" + new Date().getTime()
      Log(params)
      var ret = exchange.IO("api", "POST", "/sapi/v1/asset/dust", "",params)
      Log("Small asset conversion completed")
      Log(ret)
    }
  }
  
  function main() {
      autoswaptobnb()
  }

Published by xunfeng91 on the FMZ strategy square · last modified 2023-07-31. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.

Build this with AgenKit

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Binance-Small-Asset-Conversion.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Understand it first

Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.

Related specs

esc

Try , , or .

↑↓ move↵ open