dexbot 1.6.16 → 1.6.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/analysis/tradingview/README.md +2 -2
  3. package/analysis/trend_detection/DYNAMIC_WEIGHT_RESEARCH.md +1 -1
  4. package/claw/package.json +1 -1
  5. package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +1 -1
  6. package/claw/runtimes/openclaw-plugin/package.json +1 -1
  7. package/dist/analysis/ama_fitting/analyze_lambda_vs_slow.js +5 -3
  8. package/dist/analysis/tradingview/grid_reset_sim.js +1 -1
  9. package/dist/analysis/tradingview/tradingview_uplot_chart_generator.js +4 -4
  10. package/dist/analysis/trend_detection/backtest_ama_slope_huber.js +1 -1
  11. package/dist/modules/account_bots.d.ts +3 -0
  12. package/dist/modules/chain_keys.d.ts +1 -1
  13. package/dist/modules/constants.d.ts +6 -0
  14. package/dist/modules/constants.js +34 -6
  15. package/dist/modules/credit_pricing.d.ts +20 -1
  16. package/dist/modules/credit_pricing.js +23 -1
  17. package/dist/modules/credit_runtime.js +33 -16
  18. package/dist/modules/dexbot_class.d.ts +3 -1
  19. package/dist/modules/dexbot_class.js +5 -2
  20. package/dist/modules/dexbot_cow_runtime.d.ts +28 -37
  21. package/dist/modules/dexbot_cow_runtime.js +47 -66
  22. package/dist/modules/dexbot_maintenance_runtime.js +68 -10
  23. package/dist/modules/launcher/credential_daemon.d.ts +14 -2
  24. package/dist/modules/launcher/credential_daemon.js +60 -26
  25. package/dist/modules/order/grid.d.ts +7 -0
  26. package/dist/modules/order/grid.js +157 -15
  27. package/dist/modules/order/index.d.ts +15 -0
  28. package/dist/modules/order/manager.d.ts +30 -7
  29. package/dist/modules/order/manager.js +108 -12
  30. package/dist/modules/order/strategy.d.ts +5 -0
  31. package/dist/modules/order/strategy.js +23 -2
  32. package/dist/modules/order/utils/math.d.ts +41 -1
  33. package/dist/modules/order/utils/math.js +47 -1
  34. package/dist/modules/order/utils/order.d.ts +13 -0
  35. package/dist/modules/order/utils/order.js +61 -7
  36. package/dist/modules/order/utils/system.d.ts +66 -0
  37. package/dist/modules/order/utils/system.js +135 -0
  38. package/dist/modules/order/utils/validate.d.ts +3 -1
  39. package/dist/modules/order/utils/validate.js +5 -1
  40. package/dist/modules/types.d.ts +35 -2
  41. package/dist/scripts/analyze-credit.js +64 -23
  42. package/dist/scripts/bts_distribution.d.ts +66 -0
  43. package/dist/scripts/bts_distribution.js +2102 -0
  44. package/dist/scripts/token_distribution.d.ts +45 -0
  45. package/dist/scripts/token_distribution.js +1870 -0
  46. package/dist/unlock.js +42 -24
  47. package/docs/COW_INVARIANTS.md +6 -0
  48. package/docs/DEXBOT_COMPARISON.md +5 -5
  49. package/docs/EVOLUTION.md +9 -8
  50. package/docs/FUND_MOVEMENT_AND_ACCOUNTING.md +3 -1
  51. package/docs/GRID_PRICE_INVARIANT.md +6 -0
  52. package/docs/GRID_RECALCULATION.md +3 -3
  53. package/docs/LOGGING.md +9 -0
  54. package/docs/MPA_CREDIT_USAGE.md +3 -2
  55. package/docs/ORDER_ENGINE_POST_1.0_RETROSPECTIVE.md +117 -0
  56. package/docs/README.md +1 -1
  57. package/docs/architecture.md +98 -1
  58. package/market_adapter/README.md +2 -2
  59. package/package.json +3 -1
  60. package/scripts/README.md +85 -148
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * BitShares token distribution analyzer.
4
+ *
5
+ * The per-asset companion to scripts/bts_distribution.ts: answers "where is all
6
+ * of <token>?" on the live chain. Works for any issued asset (UIA/MPA) except
7
+ * the core asset (use bts_distribution for BTS).
8
+ *
9
+ * Buckets:
10
+ * - free account balances 2.5.x account_balance_object (asset_api rich list)
11
+ * - limit orders 1.7.x limit_order_object.for_sale (token sold)
12
+ * - liquidity pools 1.19.x liquidity_pool_object reserves
13
+ * - vesting balances 1.13.x vesting_balance_object (worker/witness/cashback/...)
14
+ * - P2P credit offers 1.21.x credit_offer_object.current_balance
15
+ * - P2P deal collateral 1.22.x credit_deal_object.collateral_amount
16
+ * - SameT funds 1.20.x samet_fund_object.balance
17
+ * - HTLC escrow 1.16.x htlc_object.transfer
18
+ * - accumulated market fees 2.3.x asset_dynamic_data_object.accumulated_fees
19
+ * - blinded balances 2.3.x asset_dynamic_data_object.confidential_supply
20
+ *
21
+ * The liquidity side is grouped by *counterpart asset*: every pool and every
22
+ * token sell order is bucketed by the asset on the other side of the trade
23
+ * (token/BTS, token/USD, token/other), so you can see which markets actually
24
+ * hold the token. The HTML report adds a separate liquidity donut and a 3%
25
+ * depth comparison: how much token can be sold (price -3%) or bought (price
26
+ * +3%), combining orderbook and constant-product pool per market, with the
27
+ * result also expressed as a percentage of total supply.
28
+ *
29
+ * Limit orders are not globally indexed by asset in bitshares-core, so the only
30
+ * exact enumeration is one get_limit_orders(token, other) call per listed asset
31
+ * (~6k calls on mainnet). Those calls run concurrently and are skipped with
32
+ * --no-orders.
33
+ *
34
+ * Read-only: opens its own ephemeral WebSocket, never touches a running bot,
35
+ * no keys, no transactions. Chain source of truth: bitshares-core 7.0.x.
36
+ *
37
+ * Usage:
38
+ * node dist/scripts/token_distribution.js <symbol|1.3.x>
39
+ * node dist/scripts/token_distribution.js <token> --json
40
+ * node dist/scripts/token_distribution.js <asset-id> --no-html
41
+ * node dist/scripts/token_distribution.js <token> --no-orders
42
+ * node dist/scripts/token_distribution.js <token> --node wss://cloud.xbts.io/ws
43
+ */
44
+ export {};
45
+ //# sourceMappingURL=token_distribution.d.ts.map