@percolatortool/sdk 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 +29 -4
- package/package.json +19 -2
package/README.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# @percolatortool/sdk
|
|
2
2
|
|
|
3
|
-
TypeScript types and instruction builders
|
|
3
|
+
TypeScript SDK for building on top of **Percolator** — [Anatoly Yakovenko (@aeyakovenko)](https://x.com/aeyakovenko)'s risk engine for perpetual DEXs on Solana. This package provides types and instruction builders so you can build wrapper programs and frontends (deposits, withdrawals, trades, keeper crank) without reimplementing the wire format.
|
|
4
|
+
|
|
5
|
+
## What is Percolator?
|
|
6
|
+
|
|
7
|
+
[Percolator](https://github.com/aeyakovenko/percolator) is an on-chain risk engine for perpetual futures: it handles margin, funding, liquidations, and PnL in a single program. Wrappers (separate programs or frontends) call into it to open/close positions, run keeper cranks, and manage vault/insurance. This SDK was built as part of the **Percolator tooling and audit** so that integrators can quickly build wrappers and bots without hand-rolling instruction layouts.
|
|
8
|
+
|
|
9
|
+
## What this SDK is for
|
|
10
|
+
|
|
11
|
+
- **Wrapper builders** — Build a Solana program that uses Percolator as the risk layer; use the SDK to encode `deposit`, `withdraw`, `execute_trade`, and `keeper_crank` instruction data.
|
|
12
|
+
- **Frontends & bots** — Compose transactions that invoke your wrapper (and thus Percolator) with correctly formatted instruction data.
|
|
13
|
+
- **Keepers** — The [percolator-tools keeper](https://github.com/aeyakovenko/percolator/tree/main/percolator-tools/keeper) can use this SDK for full types; it also ships with an inline crank builder so it works standalone.
|
|
4
14
|
|
|
5
15
|
## Install
|
|
6
16
|
|
|
7
17
|
```bash
|
|
8
18
|
npm install @percolatortool/sdk
|
|
9
|
-
# or
|
|
19
|
+
# or
|
|
20
|
+
pnpm add @percolatortool/sdk
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
From the repo (monorepo or local path):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
10
26
|
npm install ./path/to/percolator-tools/sdk
|
|
11
27
|
```
|
|
12
28
|
|
|
@@ -39,8 +55,17 @@ const crankData = buildKeeperCrankInstructionData({
|
|
|
39
55
|
});
|
|
40
56
|
```
|
|
41
57
|
|
|
42
|
-
Then pass `depositData` / `crankData` as the `data` for a `TransactionInstruction` to your wrapper program ID.
|
|
58
|
+
Then pass `depositData` / `crankData` as the `data` for a `TransactionInstruction` to your **wrapper** program ID (your wrapper then forwards to Percolator as defined by its IDL).
|
|
43
59
|
|
|
44
|
-
##
|
|
60
|
+
## Important note
|
|
45
61
|
|
|
46
62
|
Instruction **layout** (discriminators, field order) is defined by your **wrapper** program. This SDK uses a minimal layout; if your wrapper uses Anchor or a different layout, adapt the builders or use this as reference.
|
|
63
|
+
|
|
64
|
+
## Links
|
|
65
|
+
|
|
66
|
+
- **Percolator (risk engine):** [github.com/aeyakovenko/percolator](https://github.com/aeyakovenko/percolator)
|
|
67
|
+
- **Percolator tools (SDK, keeper, dashboard):** [percolator-tools](https://github.com/aeyakovenko/percolator/tree/main/percolator-tools) in the same repo
|
|
68
|
+
|
|
69
|
+
## Credits
|
|
70
|
+
|
|
71
|
+
SDK and Percolator tooling (dashboard, keeper) by [**@YOUR_X_HANDLE**](https://x.com/YOUR_X_HANDLE) as part of the Percolator audit and ecosystem tooling. Percolator itself by [Anatoly Yakovenko (@aeyakovenko)](https://x.com/aeyakovenko).
|
package/package.json
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percolatortool/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "TypeScript SDK for Percolator wrapper
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "TypeScript SDK for Percolator — types and instruction builders (deposit, withdraw, trade, keeper crank) for wrapper programs and frontends on Solana. Built for the Percolator audit and ecosystem tooling.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/aeyakovenko/percolator.git",
|
|
10
|
+
"directory": "percolator-tools/sdk"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/aeyakovenko/percolator/tree/main/percolator-tools/sdk#readme",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"percolator",
|
|
15
|
+
"solana",
|
|
16
|
+
"perpetual",
|
|
17
|
+
"dex",
|
|
18
|
+
"risk-engine",
|
|
19
|
+
"wrapper",
|
|
20
|
+
"keeper"
|
|
21
|
+
],
|
|
22
|
+
"author": "https://x.com/YOUR_X_HANDLE",
|
|
23
|
+
"license": "MIT",
|
|
7
24
|
"devDependencies": {
|
|
8
25
|
"@types/node": "^20.10.0",
|
|
9
26
|
"typescript": "^5.0.0"
|