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

@openwhaleorg/crossex-strategy

v0.1.0

Published

OpenWhale CrossEx Strategy — cross-exchange strategies that trade one shared-margin account (paired position, spread bot, ADR premium)

Readme

@openwhaleorg/crossex-strategy

在 Gate CrossEx 一个账户(共享保证金池上的两条永续腿)上运行的 OpenWhale 策略。依赖 @openwhaleorg/crossex;四腿套利另需 @openwhaleorg/pendle。

| 策略 | 做什么 | |---|---| | paired-position | 价差 ≥ entryBps(可为负 = 容忍成本)时分片建仓,到 totalAmount 为止。 | | spread-bot | 价差宽了开、窄了平、循环;受 maxPosition 约束,不亏损平仓(可选持仓时限)。 | | adr-premium | 存托凭证 vs 本地股票,按溢价率开平;SHARE_RATIO / EQUAL_NOTIONAL 两种对冲口径;可选网格。 | | fixed-rate-carry | 四条腿:两个 Boros 市场的 YU 多/空 + 抵消两条浮动腿的 CrossEx 永续对。净 APR 过线即入场,持有到期。 |

前三个共用 PairStrategy:配对报价的新鲜度闸、优先修复腿失衡、按自己的成交计额度(激活时基线快照)、 TAKER_TAKER / MAKER_TAKER(价差边界上挂 post-only,成交即对冲)、倍增冷却与五次失败暂停、杠杆只设一次。

监控 — leg-quotes(同一时刻的两腿盘口、入场/出场价差、年龄、传输延迟)、carry-quotes (Boros 隐含 APR + 永续资费与价格,免密)。

执行器 — pair-trading:双腿 clip 逐腿回报、post-only 挂单、单腿吃单、撤单、杠杆;每笔单发出前按 交易所规则校验(lot、tick、最小数量、最小名义)。

脚本 — scheduled-exit:定时等分减仓,reduce-only,走执行器。离场是操作员的决定,不是策略参数。

价差

入场 (bps) = (卖腿 bid − 买腿 ask) / 买腿 ask × 10000
出场 (bps) = (卖腿 ask − 买腿 bid) / 买腿 bid × 10000
溢价 (%)   = ADR 价 / (对冲腿价 ÷ adrRatio) − 1

永远按实际会成交的一侧算,不用中间价。最优买卖价只在 CrossEx WebSocket 上。

没有 CrossEx 测试网:实例的 Dry run 选项(框架提供)是唯一的演练——引擎记录每条指令而不发送。MIT。