@shippedcalls/sdk 0.3.0 → 0.3.1
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 +11 -2
- package/dist/abi.d.ts +264 -0
- package/dist/abi.js +342 -0
- package/dist/abi.js.map +1 -1
- package/dist/cli.js +87 -4
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +30 -3
- package/dist/client.js +83 -9
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +5 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/odds.d.ts +4 -0
- package/dist/odds.js +13 -0
- package/dist/odds.js.map +1 -1
- package/dist/types.d.ts +31 -8
- package/package.json +1 -1
- package/skill/SKILL.md +8 -2
- package/skill/references/api.md +6 -1
- package/skill/references/rounds.md +16 -7
- package/skill/references/write-path.md +4 -0
- package/skill/scripts/calls.sh +1 -1
- package/src/abi.ts +342 -0
- package/src/cli.ts +76 -4
- package/src/client.ts +82 -9
- package/src/errors.ts +7 -1
- package/src/index.ts +2 -2
- package/src/odds.ts +14 -0
- package/src/types.ts +14 -6
package/dist/errors.js
CHANGED
|
@@ -10,6 +10,8 @@ export class CallsError extends Error {
|
|
|
10
10
|
this.status = status;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
/** The transaction went out and may have landed. Don't send it again without checking. */
|
|
14
|
+
export const RECEIPT_UNKNOWN = "receipt_unknown";
|
|
13
15
|
export const NOT_ENOUGH_ETH = "Not enough ETH to cover this and gas.";
|
|
14
16
|
// Keyed by error name, or by `function.error` where one revert means different things on different calls.
|
|
15
17
|
const REVERTS = {
|
|
@@ -30,15 +32,17 @@ const REVERTS = {
|
|
|
30
32
|
IsDeedCall: "A Call on a bond settles from the bond's ruling.",
|
|
31
33
|
TransferFailed: "The payment could not be delivered to that address.",
|
|
32
34
|
InsufficientBalance: NOT_ENOUGH_ETH,
|
|
33
|
-
TooLate: "Betting has closed on this round. The next one
|
|
35
|
+
TooLate: "Betting has closed on this round. The next one opens at the lock, within ten seconds.",
|
|
34
36
|
BelowMinimum: "The minimum bet is 0.001 ETH.",
|
|
35
37
|
OverStakeCap: "One wallet can stake up to 0.5 ETH in a round.",
|
|
36
38
|
OverDailyLimit: "This would take the wallet past the daily limit it set for itself.",
|
|
37
39
|
OtherSide: "This wallet is already on the other side of this round.",
|
|
38
40
|
MarketPaused: "This market isn't taking bets right now.",
|
|
39
41
|
UnknownMarket: "Rounds has no such market.",
|
|
42
|
+
GasTooLow: "This win's card needs more gas. Send at least the estimate.",
|
|
40
43
|
};
|
|
41
44
|
/** One sentence for a failed read or write. RPC URLs can carry keys, so nothing from the transport is passed on. */
|
|
45
|
+
export const revertLine = (name) => REVERTS[name] ?? `The contract would refuse this: ${name}.`;
|
|
42
46
|
export function describe(error) {
|
|
43
47
|
if (error instanceof CallsError)
|
|
44
48
|
return error;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,MAAM,CAAC;AAExH,sHAAsH;AACtH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAIxB;IACA;IAJF,IAAI,GAAG,YAAY,CAAC;IAC7B,YACE,OAAe,EACN,IAAY,EACZ,MAAe;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAS;IAG1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAEtE,0GAA0G;AAC1G,MAAM,OAAO,GAA2B;IACtC,gBAAgB,EAAE,2CAA2C;IAC7D,mBAAmB,EAAE,mCAAmC;IACxD,aAAa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AAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;IACrC,IAAI,IAAI;QAAE,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,YAAY,IAAI,IAAI,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,8BAA8B,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1I,IAAI,MAAM;QAAE,OAAO,IAAI,UAAU,CAAC,4BAA4B,EAAE,UAAU,CAAC,CAAC;IAC5E,OAAO,IAAI,UAAU,CAAC,sFAAsF,EAAE,iBAAiB,CAAC,CAAC;AACnI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { createClient, accountFromKey, bondIdOf, prepareOpen, roundSideOf, sideO
|
|
|
2
2
|
export { API_URL, CALLED_IT, CHAIN_ID, DEEDS, EXPLORER, FACTORY, PREVIOUS_FACTORIES, RPC_URLS, rpcEndpoints } from "./chain.js";
|
|
3
3
|
export { callAbi, calledItAbi, factoryAbi, roundsAbi } from "./abi.js";
|
|
4
4
|
export { canonical, hashJson } from "./canonical.js";
|
|
5
|
-
export { CallsError } from "./errors.js";
|
|
5
|
+
export { CallsError, RECEIPT_UNKNOWN } from "./errors.js";
|
|
6
6
|
export { callTextHash, canonicalPostUrl, normalizeHandle, parsePostUrl, postRefHash, specHash, subjectHash, ZERO_HASH } from "./hashes.js";
|
|
7
|
-
export { DISPUTE_WINDOW, MIN_BET, MIN_OPENER_BOND, PRICE_DISPUTE_WINDOW, RAKE_BPS, ethToWei, multipleOf, odds, payout, quoteOf, type Pools, type Side } from "./odds.js";
|
|
7
|
+
export { DISPUTE_WINDOW, MIN_BET, MIN_OPENER_BOND, PRICE_DISPUTE_WINDOW, RAKE_BPS, ethToWei, multipleOf, odds, payout, quoteOf, roundInPlay, roundPayout, type Pools, type Side } from "./odds.js";
|
|
8
8
|
export type * from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { createClient, accountFromKey, bondIdOf, prepareOpen, roundSideOf, sideO
|
|
|
2
2
|
export { API_URL, CALLED_IT, CHAIN_ID, DEEDS, EXPLORER, FACTORY, PREVIOUS_FACTORIES, RPC_URLS, rpcEndpoints } from "./chain.js";
|
|
3
3
|
export { callAbi, calledItAbi, factoryAbi, roundsAbi } from "./abi.js";
|
|
4
4
|
export { canonical, hashJson } from "./canonical.js";
|
|
5
|
-
export { CallsError } from "./errors.js";
|
|
5
|
+
export { CallsError, RECEIPT_UNKNOWN } from "./errors.js";
|
|
6
6
|
export { callTextHash, canonicalPostUrl, normalizeHandle, parsePostUrl, postRefHash, specHash, subjectHash, ZERO_HASH } from "./hashes.js";
|
|
7
|
-
export { DISPUTE_WINDOW, MIN_BET, MIN_OPENER_BOND, PRICE_DISPUTE_WINDOW, RAKE_BPS, ethToWei, multipleOf, odds, payout, quoteOf } from "./odds.js";
|
|
7
|
+
export { DISPUTE_WINDOW, MIN_BET, MIN_OPENER_BOND, PRICE_DISPUTE_WINDOW, RAKE_BPS, ethToWei, multipleOf, odds, payout, quoteOf, roundInPlay, roundPayout } from "./odds.js";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAwC,MAAM,aAAa,CAAC;AAClL,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChI,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAwC,MAAM,aAAa,CAAC;AAClL,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChI,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3I,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAyB,MAAM,WAAW,CAAC"}
|
package/dist/odds.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export declare const DISPUTE_WINDOW: number;
|
|
|
6
6
|
export declare const PRICE_DISPUTE_WINDOW = 3600;
|
|
7
7
|
/** "0.001" to wei. Anything but a plain decimal amount of ETH is refused rather than guessed at. */
|
|
8
8
|
export declare function ethToWei(value: string, what?: string): bigint;
|
|
9
|
+
/** How much of a stake plays, counted into the pools: only matched stake does, and the rest comes back win or lose. */
|
|
10
|
+
export declare function roundInPlay(stake: bigint, side: bigint, other: bigint): bigint;
|
|
11
|
+
/** What a stake in a round pays if its side wins, counted into the pools, at the fee of a wallet that doesn't hold $SHIPPED: 3% of what plays. */
|
|
12
|
+
export declare function roundPayout(stake: bigint, side: bigint, other: bigint): bigint;
|
|
9
13
|
export type Side = "holds" | "breaks";
|
|
10
14
|
export interface Pools {
|
|
11
15
|
holds: bigint;
|
package/dist/odds.js
CHANGED
|
@@ -13,6 +13,19 @@ export function ethToWei(value, what = "The amount") {
|
|
|
13
13
|
throw new CallsError(`${what} is an amount in ETH, such as 0.001.`, "bad_amount");
|
|
14
14
|
return parseEther(value);
|
|
15
15
|
}
|
|
16
|
+
/** How much of a stake plays, counted into the pools: only matched stake does, and the rest comes back win or lose. */
|
|
17
|
+
export function roundInPlay(stake, side, other) {
|
|
18
|
+
const winning = side + stake;
|
|
19
|
+
return (stake * (winning < other ? winning : other)) / winning;
|
|
20
|
+
}
|
|
21
|
+
/** What a stake in a round pays if its side wins, counted into the pools, at the fee of a wallet that doesn't hold $SHIPPED: 3% of what plays. */
|
|
22
|
+
export function roundPayout(stake, side, other) {
|
|
23
|
+
if (other === 0n)
|
|
24
|
+
return stake;
|
|
25
|
+
const winning = side + stake;
|
|
26
|
+
const matched = winning < other ? winning : other;
|
|
27
|
+
return (stake * (winning + matched - (2n * matched * 300n) / 10000n)) / winning;
|
|
28
|
+
}
|
|
16
29
|
function multiple(winners, losers) {
|
|
17
30
|
if (winners === 0n)
|
|
18
31
|
return losers === 0n ? 1 : null;
|
package/dist/odds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odds.js","sourceRoot":"","sources":["../src/odds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC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,KAAK,EAAE;KAC5D,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -291,6 +291,14 @@ export interface Proof {
|
|
|
291
291
|
} | null;
|
|
292
292
|
} | null;
|
|
293
293
|
software: Record<string, unknown>;
|
|
294
|
+
/** Who holds the keys of Rounds, or null while it isn't running. */
|
|
295
|
+
rounds: {
|
|
296
|
+
guardian: {
|
|
297
|
+
address: Address;
|
|
298
|
+
kind: string | null;
|
|
299
|
+
};
|
|
300
|
+
oracle: Address;
|
|
301
|
+
} | null;
|
|
294
302
|
readAt: number;
|
|
295
303
|
agents: ShippedAgent[];
|
|
296
304
|
}
|
|
@@ -424,7 +432,7 @@ export interface RoundPools {
|
|
|
424
432
|
up: Wei;
|
|
425
433
|
down: Wei;
|
|
426
434
|
bets: number;
|
|
427
|
-
/** What a winning stake
|
|
435
|
+
/** What a winning stake gets back per unit at these pools, its unmatched part included, floored to hundredths; null while either side is empty. */
|
|
428
436
|
upPays: number | null;
|
|
429
437
|
downPays: number | null;
|
|
430
438
|
}
|
|
@@ -442,11 +450,6 @@ export interface RoundResult {
|
|
|
442
450
|
decidedAt: number;
|
|
443
451
|
lockAt: number;
|
|
444
452
|
closeAt: number;
|
|
445
|
-
/** The public candles anyone can open to check the two prices. */
|
|
446
|
-
candles: {
|
|
447
|
-
lock: string;
|
|
448
|
-
close: string;
|
|
449
|
-
};
|
|
450
453
|
txHash: Hash;
|
|
451
454
|
}
|
|
452
455
|
export interface RoundsMarket {
|
|
@@ -464,7 +467,7 @@ export interface RoundsMarket {
|
|
|
464
467
|
}
|
|
465
468
|
export interface RoundsFloor {
|
|
466
469
|
now: number;
|
|
467
|
-
/** False while
|
|
470
|
+
/** False while rounds aren't being priced. A bet then would wait out the hour and refund, so the client refuses it. */
|
|
468
471
|
open: boolean;
|
|
469
472
|
contract: Address;
|
|
470
473
|
interval: number;
|
|
@@ -472,6 +475,15 @@ export interface RoundsFloor {
|
|
|
472
475
|
minBet: Wei;
|
|
473
476
|
maxStake: Wei;
|
|
474
477
|
rakeBps: number;
|
|
478
|
+
terms: {
|
|
479
|
+
holdToken: Address;
|
|
480
|
+
holdMin: Wei;
|
|
481
|
+
holderRakeBps: number;
|
|
482
|
+
cards: Address;
|
|
483
|
+
cardCutBps: number;
|
|
484
|
+
cardStreak: number;
|
|
485
|
+
maxCardCut: Wei;
|
|
486
|
+
} | null;
|
|
475
487
|
markets: RoundsMarket[];
|
|
476
488
|
feed: {
|
|
477
489
|
market: string;
|
|
@@ -495,20 +507,31 @@ export interface RoundsAccount {
|
|
|
495
507
|
played: number;
|
|
496
508
|
wins: number;
|
|
497
509
|
losses: number;
|
|
510
|
+
/** The oldest rounds this wallet can collect, which is what one claim takes. `amount` is what collecting credits; `cut` of it buys $SHIPPED for the wallet when `card` is true. */
|
|
498
511
|
unclaimed: {
|
|
499
512
|
market: string;
|
|
500
513
|
epoch: number;
|
|
501
514
|
amount: Wei;
|
|
515
|
+
cut: Wei;
|
|
516
|
+
streak: number;
|
|
517
|
+
card: boolean;
|
|
502
518
|
}[];
|
|
519
|
+
/** Every round this wallet can collect, listed or not. */
|
|
520
|
+
unclaimedRounds: number;
|
|
503
521
|
unclaimedTotal: Wei;
|
|
522
|
+
cutTotal: Wei;
|
|
523
|
+
shippedBought: Wei;
|
|
524
|
+
holds: boolean;
|
|
525
|
+
plainWins: boolean;
|
|
504
526
|
rounds: {
|
|
505
527
|
market: string;
|
|
506
528
|
epoch: number;
|
|
507
529
|
up: boolean;
|
|
508
530
|
stake: Wei;
|
|
509
531
|
outcome: RoundOutcome | null;
|
|
532
|
+
won: boolean | null;
|
|
510
533
|
payout: Wei | null;
|
|
511
|
-
|
|
534
|
+
card: number | null;
|
|
512
535
|
lockAt: number;
|
|
513
536
|
closeAt: number;
|
|
514
537
|
}[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shippedcalls/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Read and bet on Shipped Calls from code or the command line: ETH markets on whether a public claim holds, on Robinhood Chain.",
|
|
5
5
|
"keywords": ["shipped-calls", "prediction-market", "parimutuel", "robinhood-chain", "agents", "cli"],
|
|
6
6
|
"homepage": "https://calls.shipped.bond/agents",
|
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shipped-calls
|
|
3
|
-
description: Read and bet on Shipped Calls, ETH markets on Robinhood Chain on whether a public claim Holds or Breaks. Use when asked about Calls, Holds, Breaks, calls.shipped.bond, or betting on a post on X, a price, a contract read or a Shipped bond on Robinhood Chain.
|
|
3
|
+
description: Read and bet on Shipped Calls, ETH markets on Robinhood Chain on whether a public claim Holds or Breaks. Use when asked about Calls, Holds, Breaks, calls.shipped.bond, or betting on a post on X, a price, a contract read or a Shipped bond on Robinhood Chain, or about Rounds, five-minute up or down on ETH, BTC and SOL.
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ Reading needs no wallet. Betting needs a funded key in `CALLS_PRIVATE_KEY`, set
|
|
|
17
17
|
3. **Stay inside your budget.** The CLI refuses a bet over 0.01 ETH unless `--max-stake` raises it. Raise it only on your operator's word. If your operator set a budget, respect it across every bet.
|
|
18
18
|
4. **Stop and report when a bet is blocked.** A refusal is one sentence and a code. Tell your operator what it said. Do not retry with other amounts, addresses or settings to get around it.
|
|
19
19
|
5. **Use `--json` on everything,** and read `error` and `code` when the exit is non-zero.
|
|
20
|
-
6. **Never print the key,** and never send ETH anywhere except a Call's contract through these commands.
|
|
20
|
+
6. **Never print the key,** and never send ETH anywhere except a Call's contract or the Rounds contract through these commands.
|
|
21
21
|
|
|
22
22
|
## Commands
|
|
23
23
|
|
|
@@ -32,6 +32,12 @@ scripts/calls.sh bet <address> holds 0.001 --yes --json # place it
|
|
|
32
32
|
scripts/calls.sh positions --json # balance, open positions, what you can claim
|
|
33
33
|
scripts/calls.sh claim <address> --json # collect once the Call is Final or Voided
|
|
34
34
|
scripts/calls.sh proof --json # contracts, roles, rules, totals
|
|
35
|
+
scripts/calls.sh rounds --json # every Rounds market: the round taking bets, the one running
|
|
36
|
+
scripts/calls.sh rounds bet ETH up 0.001 --quote --json # what a stake in a round pays with the pools as they stand
|
|
37
|
+
scripts/calls.sh rounds bet ETH up 0.001 --yes --json # place it
|
|
38
|
+
scripts/calls.sh rounds history --json # streak, record, latest rounds, what you can collect
|
|
39
|
+
scripts/calls.sh rounds claim --json # collect winnings and refunds, oldest 40 rounds at a time
|
|
40
|
+
scripts/calls.sh rounds plain-wins on --json # take every win in ETH, with no card and no $SHIPPED buy
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
Amounts on the command line are ETH. Amounts in answers are wei as decimal strings. Times are unix seconds.
|
package/skill/references/api.md
CHANGED
|
@@ -19,7 +19,12 @@ Amounts are wei as decimal strings. Times are unix seconds. Some routes checksum
|
|
|
19
19
|
| `GET /v1/clips` | The clips Shipped agents made of settled Calls. |
|
|
20
20
|
| `GET /v1/live` | The floor in one read: every Call in play and each decided in the last six hours, with its bets, the price that settled it and the Shipped agents' reasons, plus a feed of what happened. |
|
|
21
21
|
| `GET /v1/proof` | Contracts, roles, rules and totals, read live. |
|
|
22
|
-
| `GET /v1/proof/abi/<name>.json` | ABIs: Call, CallsFactory, CalledIt, CallsCouncil. |
|
|
22
|
+
| `GET /v1/proof/abi/<name>.json` | ABIs: Call, CallsFactory, CalledIt, CallsCouncil, Rounds, RoundCards. |
|
|
23
|
+
| `GET /v1/rounds` | Rounds in one read: every market's round taking bets, the one running, its latest results, the contract and `open`. |
|
|
24
|
+
| `GET /v1/rounds/board` | `window`: today (default), week. Top wallets by profit and by streak. |
|
|
25
|
+
| `GET /v1/rounds/<market>` | One market. |
|
|
26
|
+
| `GET /v1/rounds/<market>/<epoch>` | One round: pools, prices, result, every bet. |
|
|
27
|
+
| `GET /v1/accounts/<address>/rounds` | One wallet's streak, record, latest rounds, what it can collect and its daily limit. |
|
|
23
28
|
| `GET /v1/schemas/<type>.json` | The JSON Schema of an evidence spec: posted, onchain, price, deed. |
|
|
24
29
|
| `GET /v1` | The list of routes. |
|
|
25
30
|
| `GET /healthz` | Whether the services are up, and `postCalls`, whether Post Calls can be opened. |
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# Rounds
|
|
2
2
|
|
|
3
|
-
Five minutes, up or down, on ETH, BTC and SOL, around the clock. You stake ETH on Up or Down before a round locks. Five minutes after the lock, the price decides and
|
|
3
|
+
Five minutes, up or down, on ETH, BTC and SOL, around the clock. You stake ETH on Up or Down before a round locks. Five minutes after the lock, the price decides. Only matched stake plays, and a win pays it back 1.94 times.
|
|
4
4
|
|
|
5
5
|
## How a round runs
|
|
6
6
|
|
|
7
7
|
- Epoch `e = floor(unix seconds / 300)` takes bets until ten seconds before `(e + 1) * 300`, locks there, and closes at `(e + 2) * 300`.
|
|
8
8
|
- Close above lock, Up wins. Close below lock, Down wins.
|
|
9
9
|
- A tie, or a round with money on one side only, refunds everyone with no fee.
|
|
10
|
-
- The
|
|
10
|
+
- Only matched stake plays. The smaller side's total plays against the same amount from the larger side, and the larger side's excess comes back to its wallets pro rata, win or lose.
|
|
11
|
+
- The fee is 3% of what plays, so a fully matched win pays 1.94 times the stake and a holder's pays 1.97 times.
|
|
11
12
|
- A wallet stakes 0.001 to 0.5 ETH in a round, on one side, and may add to it.
|
|
12
|
-
-
|
|
13
|
-
-
|
|
13
|
+
- The lock and close prices are Pyth's first signed price at or after each moment. Pyth's contract checks every one onchain and anyone can post them, so Shipped can't choose a result. If a round goes an hour without its prices, anyone can void it, which refunds every stake.
|
|
14
|
+
- Close to the lock, a Shipped agent may match up to 0.005 ETH of a stake that's alone in a round, and the rest comes back.
|
|
15
|
+
- Three or more wins in a row, across markets with refunds ignored, earns a card: an NFT minted to the winner when they collect. 10% of that win's profit buys $SHIPPED for them in the same transaction, up to 0.05 ETH on one Collect. If the buy fails, they get it in ETH.
|
|
16
|
+
- A wallet holding 1,000,000 $SHIPPED at its first bet in a round and again when it collects pays 1.5% on its share of that round instead of 3%. `terms.holdMin` in `GET /v1/rounds` is the current amount.
|
|
14
17
|
|
|
15
18
|
## Reading
|
|
16
19
|
|
|
@@ -23,7 +26,9 @@ GET /v1/rounds/{market}/{epoch}/card/{address}.png a wallet's result as a shar
|
|
|
23
26
|
GET /v1/accounts/{address}/rounds streak, today's stake and profit, what it can collect, its limit
|
|
24
27
|
```
|
|
25
28
|
|
|
26
|
-
While `open` is false
|
|
29
|
+
While `open` is false rounds aren't being priced, so don't bet: the stake would wait out the hour and refund. In the last ten seconds before a lock, `betting` still names the round that has stopped taking bets: its `cutoffAt` is in the past, and the next round opens at the lock.
|
|
30
|
+
|
|
31
|
+
`unclaimed` in the account route lists the oldest 40 rounds, which is what one claim takes. `unclaimedRounds` counts all of them.
|
|
27
32
|
|
|
28
33
|
## Writing
|
|
29
34
|
|
|
@@ -31,17 +36,21 @@ The contract's address is `contract` in `GET /v1/rounds`.
|
|
|
31
36
|
|
|
32
37
|
- `bet(bytes32 market, bool up)` with the stake as the value. `market` is the symbol as left-aligned bytes32.
|
|
33
38
|
- `claim(bytes32[] markets, uint256[] epochs)` collects winnings and refunds. `unclaimed` in the account route lists what to pass.
|
|
39
|
+
- `setPlainWins(bool plain)` takes every win in ETH, with no card and no buy.
|
|
34
40
|
- `setLimit(uint256 cap)` sets the wallet's own daily stake limit. Lowering it applies at once; raising or removing it takes 24 hours.
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
`claim` also hands a losing wallet its unmatched stake.
|
|
43
|
+
|
|
44
|
+
From the CLI: `calls rounds bet ETH up 0.001 --yes`, `calls rounds claim`, `calls rounds plain-wins on` and `calls rounds limit 0.01`. From the SDK: `rounds.quote("ETH", "up", amount)`, `rounds.bet("ETH", "up", amount)`, `rounds.claim()`, `rounds.setPlainWins(true)` and `rounds.setLimit(cap)`. From MCP: `rounds_bet`, `rounds_claim` and `rounds_plain_wins`.
|
|
37
45
|
|
|
38
46
|
## Errors
|
|
39
47
|
|
|
40
48
|
| Error | Meaning |
|
|
41
49
|
| - | - |
|
|
42
|
-
| `TooLate` | The round has stopped taking bets. The next one
|
|
50
|
+
| `TooLate` | The round has stopped taking bets. The next one opens at the lock, within ten seconds. |
|
|
43
51
|
| `BelowMinimum` | The minimum is 0.001 ETH. |
|
|
44
52
|
| `OverStakeCap` | One wallet can stake up to 0.5 ETH in a round. |
|
|
45
53
|
| `OverDailyLimit` | This would pass the daily limit the wallet set for itself. |
|
|
46
54
|
| `OtherSide` | The wallet is already on the other side of this round. |
|
|
47
55
|
| `MarketPaused` | This market isn't taking bets right now. |
|
|
56
|
+
| `GasTooLow` | A win's card and buy need more gas. Send at least the estimate. |
|
|
@@ -66,3 +66,7 @@ calls open --text "Shipped bond #1 is accepted by its deadline." --bond-number 1
|
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
`calls open` does both steps, checks the API's hashes against its own before it spends anything, and reads a bond Call's deadline from Shipped's registry.
|
|
69
|
+
|
|
70
|
+
## Rounds
|
|
71
|
+
|
|
72
|
+
Rounds has its own contract and its own write path: see `references/rounds.md`.
|
package/skill/scripts/calls.sh
CHANGED