@reyaxyz/strategy-format 0.0.0-stage → 0.3.0
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/LICENSE.md +1 -0
- package/README.md +50 -2
- package/dist/en.json +212 -0
- package/dist/hash.d.ts +8 -0
- package/dist/hash.js +30 -0
- package/dist/index.d.ts +1814 -0
- package/dist/index.js +55 -0
- package/dist/lines.d.ts +138 -0
- package/dist/lines.js +516 -0
- package/dist/lines.json +287 -0
- package/dist/read.d.ts +21 -0
- package/dist/read.js +330 -0
- package/dist/schema/source.json +9 -0
- package/dist/schema/workflow-v3.accepted-kinds.json +226 -0
- package/dist/schema/workflow-v3.schema.json +1758 -0
- package/dist/sentences.d.ts +23 -0
- package/dist/sentences.js +553 -0
- package/dist/types.d.ts +242 -0
- package/dist/types.js +5 -0
- package/package.json +43 -4
package/dist/lines.json
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
{
|
|
2
|
+
"start-1": "This strategy takes over what the account already holds: {held}.",
|
|
3
|
+
"start-1.empty": "This strategy takes over whatever the account holds at Start. It holds nothing now.",
|
|
4
|
+
"start-2": "Its result counts from the prices at Start.",
|
|
5
|
+
"start-3": "Stop and close, max loss, and a liquidation close everything on the account.",
|
|
6
|
+
"start-3.listed": "Stop and close, max loss, and a liquidation close everything on the account, {positions} included.",
|
|
7
|
+
"start-4": "No trading by hand on this account while the strategy is live. Use another account, or stop it first.",
|
|
8
|
+
"start-5": "One Live strategy per account.",
|
|
9
|
+
"start-6": "Any of these ends the strategy: a new order on this account, changing or cancelling its orders or the ones it took over, cancelling or moving your own exchange stop, a cancel-all, or a cancel-all-after timer.",
|
|
10
|
+
"end-date-default": "It ends on {date}, the default end date. Renewing is not available yet.",
|
|
11
|
+
"hold-cancels": "When it reaches Holding, it cancels every order, its own or taken over, that would add to a position, and keeps the ones that reduce.",
|
|
12
|
+
"start-now-unknown": "Whether this condition is already true can't be checked right now. If you start, it waits for the next crossing.",
|
|
13
|
+
"set-liquidation": "If the account is liquidated: everything left is closed and the strategy ends.",
|
|
14
|
+
"set-margin": "If an order does not fit the margin: it is skipped, the strategy is marked Needs-you, and it tries again on the next trigger.",
|
|
15
|
+
"stop-gap": "Your stops are run by Reya's service, not the exchange. They pause for a short time when Reya updates the service, and for as long as an outage lasts.",
|
|
16
|
+
"stop-service": "They normally fire within seconds of the level. When many stops fire at once, or the exchange is overloaded, a stop can take longer; the close keeps trying, and you get a Needs-you if it is still open after 2 minutes.",
|
|
17
|
+
"stop-fill": "A fast move can fill worse than this.",
|
|
18
|
+
"stop-liquidation-margin": "Below the account's liquidation margin the exchange refuses every order, so a strategy stop cannot fire there.",
|
|
19
|
+
"pause": "There is no pause. To pause: Stop, keep positions, then Start again. While it is stopped the positions have no stop from us, and the result and max loss start again from zero.",
|
|
20
|
+
"stops-paused-app": "Reya's service can't be reached, so your strategy's stops aren't running.",
|
|
21
|
+
"close-by-hand.unreachable": "Reya's service can't be reached, so your strategy's stops aren't running. Closing by hand ends the strategy and keeps your other positions.",
|
|
22
|
+
"close-by-hand.paused": "Your strategy's stops are paused while Reya's service recovers. Closing by hand ends the strategy and keeps your other positions.",
|
|
23
|
+
"warn-no-max-loss": "Running without a max loss is not recommended.",
|
|
24
|
+
"warn-max-loss-liquidation": "Set a lower max loss, or make the position smaller.",
|
|
25
|
+
"warn-held": "Max loss counts them too: a loss on {list} alone can hit it and close everything.",
|
|
26
|
+
"warn-outside-exit": "Add a price stop or a time exit.",
|
|
27
|
+
"refuse-stop-side": "For a long, a stop-loss goes below the price and a take-profit above. For a short, the other way round.",
|
|
28
|
+
"refuse-stop-entry": "For a long, a stop-loss goes below the price and a take-profit above. For a short, the other way round.",
|
|
29
|
+
"refuse-second-live": "Use another account, or stop it first.",
|
|
30
|
+
"refuse-manual-order": "This account runs {strategy}. No order, cancel or stop change by hand while it is live. Trade from another account, or stop the strategy first.",
|
|
31
|
+
"refuse-limit-far": "A resting order has to sit within {pct}% of the current price, or the exchange refuses it. To trade further away, use a rule that waits for the price.",
|
|
32
|
+
"refuse-odds-off": "To start it, take out the rules that read prediction odds.",
|
|
33
|
+
"refuse-edit": "Editing a running strategy is not available yet.",
|
|
34
|
+
"why-not-reached": "The stop is at {level}. The mark is {mark} as of {time}. It has not been reached.",
|
|
35
|
+
"why-stale": "Your stop can't be watched: the price for {market} is stale. It is checked on the first fresh price.",
|
|
36
|
+
"why-stale.no-market": "Your stop can't be watched: its price is stale. It is checked on the first fresh price.",
|
|
37
|
+
"why-refused": "The stop fired at {time}. The close order was refused: {reason}. It keeps trying.",
|
|
38
|
+
"why-rate-limit": "The stop fired at {time}. The close is held back by the exchange's rate limit.",
|
|
39
|
+
"why-close-open": "The stop fired at {time}. The close is still open: {reason}.",
|
|
40
|
+
"why-odds": "The odds for this market can't be read, so an exit that waits on them can't fire on the odds. It still fires if another of its conditions is met.",
|
|
41
|
+
"why-no-stop": "{market} has no stop from this strategy.",
|
|
42
|
+
"why-nothing": "The strategy's record has no event that explains it. The stop is at {level}; the mark is {mark} as of {time}.",
|
|
43
|
+
"size-from-share": "{pct}% of your balance is {amount} USDC today, so each order is {amount} USDC.",
|
|
44
|
+
"feature-unavailable": "{asked} is not available in strategies.",
|
|
45
|
+
"pin-question": "Which prediction market should this read?",
|
|
46
|
+
"pin-source": "Polymarket, as of {time} UTC",
|
|
47
|
+
"pin-option": "{outcome} · {pct}% now · listed end {date}",
|
|
48
|
+
"pin-thin": " · thin market: ${volume} traded in 24h, ${depth} near the price",
|
|
49
|
+
"pin-past-end.option": " · past its end date, waiting to be resolved",
|
|
50
|
+
"pin-none": "None of these",
|
|
51
|
+
"pin-answer": "Market {n}.",
|
|
52
|
+
"pin-answer.none": "None of these.",
|
|
53
|
+
"pin-left-out": "Left out: \"{question}\". {reason}",
|
|
54
|
+
"pin-label": "Reads Polymarket: \"{question}\" · {outcome} · listed end {date}",
|
|
55
|
+
"pin-past-end": "This market is past its end date and waiting to be resolved. When Polymarket closes it, the rules that read it stop and you get a Needs-you.",
|
|
56
|
+
"pin-ends-early": "This market's listed end date is before your strategy's. When Polymarket closes it, the rules that read it stop and you get a Needs-you.",
|
|
57
|
+
"warn-thin": "\"{question}\" is thinly traded right now: ${depth} near the price. A small trade there can push the odds across your level for a moment, and your rule would fire on it.",
|
|
58
|
+
"odds-can-thin": "A market can turn thin while the strategy runs. Its odds are still used while they pass the liquidity checks.",
|
|
59
|
+
"odds-checks-reya": "The liquidity checks on prediction odds are Reya's and can change while a strategy runs.",
|
|
60
|
+
"odds-no-history": "This strategy reads prediction odds, which are not stored: there is no past-price check and no backtest for it.",
|
|
61
|
+
"odds-jump": "If the odds jump past your level in one move, an entry on that crossing can be missed. An exit still fires on the next usable reading.",
|
|
62
|
+
"odds-band": "After a rule on an odds crossing fires, it can fire again only once the odds have gone back {band} points past its level.",
|
|
63
|
+
"odds-band-once.above": "A rule that fires when the odds cross above {level}% fires at most once: the odds can't go back {band} points past that level. For it to fire again, give a smaller band.",
|
|
64
|
+
"odds-band-once.below": "A rule that fires when the odds cross below {level}% fires at most once: the odds can't go back {band} points past that level. For it to fire again, give a smaller band.",
|
|
65
|
+
"odds-waiting": "waiting: odds unavailable",
|
|
66
|
+
"odds-first-reading": "waiting for a first reading",
|
|
67
|
+
"needs-odds-ended": "The prediction market \"{question}\" has ended. Its odds will not be read again, so a rule that waits on them will not fire.",
|
|
68
|
+
"pin-changed": "This market's wording or end date changed at Polymarket. Confirm it again.",
|
|
69
|
+
"pin-closed": "This market has closed.",
|
|
70
|
+
"pin-unusable": "This market is too thinly traded to use in a strategy right now.",
|
|
71
|
+
"pin-long-shot": "This market's odds are now under 2% or over 98%, so it can't be used in a strategy right now.",
|
|
72
|
+
"pin-not-live": "This outcome is not live at Polymarket, so it can't be used in a strategy.",
|
|
73
|
+
"pin-no-end-date": "This market lists no end date, so it can't be used in a strategy.",
|
|
74
|
+
"pin-text-unsafe.too-long": "This market's question or outcome name is too long to use in a strategy. Its odds can still be quoted.",
|
|
75
|
+
"pin-text-unsafe.address": "This market's wording contains what reads as a web address or a wallet address, so it can't be used in a strategy. Its odds can still be quoted.",
|
|
76
|
+
"pin-text-unsafe.characters": "This market's wording contains a hidden or look-alike character, so it can't be used in a strategy. Its odds can still be quoted.",
|
|
77
|
+
"pin-text-unsafe.spacing": "This market's wording has unusual spacing (extra spaces or a line break), so it can't be used in a strategy. Its odds can still be quoted.",
|
|
78
|
+
"pin-unreadable": "Prediction-market data can't be read right now.",
|
|
79
|
+
"status-running": "Running: the strategy is active.",
|
|
80
|
+
"status-closing": "Closing: a close is in progress. It keeps trying until the account is flat.",
|
|
81
|
+
"status-holding": "Holding: a position is held. Nothing new will be entered. Its stops and its other exits still run.",
|
|
82
|
+
"status-ended": "Ended: nothing more will happen. The account is yours again.",
|
|
83
|
+
"stop-close": "Stop and close: cancels every resting order on the account, closes every position on it and ends the strategy.",
|
|
84
|
+
"stop-keep": "Stop, keep positions: cancels the strategy's own resting orders and stops and ends the strategy. The positions stay open as yours, with no stop-loss from us. A stop you placed on the exchange yourself stays in place.",
|
|
85
|
+
"stop-closing": "A close is in progress. Stop, keep positions stops it: what is still open stays open as yours, with no stop-loss from us.",
|
|
86
|
+
"max-loss-closing": "Max loss is closing every position. If it stalls for 2 minutes, you can take over.",
|
|
87
|
+
"max-loss-take-over": "Close still open: {reason}. Take over: stop closing and keep what's left.",
|
|
88
|
+
"stop-list-unavailable": "This list can't be loaded right now. Stop still works.",
|
|
89
|
+
"catching-up": "Catching up after a restart. New entries wait until the account's orders have been checked.",
|
|
90
|
+
"ended-rules": "Ended by its own rules.",
|
|
91
|
+
"ended-stop-close": "Stopped with Stop and close.",
|
|
92
|
+
"ended-stop-keep": "Stopped with Stop, keep positions.",
|
|
93
|
+
"ended-max-loss": "Ended at max loss. Everything on the account was closed.",
|
|
94
|
+
"ended-expiry": "Ended after its end date.",
|
|
95
|
+
"ended-operator": "Reya's team ended this strategy after a fault it could not recover from. Nothing was cancelled or closed: your positions and orders are as they were, with no stop-loss from us.",
|
|
96
|
+
"ended-position-flipped": "Ended: an order the strategy did not send turned a position to the other side while a stop was closing it. Your positions are open, with no stop-loss from us.",
|
|
97
|
+
"row-not-traded": "not traded by this strategy",
|
|
98
|
+
"row-no-stop": "not covered by any stop",
|
|
99
|
+
"row-rate-limit": "held back by the exchange's rate limit",
|
|
100
|
+
"row-missed": "missed: too late",
|
|
101
|
+
"needs-permission": "Reya can no longer trade for this account. Your positions are open with no stop.",
|
|
102
|
+
"needs-outside-order": "An order placed outside the strategy ended it. Your positions are open, with no stop-loss from us.",
|
|
103
|
+
"needs-outside-order.modified": "An order was changed outside the strategy, which ended it. Your positions are open, with no stop-loss from us.",
|
|
104
|
+
"needs-outside-order.cancelled": "An order was cancelled outside the strategy, which ended it. Your positions are open, with no stop-loss from us.",
|
|
105
|
+
"needs-outside-order.found_at_restart": "A change made outside the strategy was found after a restart, which ended it. Your positions are open, with no stop-loss from us.",
|
|
106
|
+
"needs-liquidation": "The account was liquidated.",
|
|
107
|
+
"needs-liquidation.running": "The account was liquidated. The strategy carries on with what is left.",
|
|
108
|
+
"needs-liquidation.closing": "The account was liquidated. Reya is closing what is left; the strategy then ends.",
|
|
109
|
+
"needs-liquidation.ended": "The account was liquidated. Everything left was closed and the strategy ended.",
|
|
110
|
+
"needs-deleveraged": "The exchange cut your {market} position to cover another account's liquidation. The strategy carries on with what is left.",
|
|
111
|
+
"needs-deleveraged.no-market": "The exchange cut a position to cover another account's liquidation. The strategy carries on with what is left.",
|
|
112
|
+
"needs-margin": "An order did not fit the margin and was skipped. It tries again on the next trigger.",
|
|
113
|
+
"needs-margin.in-a-row": "An order did not fit the margin and was skipped: {n} in a row. It tries again on the next trigger.",
|
|
114
|
+
"needs-no-answer": "No new orders on {market} until the exchange shows what happened to this order. A stop on this market is not held back.",
|
|
115
|
+
"needs-no-answer.no-market": "No new orders until the exchange shows what happened to this order. A stop is not held back.",
|
|
116
|
+
"needs-no-answer-team": "An order has no answer. Reya's team is checking it.",
|
|
117
|
+
"needs-dropped": "Three entries in a row were missed.",
|
|
118
|
+
"needs-expiry": "This strategy expires on {date}. It then stops entering and holds its position. Its stops and its other exits still run.",
|
|
119
|
+
"needs-max-loss-paused.price": "Max loss is paused: the price for {market} is stale.",
|
|
120
|
+
"needs-max-loss-paused.price-any": "Max loss is paused: a market's price is stale.",
|
|
121
|
+
"needs-max-loss-paused.account": "Max loss is paused: Reya's account data is behind.",
|
|
122
|
+
"needs-max-loss-paused.funding": "Max loss is paused: funding data is behind.",
|
|
123
|
+
"needs-max-loss-paused.error": "Max loss is paused: its figures can't be read.",
|
|
124
|
+
"needs-max-loss-paused": "Max loss is paused: it can't be checked right now.",
|
|
125
|
+
"needs-order-refused": "The exchange refused an order on {market}.",
|
|
126
|
+
"needs-order-refused.no-market": "The exchange refused an order.",
|
|
127
|
+
"needs-order-refused.strategy": "The strategy could not place an order on {market}.",
|
|
128
|
+
"needs-order-refused.strategy-no-market": "The strategy could not place an order.",
|
|
129
|
+
"needs-busted": "A fill on {market} did not settle and was undone. The order counts as refused.",
|
|
130
|
+
"needs-busted.no-market": "A fill did not settle and was undone. The order counts as refused.",
|
|
131
|
+
"needs-unsent": "An order on {market} was not sent: the service restarted first.",
|
|
132
|
+
"needs-unsent.no-market": "An order was not sent: the service restarted first.",
|
|
133
|
+
"needs-rule-unreadable": "A rule can't be checked right now: {rule}",
|
|
134
|
+
"needs-engine-limit": "The strategy hit an internal limit and stopped part-way through a step. Reference: {code}.",
|
|
135
|
+
"needs-account-suspended": "The exchange has suspended new orders on this account.",
|
|
136
|
+
"needs-stops-paused": "Stops are paused while Reya's service recovers.",
|
|
137
|
+
"needs-unprotected": "This position has no stop from Reya right now.",
|
|
138
|
+
"needs-stop-slower": "A stop can take longer.",
|
|
139
|
+
"needs-orders-paused": "Reya has paused new orders.",
|
|
140
|
+
"needs-market-data": "Waiting: market data unavailable.",
|
|
141
|
+
"needs-cancel-left": "An order Reya cancelled is still on the exchange.",
|
|
142
|
+
"needs-round-unknown": "A round's result couldn't be read: it counts as neither a win nor a loss.",
|
|
143
|
+
"needs-feature-off": "A feature this strategy uses has been switched off. Nothing new is entered until it is back.",
|
|
144
|
+
"needs-close-stopped": "The close stopped. Still open with no stop from Reya.",
|
|
145
|
+
"needs-close-stopped.detail": "The close stopped. Still open with no stop from Reya: {detail}.",
|
|
146
|
+
"needs-position-unreadable": "Your stop can't be watched: Reya can't read the position right now.",
|
|
147
|
+
"needs-cancels-pending": "The strategy is ending and has waited 2 minutes for its cancels to go through.",
|
|
148
|
+
"needs-history-incomplete": "Reya can't confirm this account's history right now, so nothing new is entered and max loss waits. Its stops and exits still run.",
|
|
149
|
+
"needs-history-incomplete.ended": "Reya can't confirm this account's history right now.",
|
|
150
|
+
"needs-cancel-refused": "The exchange refused a cancel Reya sent for the close.",
|
|
151
|
+
"needs-orders-unreadable": "Reya can't read a stored order, so it set this strategy's orders aside. Reya's team is checking it.",
|
|
152
|
+
"needs-other": "This strategy needs your attention. Reference: {code}.",
|
|
153
|
+
"close-reason.close_open_halted": "Close still open: halted market",
|
|
154
|
+
"close-reason.close_open_no_liquidity": "Close still open: no liquidity within the market's band",
|
|
155
|
+
"close-reason.close_open_margin": "Close still open: refused for margin",
|
|
156
|
+
"close-reason.close_open_overloaded": "Close still open: the exchange is shedding load",
|
|
157
|
+
"close-reason.close_open_refused": "Close still open: order refused",
|
|
158
|
+
"close-reason.close_open_band_unknown": "Close still open: Reya can't read this market's price limits",
|
|
159
|
+
"close-reason.band_copy_invalid": "Close still open: Reya can't read this market's price limits",
|
|
160
|
+
"close-reason.close_open_permission_check": "Close still open: checking whether Reya can still trade for this account",
|
|
161
|
+
"close-reason.close_open_position_unknown": "Close still open: Reya can't read this account's position right now",
|
|
162
|
+
"close-reason.close_open_entry_settlement": "Close still open: waiting for the entry to settle",
|
|
163
|
+
"close-reason.close_open_paused": "Close still open: the exchange isn't taking orders on this market right now",
|
|
164
|
+
"close-reason.close_settling_stuck": "Close still open: waiting for the exchange to settle a fill",
|
|
165
|
+
"close-reason.close_price_out_of_range": "Close still open: its limit price is outside the exchange's price range",
|
|
166
|
+
"close-reason.late_fill_closed": "Close still open: a late fill brought the position back",
|
|
167
|
+
"close-reason.close_overdue": "Close still open: nothing has filled for 2 minutes",
|
|
168
|
+
"close-reason.close_parent_held": "Close still open: waiting for its cancels or another market's close",
|
|
169
|
+
"close-reason.rate_limited": "Close still open: held back by the exchange's rate limit",
|
|
170
|
+
"act-start": "Strategy started.",
|
|
171
|
+
"act-rule": "Rule fired: {rule}",
|
|
172
|
+
"act-order-sent": "Order sent.",
|
|
173
|
+
"act-fill": "Fill received.",
|
|
174
|
+
"act-account-fill": "Fill on the account.",
|
|
175
|
+
"act-busted": "A fill did not settle and was undone.",
|
|
176
|
+
"act-order-refused": "The exchange refused an order.",
|
|
177
|
+
"act-order-refused.strategy": "The strategy could not place an order.",
|
|
178
|
+
"act-entry-skipped.late": "Entry skipped: it came too late.",
|
|
179
|
+
"act-entry-skipped.margin": "Entry missed: the margin couldn't be checked.",
|
|
180
|
+
"act-entry-skipped.price": "Entry missed: the price moved more than 25 bps after the reading.",
|
|
181
|
+
"act-entry-skipped": "Entry skipped.",
|
|
182
|
+
"act-entry-held": "Entry not placed: an earlier order on this market has not finished.",
|
|
183
|
+
"act-condition-unreadable": "Rule not acted on, because its condition could not be read: {rule}",
|
|
184
|
+
"act-already-flat": "Nothing to close: the position was already closed.",
|
|
185
|
+
"act-reduce-below-lot": "A reduce was not sent: it was smaller than the market's smallest order step.",
|
|
186
|
+
"act-rounds-used": "All rounds used.",
|
|
187
|
+
"act-max-loss": "Max loss reached.",
|
|
188
|
+
"act-expiry": "End date reached. Nothing new will be entered. Positions are held; their stops and other exits still run.",
|
|
189
|
+
"act-ended": "Strategy ended.",
|
|
190
|
+
"act-needs-you": "Needs you: {line}",
|
|
191
|
+
"act-needs-you-cleared": "Cleared: {line}",
|
|
192
|
+
"act-stop-close": "Stop and close requested.",
|
|
193
|
+
"act-stop-keep": "Stop, keep positions requested.",
|
|
194
|
+
"act-external-flat": "A position was closed by an order the strategy did not send.",
|
|
195
|
+
"act-deleveraged": "The exchange cut a position to cover another account's liquidation.",
|
|
196
|
+
"act-liquidation": "The exchange started a liquidation on the account.",
|
|
197
|
+
"act-position-flipped": "An order the strategy did not send turned a position to the other side while a stop was closing it.",
|
|
198
|
+
"act-orders-restart": "Reya's order service restarted and picked up its orders again.",
|
|
199
|
+
"act-check-order": "Reya placed and cancelled a check order (1 lot, far from the price) to confirm an earlier order did not go through.",
|
|
200
|
+
"act-close-band-busted": "The exchange undid a close fill for the market's price band. Reya's team is checking it.",
|
|
201
|
+
"act-book-refused": "An order was not sent: Reya's sender does not sign for it. Reya's team is checking it.",
|
|
202
|
+
"activity-other": "An event this version has no description for. Reference: {code}.",
|
|
203
|
+
"read-margin": "Margin needed",
|
|
204
|
+
"read-margin-engine": "Margin at the tightest point",
|
|
205
|
+
"read-fees": "Fees, at the highest taker rate",
|
|
206
|
+
"read-funding": "Funding until the end date",
|
|
207
|
+
"read-funding-excluded": "Funding is not included: no rule closes the position by a set time.",
|
|
208
|
+
"read-after-end": "A position can stay open after the end date. The cost of holding it then is not counted.",
|
|
209
|
+
"read-deposit": "More to deposit",
|
|
210
|
+
"read-rounds": "Rounds that fit now: {n} of {rounds}",
|
|
211
|
+
"read-rounds.uncounted": "Rounds that fit now: {n}",
|
|
212
|
+
"read-round-cost": "Cost of one round",
|
|
213
|
+
"read-balance-all": "Balance at which every round fits",
|
|
214
|
+
"read-loss-at-stop": "Loss at your stop level, {market}",
|
|
215
|
+
"read-also-closed": "Stop and close also closes: {markets}",
|
|
216
|
+
"read-deployed": "Largest position open at once",
|
|
217
|
+
"read-liq-price": "Liquidation price, {market}",
|
|
218
|
+
"read-liq-none": "{market}: a move in this market alone can't liquidate the account.",
|
|
219
|
+
"read-liq-underwater": "{market}: the account is already past its liquidation point.",
|
|
220
|
+
"read-liq-move": "Liquidation is {pct}% away, nearest on {market}",
|
|
221
|
+
"read-order": "{quantity} {market}, max slippage {bound} bps: worst price {price} now",
|
|
222
|
+
"read-exact": "{figure}",
|
|
223
|
+
"read-at-most": "at most {figure}",
|
|
224
|
+
"read-at-least": "at least {figure}",
|
|
225
|
+
"read-unknown": "not known yet",
|
|
226
|
+
"whatif-max-loss": "If the loss reaches max loss: everything on the account is closed and the strategy ends.",
|
|
227
|
+
"whatif-expiry": "At the end date: nothing new is entered. Positions are held; their stops and other exits still run.",
|
|
228
|
+
"whatif-odds-unreadable": "If the odds for \"{question}\" can't be read: no rule answers it, so nothing changes and no position is closed.",
|
|
229
|
+
"whatif-odds-ended": "If the market \"{question}\" ends: no rule answers it, so nothing changes and no position is closed.",
|
|
230
|
+
"whatif-order-refused": "If the exchange refuses an order: it shows as refused, and nothing else changes unless a rule answers it.",
|
|
231
|
+
"whatif-cancelled": "If the exchange cancels this resting order when it would fill: what is left of it never fills, its round still counts, and it is not placed again.",
|
|
232
|
+
"whatif-own-cancelled": "If the exchange cancels your own resting order on {market} when it would fill: what is left of it never fills. The strategy does not place it again.",
|
|
233
|
+
"whatif-all-fill": "If every order that adds to a position fills: it needs {needed} of margin. The account has {have}.",
|
|
234
|
+
"whatif-own-stop.stop-loss": "If your exchange stop-loss on {market} fires: the exchange closes your whole {market} position, the strategy's part included, and the strategy's {market} part ends.",
|
|
235
|
+
"whatif-own-stop.take-profit": "If your exchange take-profit on {market} fires: the exchange closes your whole {market} position, the strategy's part included, and the strategy's {market} part ends.",
|
|
236
|
+
"whatif-own-stop-other.stop-loss": "If your exchange stop-loss on {market} fires: the exchange closes that position and the strategy carries on.",
|
|
237
|
+
"whatif-own-stop-other.take-profit": "If your exchange take-profit on {market} fires: the exchange closes that position and the strategy carries on.",
|
|
238
|
+
"whatif-own-fill-basis": "If your own resting order on {market} fills: the strategy's entry price on {market} moves to {basis}, and the levels set from the entry move with it.",
|
|
239
|
+
"whatif-own-fill-reduces": "If your own resting order on {market} fills: the {market} position gets smaller and its entry price stays.",
|
|
240
|
+
"whatif-own-fill-reduces.basis": "If your own resting order on {market} fills: the {market} position gets smaller and its entry price stays at {basis}.",
|
|
241
|
+
"whatif-own-fill-other": "If your own resting order on {market} fills: your {market} position changes. The strategy does not read that market.",
|
|
242
|
+
"whatif-carry-on": "If the account is liquidated: the strategy carries on with what is left.",
|
|
243
|
+
"whatif-stop-on-skip": "If an order does not fit the margin: the strategy stops.",
|
|
244
|
+
"whatif-unknown": "{if}: not known yet.",
|
|
245
|
+
"whatif-unknown.plain": "What happens here is not known yet.",
|
|
246
|
+
"whatif-if.exchange_stops": "If one of your exchange stops fires",
|
|
247
|
+
"whatif-if.every_buy_fills": "If every order that adds to a position fills",
|
|
248
|
+
"whatif-if.inherited_fill": "If one of your own resting orders fills",
|
|
249
|
+
"whatif-if.cancelled_at_fill": "If the exchange cancels one of your own resting orders when it would fill",
|
|
250
|
+
"whatif-not-derived": "What happens here could not be worked out.",
|
|
251
|
+
"paper-what": "Paper places no real orders. Fills are simulated at the mark, with the assumed slippage, the fee at the run's fee tier, and funding charged.",
|
|
252
|
+
"paper-optimistic": "Paper fills at the mark; a real order can fill worse.",
|
|
253
|
+
"paper-start-empty": "This Paper run starts with no positions.",
|
|
254
|
+
"paper-start-empty.held": "This Paper run starts with no positions. Paper margin ignores the account's positions, where Live would take them over.",
|
|
255
|
+
"paper-start-copy": "Paper started from your account's positions: {positions}. Not copied: {left}.",
|
|
256
|
+
"paper-margin.set": "Paper margin: {amount} USDC, set by you.",
|
|
257
|
+
"paper-margin.balance": "Paper margin: your balance at Start, {amount} USDC.",
|
|
258
|
+
"paper-balance-ask": "This account holds no funds. What paper balance, in USDC, should this Paper run check its margin against?",
|
|
259
|
+
"paper-costs": "Assumed slippage {bps} bps, {slippage}. Fees: {tier}, {fee}.",
|
|
260
|
+
"paper-costs.slippage-set": "set by you",
|
|
261
|
+
"paper-costs.slippage-default": "the default",
|
|
262
|
+
"paper-costs.fee-current": "your current rate",
|
|
263
|
+
"paper-costs.fee-set": "set by you",
|
|
264
|
+
"paper-costs.fee-standard": "the standard rate, before discounts",
|
|
265
|
+
"paper-no-liquidation": "Paper has no liquidation: nothing forces a Paper position closed. If the paper margin runs out, new orders are skipped and exits keep running.",
|
|
266
|
+
"paper-live-refuses": "Live would refuse this.",
|
|
267
|
+
"paper-prefix": "Paper: {line}",
|
|
268
|
+
"paper-below-zero": "The paper balance went below zero on {date}. A Live account would have been liquidated before this, so results after it are not realistic.",
|
|
269
|
+
"paper-not-closed": "not closed: valued at the last price",
|
|
270
|
+
"paper-to-live": "Going Live runs every check again on your real account, counting what it holds. The assumed slippage and fee tier no longer apply: Live uses real fees and real fills.",
|
|
271
|
+
"paper-stop": "Stop closes this Paper run's positions at simulated prices, with fees and the assumed slippage, and ends it. Nothing on your real account changes.",
|
|
272
|
+
"paper-stop-stalled": "Nothing has filled for 2 minutes. Stop ends this Paper run now, and what is left is valued at the last price.",
|
|
273
|
+
"paper-unavailable": "Paper is not available for this strategy yet. Start on the card starts it Live, with real orders.",
|
|
274
|
+
"paper-cutover": "Paper now charges fees, an assumed slippage and funding, as Live does, so a Paper result will look lower than before.",
|
|
275
|
+
"refuse-paper-keep": "A Paper run can't be stopped with its positions kept: nobody could close them afterwards. Stop closes them.",
|
|
276
|
+
"refuse-paper-limit": "Stop one to start another.",
|
|
277
|
+
"refuse-paper-limit.fallback": "This account already has {n} active Paper runs, the most allowed. Stop one to start another.",
|
|
278
|
+
"refuse-paper-slippage": "Set a lower assumed slippage.",
|
|
279
|
+
"v2-card": "This was made on the previous version of strategies and can't be started.",
|
|
280
|
+
"v2-run-gone": "This strategy ran on the previous version and is no longer shown.",
|
|
281
|
+
"v2-closing-notice.close": "Strategies move to a new version on {date}. A strategy still running then is stopped and its positions closed.",
|
|
282
|
+
"v2-closing-notice.keep": "Strategies move to a new version on {date}. A strategy still running then is stopped and its positions stay open as yours, with no stop-loss from us.",
|
|
283
|
+
"card-unavailable": "I can't prepare the strategy card right now. The team has been alerted. Your draft is saved, so try again shortly.",
|
|
284
|
+
"step-building": "Building your strategy…",
|
|
285
|
+
"renewal-unavailable": "Renewing a strategy is not available yet.",
|
|
286
|
+
"no-history-release": "There is no past-price check or backtest in this release."
|
|
287
|
+
}
|
package/dist/read.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StrategyV3 } from './types';
|
|
2
|
+
/** AGT-212's cap on a document, in UTF-8 bytes. */
|
|
3
|
+
export declare const MAX_DOCUMENT_BYTES = 12288;
|
|
4
|
+
export type ReadCode = 'document_too_large' | 'depth_exceeded' | 'json_invalid' | 'not_canonical' | 'explicit_default' | 'schema_invalid' | 'string_invalid_scalar' | 'id_duplicate' | 'one_of_violated' | 'rounds_then_mismatch' | 'label_control_character' | 'expr_too_large';
|
|
5
|
+
export type ReadResult = {
|
|
6
|
+
ok: true;
|
|
7
|
+
doc: StrategyV3;
|
|
8
|
+
versionHash: string;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
code: ReadCode;
|
|
12
|
+
path: string;
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Reads a v3 document so a client can show and hash it. A convenience, never a validator: it answers
|
|
17
|
+
* "do I understand every byte I am about to show and hash?", and the service stays the only judge of
|
|
18
|
+
* whether the strategy is valid. Stops at the first failure. `path` is dotted, as the service's
|
|
19
|
+
* (`rules.r_5.when.band`), and empty for the whole text.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readStrategy(text: string): ReadResult;
|