@hyperbridge/simplex 0.16.7 → 0.16.11

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.
package/README.md CHANGED
@@ -55,19 +55,29 @@ simplex.on("order:filled", ({ orderId, profitUsd }) => {
55
55
  })
56
56
 
57
57
  // Every runtime control the dashboard offers is a method — nothing needs a restart.
58
- await simplex.pairs.setCurve(0, "ask", [{ amount: "0", price: "1550" }])
58
+ // Prices come from limit orders posted to the HyperFX orderbook: 10,000 USDC in for
59
+ // 13,900,000 CNGN out, filled on Base, for swaps from Ethereum or Base.
60
+ await simplex.limitOrders.create({
61
+ fillChain: "EVM-8453",
62
+ tokenIn: "USDC",
63
+ amountIn: "10000",
64
+ tokenOut: "CNGN",
65
+ amountOut: "13900000",
66
+ acceptedSources: ["EVM-1", "EVM-8453"],
67
+ })
59
68
  await simplex.chains.setRpcUrls(8453, ["https://base-new.example"])
60
69
 
61
70
  await simplex.stop()
62
71
  ```
63
72
 
64
73
  `Simplex.start` takes a plain config object — no TOML file required — and returns once the solver is
65
- running. It logs nothing until you point `logger` at a sink, so importing the package never writes to
74
+ running. The config must name an `orderbook`; it carries no prices, and the solver fills only against
75
+ the limit orders you create while it runs. It logs nothing until you point `logger` at a sink, so importing the package never writes to
66
76
  your stdout.
67
77
 
68
78
  Signing is an interface, not a setting. `Signer` is an identity and three operations — sign this
69
79
  typed data, this EIP-7702 authorization, this transaction — with no viem types on it, so satisfying
70
- it never means matching this package's viem version. `privateKeySigner`,
80
+ it never means matching this package's viem version. `privateKeySigner`, `secretPhraseSigner`,
71
81
  `turnkeySigner` and `mpcVaultSigner` ship with the package, `viemSigner` adapts any viem account (a
72
82
  `toAccount` wrapper around an HSM or a remote signing service included), and your own implementation
73
83
  is a first-class citizen. Persistence is pluggable the same way: the default
@@ -90,7 +100,7 @@ still `simplex`. Prefer a container? The same binary ships as
90
100
  Hub page.
91
101
 
92
102
  With no config present, `simplex` opens a local browser wizard that walks through the minimum setup
93
- (chains, RPCs, bundlers, signer, Hyperbridge account, strategies), validates every endpoint live,
103
+ (chains, RPCs, bundlers, signer, Hyperbridge account), validates every endpoint live,
94
104
  writes a commented `filler-config.toml` (mode 600) and starts the solver in the same process.
95
105
  `simplex init` is the equivalent terminal wizard.
96
106
 
@@ -101,12 +111,11 @@ With a config present (`./filler-config.toml`, `$SIMPLEX_HOME/config.toml`, or `
101
111
 
102
112
  The solver serves a local web UI at `127.0.0.1:8686` by default:
103
113
 
104
- - setup wizard (when no config exists) — private key, MPCVault or Turnkey signer, static curves or Uniswap V4 pool pricing
114
+ - setup wizard (when no config exists) — private key, secret phrase, MPCVault or Turnkey signer, chains and endpoints
105
115
  - status, pause/resume (persists across restarts), graceful stop, balances per chain
106
116
  - live activity feed (orders detected/filled/skipped, bids, rebalances) streamed over SSE
117
+ - limit orders: post, inspect with the fills that drew them down, and cancel
107
118
  - operations: manual vault sweep/redeem, runtime allowlist editing, log level switch, rebalancing trigger view, masked config view
108
- - inflight FX price curve updates without a restart, persisted back to the config file
109
- - overfill-protection self-halts surfaced with an operator reset
110
119
 
111
120
  Flags:
112
121
 
@@ -124,18 +133,26 @@ every line simplex writes to stdout one JSON object, with no ANSI escapes, which
124
133
  file needs. (One caveat: `@polkadot/api` prints a plain-text line to stdout if the Hyperbridge runtime
125
134
  upgrades while the solver is running, so parse defensively.)
126
135
 
127
- The curve-update API:
136
+ The limit-order API:
128
137
 
129
138
  ```bash
130
- curl http://127.0.0.1:8686/api/strategies
131
- curl -X PUT http://127.0.0.1:8686/api/strategies/0/curves \
139
+ curl http://127.0.0.1:8686/api/orderbook/books # books, dust floors, tokens per chain
140
+ curl http://127.0.0.1:8686/api/limit-orders?status=open # also ?chain= and ?book=
141
+ curl -X POST http://127.0.0.1:8686/api/limit-orders \
132
142
  -H "Content-Type: application/json" -H "X-Simplex-UI: 1" \
133
- -d '{"askPriceCurve": [{"amount": "0", "price": "1550"}]}'
143
+ -d '{"fillChain": "EVM-8453", "tokenIn": "USDC", "amountIn": "10000",
144
+ "tokenOut": "CNGN", "amountOut": "13900000", "acceptedSources": ["EVM-1", "EVM-8453"]}'
145
+ curl http://127.0.0.1:8686/api/limit-orders/<id> # { order, fills, bids }
146
+ curl -X DELETE http://127.0.0.1:8686/api/limit-orders/<id> -H "X-Simplex-UI: 1"
134
147
  ```
135
148
 
136
- Curve changes apply immediately and are written back to the config file (regenerated with standard
137
- comments) so restarts keep them. Venue-priced strategies and disabled sides (one-sided LP) are not
138
- editable. The server is unauthenticated — mutating requests need the `X-Simplex-UI: 1` header (CSRF
149
+ Amounts are whole tokens as decimal strings. `acceptedSources` must name at least one source chain,
150
+ and `ttlSecs` is optional (default `[orderbook] defaultTtlSecs`, or 365 days). Orders live in
151
+ `bids.db`, not the config file: a fill draws an order down and reposts the rest, and it lapses when
152
+ its TTL runs out. See the
153
+ [limit orders guide](https://docs.hyperbridge.network/developers/evm/simplex/limit-orders/).
154
+
155
+ The server is unauthenticated — mutating requests need the `X-Simplex-UI: 1` header (CSRF
139
156
  hygiene), and both the wizard and the operator UI bind loopback unless told otherwise. Only bind
140
157
  another interface (e.g. `--ui 0.0.0.0:8686`, which the docker image does inside its own network
141
158
  namespace) on a trusted network.