@thetanuts-finance/odette-cli 0.1.0 → 0.1.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 +6 -34
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Odette
|
|
1
|
+
# Odette CLI
|
|
2
2
|
|
|
3
|
-
Buy Odette options on Base from your terminal
|
|
3
|
+
Buy Odette options on Base from your terminal: `odette`.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Building a bot or an app instead? Use the SDK,
|
|
6
|
+
[`@thetanuts-finance/odette-sdk`](https://www.npmjs.com/package/@thetanuts-finance/odette-sdk).
|
|
7
7
|
|
|
8
8
|
Odette runs on Thetanuts Finance contracts on Base. You sign every trade with your
|
|
9
9
|
own wallet. No trade goes through a server: `odette` only reads the public order
|
|
@@ -115,38 +115,10 @@ output the premium is the `totalCollateral` field (the name upstream uses).
|
|
|
115
115
|
Exit codes for scripts: `0` ok, `1` the trade or a check failed, `2` a wrong command or flag,
|
|
116
116
|
`3` you said no, `4` a wallet or config problem.
|
|
117
117
|
|
|
118
|
-
## For developers: the SDK
|
|
119
|
-
|
|
120
|
-
```sh
|
|
121
|
-
npm install @thetanuts-finance/odette-sdk ethers
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
import { JsonRpcProvider, Wallet } from 'ethers';
|
|
126
|
-
import { OdetteClient } from '@thetanuts-finance/odette-sdk';
|
|
127
|
-
|
|
128
|
-
const provider = new JsonRpcProvider('https://mainnet.base.org');
|
|
129
|
-
const signer = new Wallet(process.env.ODETTE_PRIVATE_KEY!, provider);
|
|
130
|
-
const client = new OdetteClient({ provider, signer });
|
|
131
|
-
|
|
132
|
-
const orders = await client.api.fetchOrders();
|
|
133
|
-
const order = orders.find((o) => o.product === 'PUT' && o.underlying === 'ETH')!;
|
|
134
|
-
|
|
135
|
-
const usdc = 5_000000n; // 5 USDC (USDC has 6 decimals)
|
|
136
|
-
const preview = client.optionBook.previewFillOrder(order, usdc);
|
|
137
|
-
const checks = await client.optionBook.checkFill(order, usdc); // reads only, never sends
|
|
138
|
-
|
|
139
|
-
await client.erc20.ensureAllowance(preview.collateralToken, preview.optionBook, preview.totalCollateral);
|
|
140
|
-
const receipt = await client.optionBook.fillOrder(order, usdc); // refuses if a check fails
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Amounts: USDC and contract sizes have 6 decimals. Prices and strikes are in USD with 8 decimals.
|
|
144
|
-
The amount you pass is the USDC you want to spend, not a number of contracts.
|
|
145
|
-
|
|
146
118
|
## Good to know
|
|
147
119
|
|
|
148
120
|
- **Base only** (chain 8453).
|
|
149
|
-
- **Found a security problem?** Don't open a public issue. See
|
|
121
|
+
- **Found a security problem?** Don't open a public issue. See [SECURITY.md](https://github.com/Shawnchee/odette-sdk/blob/main/SECURITY.md).
|
|
150
122
|
- **Every trade is tagged with Odette's referrer**, `0x94D784e81A5c8cA6E19629C73217b61a256Ea1c7`.
|
|
151
123
|
You can't change it in these tools. The contract itself does not enforce the tag.
|
|
152
124
|
- Orders and contracts come from Thetanuts Finance. Odette is the app on top.
|
|
@@ -154,4 +126,4 @@ The amount you pass is the USDC you want to spend, not a number of contracts.
|
|
|
154
126
|
## License
|
|
155
127
|
|
|
156
128
|
MIT, Copyright (c) 2026 Thetanuts Finance. Parts are adapted from
|
|
157
|
-
[thetanuts-sdk](https://github.com/Thetanuts-Finance/thetanuts-sdk); see
|
|
129
|
+
[thetanuts-sdk](https://github.com/Thetanuts-Finance/thetanuts-sdk); see [NOTICE.md](https://github.com/Shawnchee/odette-sdk/blob/main/NOTICE.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thetanuts-finance/odette-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Odette command-line interface. Buy Odette options on Base from a terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=20.0.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@thetanuts-finance/odette-sdk": "0.1.
|
|
44
|
+
"@thetanuts-finance/odette-sdk": "0.1.1",
|
|
45
45
|
"cli-table3": "0.6.5",
|
|
46
46
|
"commander": "12.1.0",
|
|
47
47
|
"ethers": "^6.16.0",
|