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 🙏

© 2026 – Pkg Stats / Ryan Hefner

twap-plugin

v2.0.4

Published

TWAP algorithmic execution plugin for Orderly Network SDK front-ends — sliced taker order entry over a chosen duration, with a Bot tab tracking running and past tickets.

Readme

twap-plugin

TWAP algorithmic execution as an Orderly Network SDK plugin.

Adds a TWAP order type and a Bot tab to an Orderly-SDK DEX front-end. Instead of sending the whole order at once, it works the order over a duration you choose, slicing it and placing it as taker. The panel replaces the order-entry body for the TWAP order type and leaves every other order type untouched; the Bot tab lists the resulting tickets (Running / History) with their fill progress and duration.

Install

The plugin is bundled into your own Orderly-SDK front-end (there is no marketplace install — you host the front-end and register the plugin in it):

import { registerTwapExec } from "twap-plugin";

<OrderlyAppProvider brokerId="…" plugins={[registerTwapExec()]}>
  …
</OrderlyAppProvider>

That is the whole setup. The execution backend is hosted for you and already pointed at; the plugin reads the active symbol and account from the Orderly SDK context and uses whatever brokerId your app already has. It depends on the @orderly.network/* v3 packages (peer dependencies); the descriptor declares orderlyVersion: ">=2.10.1" for the host's compatibility gate.

A trader's first TWAP costs zero extra wallet signatures: instead of prompting for its own delegation, the plugin adopts the Orderly trading key the DEX's own "Enable Trading" flow already delegated — it reads that key from the SDK's keyStore and hands it to the backend once, over TLS, where it is encrypted at rest so the executor can keep working after the tab closes.

Execution

Every ticket runs taker: sliced market/IOC orders paced across the duration. (A maker mode exists in the code but is hidden until it paces across the whole window rather than filling as fast as the touch is hit.)

Duration is entered as hours + minutes (1 minute to 168 hours); the server enforces the same bounds. The Bot tab shows each ticket's window as 2h 5m / 6h / 5m.

Markets

All official Orderly perps (PERP_<BASE>_USDC) are supported. A permissionless / community listing (a fourth symbol segment, e.g. PERP_CTEST_USDC_<suffix>) is also supported, but it trades isolated-margin only — so the form asks the trader to set that market to isolated margin on their account first, and only then renders the order form (otherwise every slice would fail on margin).

How a request proves who it is

The browser generates an ECDSA P-256 keypair the first time you enable TWAP. Its public half is bound to your account when the backend adopts your existing Orderly trading key (the one the DEX's "Enable Trading" already delegated); every later request carries a signature over that exact call. Nothing reusable crosses the network — a captured request yields a signature for one call at one instant.

The private key lives in IndexedDB as a non-extractable CryptoKey: script on the page can ask it to sign but cannot read it out. Clearing site data or moving to another browser means onboarding again.

Layout

| File | What it is | |---|---| | src/plugin.tsx | registerTwapExec() — the interceptor descriptor | | src/OrderForm.tsx | TwapOrderPanel — the TWAP order form | | src/BotPanel.tsx | BotPanel — the Bot tab (Running / History tickets) | | src/api.ts | the backend client | | src/signing.ts | keypair generation, storage and request signing | | src/mode.ts | the TWAP order-type id |

Development

npm install
npm run build      # tsc → dist/
npm pack           # inspect the tarball before publishing