npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

twinky

v0.1.0

Published

Twinky: Crypto Trading API Modular CLI Suite

Downloads

1

Readme

twinky: Crypto Trading API Modular CLI Suite


twinky is a discretionary CLI suite designed by crypto traders that hate GUIs, for crypto traders that hate GUIs.

this is not designed to be competitive in terms of execution, but instead intended for discretionary use. if you want HFT speed execution, rewrite yourself in a lower level lang, or wait for the rust version 🐱

twinky is designed from a modular approach. Meaning, it enables anyone to build their systems on top, and is intended to be utilized as a tool that can handle otherwise tedious tasks of other automated trading systems such as env handling/exchange-specific api nuances, etc. twinky was created to help unify authentication, execution and data parsing across exchange APIs.

it is recommended to run twinky after install to setup config/env. this is requried for making any actions with twinky, and twinky will make you set up config/env before allowing any actions anyway.

twinky has two different modes...

interactive cli


  actions:
          -trade(t)
          --> execute trades.

          -listen(l)
          --> listen for and log portfolio updates in real time.

          -view(v)
          --> view portfolio, open orders, order history.

          -settings(s)
          --> view/modify config settings.

          -help(h)
          --> log this message.

          -exit
          --> exit the program.

twinky {action} then feed prompts on request.

trade(t)

interactive command to execute a trade...

walks the user through a list of prompts (in order):

  1. symbol
  2. leverage
  3. order type (market/limit) - if (limit):
    • execution style
      • point: executes at a specific price
      • range: spreads order throughout a range of prices
      • if (range):
        • from: starting point of range
        • to: ending point of range
        • iterations: number of times to split up trade within range
        • range sizing distribution:
          • linear: distributes evenly throughout range
          • exponential: increases sizing from "from" to "to" on a scale of y=x^2
  4. direction (long/short)
  5. order amount, denominated in token (i.e. ETH, BTC, DOGE, etc.)
  6. stop loss? (yes/no)
  7. reduce only? (yes/no)
listen(l)

wss connection listen to the market for new positions opened, closed, volume spikes, etc.

  • ...coming soon!
view

inspect data regarding user account

  • balance: user balance, (including available and unavailable collateral)
  • open orders: orders on the market yet to be filled
  • closed orders: view closed orders executed using the given API key
  • open postions: information regarding current open positions on the market
settings(s)

view/modify config settings

  • view/modify:
    • config
    • env
help(h)

display help message

exit

exit the program

command line

same commands as the interactive version except meant to be used from the command line directly in one shot, or by other shell programs/languages capable of executing shell commands...

  • trade(t)
    • flags:
      • type(required): market/limit
        • if (limit):
          • scale: execute trade on a point or range basis. takes no argument, if not listed, defaults to false
          • scale-type: required if scale is true, type of scaling, can be either "linear" or "exponential". defaults to linear.
          • price(required if scale === false): price value for the limit order to be executed at.
          • from(required if scale === true): starting value for range
          • to(required if scale === true): ending value for range
      • side(required): buy/sell
      • amount(required): order amount
      • symbol: asset to be traded. if none given, defaults to default symbol set in config.
      • stop: price value for stop loss. if none given, no stop will be set.
      • reduce: takes no argument, if given, sets order to reduce only.
  • listen(l)
    • wss connection listen to the market for new positions opened, closed, volume spikes, etc.
      • ...coming soon!
  • view(v)
    • takes no flags and only inputs
    • "balance"
    • "open orders"
    • "closed orders"
    • "positions" (open positions)
    • if either option is excluded, goes into interactive mode for the left out values.
  • settings(s)
    • takes no flags, only inputs
    • "view/modify" "config/env"
    • if either option is excluded, goes into interactive mode for the left out values.

todo:

- calculate/display risk for trade before confirmation
- wss listen
- prettier/more colorful error logging.
- order book limit FOK chase orders
- conditional trigger orders
- other exchanges implementation (currently just bybit)