@varla/sdk 1.11.4 → 1.13.2
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/AGENTS.md +82 -95
- package/CHANGELOG.md +359 -0
- package/README.md +227 -275
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js +1 -0
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js.map +1 -0
- package/dist/abi/full/OracleUpdaterRouter.d.ts +30 -9
- package/dist/abi/full/OracleUpdaterRouter.d.ts.map +1 -1
- package/dist/abi/full/OracleUpdaterRouter.js +37 -9
- package/dist/abi/full/OracleUpdaterRouter.js.map +1 -0
- package/dist/abi/full/PolymarketCtfAdapter.js +1 -0
- package/dist/abi/full/PolymarketCtfAdapter.js.map +1 -0
- package/dist/abi/full/VarlaAccessManager.js +1 -0
- package/dist/abi/full/VarlaAccessManager.js.map +1 -0
- package/dist/abi/full/VarlaConvertLiquidator.js +1 -0
- package/dist/abi/full/VarlaConvertLiquidator.js.map +1 -0
- package/dist/abi/full/VarlaCore.js +1 -0
- package/dist/abi/full/VarlaCore.js.map +1 -0
- package/dist/abi/full/VarlaInterestRateStrategy.js +1 -0
- package/dist/abi/full/VarlaInterestRateStrategy.js.map +1 -0
- package/dist/abi/full/VarlaLiquidator.d.ts +1 -1
- package/dist/abi/full/VarlaLiquidator.js +2 -1
- package/dist/abi/full/VarlaLiquidator.js.map +1 -0
- package/dist/abi/full/VarlaMergeLiquidator.js +1 -0
- package/dist/abi/full/VarlaMergeLiquidator.js.map +1 -0
- package/dist/abi/full/VarlaOracle.js +1 -0
- package/dist/abi/full/VarlaOracle.js.map +1 -0
- package/dist/abi/full/VarlaPool.js +1 -0
- package/dist/abi/full/VarlaPool.js.map +1 -0
- package/dist/abi/full/VarlaProxyAdmin.js +1 -0
- package/dist/abi/full/VarlaProxyAdmin.js.map +1 -0
- package/dist/abi/index.js +1 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/abi/subsets/VarlaOracle.registry.js +1 -0
- package/dist/abi/subsets/VarlaOracle.registry.js.map +1 -0
- package/dist/abi.js +1 -0
- package/dist/abi.js.map +1 -0
- package/dist/actions/admin.js +1 -0
- package/dist/actions/admin.js.map +1 -0
- package/dist/actions/core.js +1 -0
- package/dist/actions/core.js.map +1 -0
- package/dist/actions/erc1155.js +1 -0
- package/dist/actions/erc1155.js.map +1 -0
- package/dist/actions/erc20.js +1 -0
- package/dist/actions/erc20.js.map +1 -0
- package/dist/actions/index.d.ts +7 -7
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +8 -7
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/liquidator.js +1 -0
- package/dist/actions/liquidator.js.map +1 -0
- package/dist/actions/oracle.d.ts +1 -2
- package/dist/actions/oracle.d.ts.map +1 -1
- package/dist/actions/oracle.js +1 -0
- package/dist/actions/oracle.js.map +1 -0
- package/dist/actions/oracleUpdaterRouter.d.ts +8 -1
- package/dist/actions/oracleUpdaterRouter.d.ts.map +1 -1
- package/dist/actions/oracleUpdaterRouter.js +14 -1
- package/dist/actions/oracleUpdaterRouter.js.map +1 -0
- package/dist/actions/pool.js +1 -0
- package/dist/actions/pool.js.map +1 -0
- package/dist/actions/rbac.js +1 -0
- package/dist/actions/rbac.js.map +1 -0
- package/dist/actions/tx.js +1 -0
- package/dist/actions/tx.js.map +1 -0
- package/dist/actions/utils.js +1 -0
- package/dist/actions/utils.js.map +1 -0
- package/dist/addresses/bsc.js +1 -0
- package/dist/addresses/bsc.js.map +1 -0
- package/dist/addresses/index.js +1 -0
- package/dist/addresses/index.js.map +1 -0
- package/dist/addresses/polygon.js +1 -0
- package/dist/addresses/polygon.js.map +1 -0
- package/dist/addresses.js +1 -0
- package/dist/addresses.js.map +1 -0
- package/dist/batch.js +1 -0
- package/dist/batch.js.map +1 -0
- package/dist/contracts.d.ts +1 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +2 -2
- package/dist/contracts.js.map +1 -0
- package/dist/errors.d.ts +87 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +240 -0
- package/dist/errors.js.map +1 -0
- package/dist/events/decode.js +1 -0
- package/dist/events/decode.js.map +1 -0
- package/dist/events/defs.js +1 -0
- package/dist/events/defs.js.map +1 -0
- package/dist/events/index.d.ts +3 -3
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -3
- package/dist/events/index.js.map +1 -0
- package/dist/events/logs.js +1 -0
- package/dist/events/logs.js.map +1 -0
- package/dist/events/oracleRegistrySync.js +1 -0
- package/dist/events/oracleRegistrySync.js.map +1 -0
- package/dist/events/recent.d.ts +1 -1
- package/dist/events/recent.d.ts.map +1 -1
- package/dist/events/recent.js +2 -1
- package/dist/events/recent.js.map +1 -0
- package/dist/format.js +1 -0
- package/dist/format.js.map +1 -0
- package/dist/generated.d.ts +31 -10
- package/dist/generated.d.ts.map +1 -1
- package/dist/generated.js +1 -0
- package/dist/generated.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -0
- package/dist/leverage/deleverageExecute.d.ts +36 -0
- package/dist/leverage/deleverageExecute.d.ts.map +1 -0
- package/dist/leverage/deleverageExecute.js +53 -0
- package/dist/leverage/deleverageExecute.js.map +1 -0
- package/dist/leverage/execute.d.ts +62 -0
- package/dist/leverage/execute.d.ts.map +1 -0
- package/dist/leverage/execute.js +84 -0
- package/dist/leverage/execute.js.map +1 -0
- package/dist/leverage/index.d.ts +32 -0
- package/dist/leverage/index.d.ts.map +1 -0
- package/dist/leverage/index.js +12 -0
- package/dist/leverage/index.js.map +1 -0
- package/dist/leverage/math.d.ts +119 -0
- package/dist/leverage/math.d.ts.map +1 -0
- package/dist/leverage/math.js +304 -0
- package/dist/leverage/math.js.map +1 -0
- package/dist/leverage/plan.d.ts +143 -0
- package/dist/leverage/plan.d.ts.map +1 -0
- package/dist/leverage/plan.js +204 -0
- package/dist/leverage/plan.js.map +1 -0
- package/dist/leverage/preflight.d.ts +27 -0
- package/dist/leverage/preflight.d.ts.map +1 -0
- package/dist/leverage/preflight.js +34 -0
- package/dist/leverage/preflight.js.map +1 -0
- package/dist/leverage/types.d.ts +157 -0
- package/dist/leverage/types.d.ts.map +1 -0
- package/dist/leverage/types.js +43 -0
- package/dist/leverage/types.js.map +1 -0
- package/dist/meta.d.ts +42 -0
- package/dist/meta.d.ts.map +1 -0
- package/dist/meta.js +47 -0
- package/dist/meta.js.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/views/accessManager.js +1 -0
- package/dist/views/accessManager.js.map +1 -0
- package/dist/views/adapters.js +1 -0
- package/dist/views/adapters.js.map +1 -0
- package/dist/views/admin.d.ts.map +1 -1
- package/dist/views/admin.js +1 -0
- package/dist/views/admin.js.map +1 -0
- package/dist/views/core.d.ts.map +1 -1
- package/dist/views/core.js +1 -0
- package/dist/views/core.js.map +1 -0
- package/dist/views/index.d.ts +5 -5
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +6 -5
- package/dist/views/index.js.map +1 -0
- package/dist/views/lenders.js +1 -0
- package/dist/views/lenders.js.map +1 -0
- package/dist/views/liquidators.js +1 -0
- package/dist/views/liquidators.js.map +1 -0
- package/dist/views/oracle.js +1 -0
- package/dist/views/oracle.js.map +1 -0
- package/dist/views/pool.js +1 -0
- package/dist/views/pool.js.map +1 -0
- package/dist/views/system.d.ts.map +1 -1
- package/dist/views/system.js +1 -0
- package/dist/views/system.js.map +1 -0
- package/package.json +18 -5
- package/src/abi/README.md +17 -0
- package/src/abi/full/OpinionCtfExecutionEngineAdapter.ts +320 -0
- package/src/abi/full/OracleUpdaterRouter.ts +528 -0
- package/src/abi/full/PolymarketCtfAdapter.ts +312 -0
- package/src/abi/full/VarlaAccessManager.ts +1171 -0
- package/src/abi/full/VarlaConvertLiquidator.ts +834 -0
- package/src/abi/full/VarlaCore.ts +2277 -0
- package/src/abi/full/VarlaInterestRateStrategy.ts +442 -0
- package/src/abi/full/VarlaLiquidator.ts +914 -0
- package/src/abi/full/VarlaMergeLiquidator.ts +797 -0
- package/src/abi/full/VarlaOracle.ts +1825 -0
- package/src/abi/full/VarlaPool.ts +1637 -0
- package/src/abi/full/VarlaProxyAdmin.ts +301 -0
- package/src/abi/index.ts +17 -0
- package/src/abi/subsets/VarlaOracle.registry.ts +784 -0
- package/src/abi.ts +2 -0
- package/src/actions/admin.ts +357 -0
- package/src/actions/core.ts +68 -0
- package/src/actions/erc1155.ts +22 -0
- package/src/actions/erc20.ts +22 -0
- package/src/actions/index.ts +13 -0
- package/src/actions/liquidator.ts +76 -0
- package/src/actions/oracle.ts +618 -0
- package/src/actions/oracleUpdaterRouter.ts +233 -0
- package/src/actions/pool.ts +76 -0
- package/src/actions/rbac.ts +72 -0
- package/src/actions/tx.ts +16 -0
- package/src/actions/utils.ts +15 -0
- package/src/addresses/README.md +17 -0
- package/src/addresses/bsc.json +16 -0
- package/src/addresses/bsc.ts +15 -0
- package/src/addresses/index.ts +6 -0
- package/src/addresses/polygon.json +16 -0
- package/src/addresses/polygon.ts +15 -0
- package/src/addresses.ts +2 -0
- package/src/batch.ts +55 -0
- package/src/contracts.ts +232 -0
- package/src/errors.ts +305 -0
- package/src/events/decode.ts +37 -0
- package/src/events/defs.ts +70 -0
- package/src/events/index.ts +7 -0
- package/src/events/logs.ts +42 -0
- package/src/events/oracleRegistrySync.ts +206 -0
- package/src/events/recent.ts +39 -0
- package/src/format.ts +121 -0
- package/src/generated.ts +27 -0
- package/src/index.ts +18 -0
- package/src/leverage/deleverageExecute.ts +111 -0
- package/src/leverage/execute.ts +172 -0
- package/src/leverage/index.ts +88 -0
- package/src/leverage/math.ts +446 -0
- package/src/leverage/plan.ts +356 -0
- package/src/leverage/preflight.ts +63 -0
- package/src/leverage/types.ts +204 -0
- package/src/meta.ts +82 -0
- package/src/types.ts +25 -0
- package/src/views/accessManager.ts +286 -0
- package/src/views/adapters.ts +27 -0
- package/src/views/admin.ts +92 -0
- package/src/views/core.ts +1370 -0
- package/src/views/index.ts +11 -0
- package/src/views/lenders.ts +65 -0
- package/src/views/liquidators.ts +227 -0
- package/src/views/oracle.ts +739 -0
- package/src/views/pool.ts +277 -0
- package/src/views/system.ts +42 -0
- package/BACKEND.md +0 -405
- package/FRONTEND.md +0 -485
package/README.md
CHANGED
|
@@ -1,390 +1,342 @@
|
|
|
1
1
|
# @varla/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TypeScript SDK for **Varla Protocol** — lending and risk infrastructure for prediction markets.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- contract **ABIs**
|
|
7
|
-
- per-chain deployed **addresses**
|
|
8
|
-
- shared **types** used by Varla offchain services and apps
|
|
5
|
+
Provides contract ABIs, deployed addresses, typed viem bindings, read-only view helpers, simulate-first write actions, leverage planning, error decoding, and formatting utilities.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
**Supported chains:** Polygon (Polymarket) · BSC (Opinion)
|
|
8
|
+
|
|
9
|
+
---
|
|
12
10
|
|
|
13
11
|
## Install
|
|
14
12
|
|
|
15
13
|
```bash
|
|
16
|
-
# bun
|
|
17
14
|
bun add @varla/sdk
|
|
18
|
-
|
|
19
|
-
# npm
|
|
15
|
+
# or
|
|
20
16
|
npm i @varla/sdk
|
|
21
17
|
```
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
**Peer dependency:** [`viem`](https://viem.sh) `^2.0.0`
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
---
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
- [Backend integration](./BACKEND.md)
|
|
23
|
+
## Subpath imports
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
| Import | Description |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `@varla/sdk` | Core: contracts, views, actions, events, batch, format — everything re-exported |
|
|
28
|
+
| `@varla/sdk/views` | Read-only on-chain queries (account, pool, oracle, system) |
|
|
29
|
+
| `@varla/sdk/actions` | Simulate-first write helpers (deposit, borrow, repay, liquidate, oracle config…) |
|
|
30
|
+
| `@varla/sdk/events` | Event log fetching, decoding, and oracle registry sync |
|
|
31
|
+
| `@varla/sdk/contracts` | Typed viem contract instances (`getVarlaContracts`) |
|
|
32
|
+
| `@varla/sdk/abi` | Raw ABI constants for all deployed contracts |
|
|
33
|
+
| `@varla/sdk/addresses` | Per-chain deployed address books (`polygon`, `bsc`) |
|
|
34
|
+
| `@varla/sdk/errors` | Custom error decoding across all Varla contracts |
|
|
35
|
+
| `@varla/sdk/leverage` | Leverage loop planning, execution, and deleverage |
|
|
36
|
+
| `@varla/sdk/batch` | Multicall chunking utilities for RPC-efficient reads |
|
|
37
|
+
| `@varla/sdk/format` | Number formatting (`formatWad`, `formatBps`, `parseUnits`) |
|
|
38
|
+
| `@varla/sdk/types` | Shared types (`ChainKey`, `AddressBook`) |
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
```ts
|
|
41
|
+
import { getVarlaContracts } from "@varla/sdk/contracts";
|
|
42
|
+
import * as views from "@varla/sdk/views";
|
|
43
|
+
import * as actions from "@varla/sdk/actions";
|
|
44
|
+
```
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
---
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
# Primary suite: regenerate artifacts + build + run bun tests (includes RPC-backed integration tests)
|
|
38
|
-
bun test
|
|
48
|
+
## Quick start
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
```ts
|
|
51
|
+
import { createPublicClient, http } from "viem";
|
|
52
|
+
import { polygon } from "viem/chains";
|
|
53
|
+
import { getVarlaContracts } from "@varla/sdk/contracts";
|
|
54
|
+
import * as views from "@varla/sdk/views";
|
|
42
55
|
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
const client = createPublicClient({
|
|
57
|
+
chain: polygon,
|
|
58
|
+
transport: http(process.env.POLYGON_RPC_URL!),
|
|
59
|
+
});
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
bun run test:smoke
|
|
61
|
+
const c = getVarlaContracts({ chain: "polygon", client });
|
|
48
62
|
```
|
|
49
63
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
By default, RPC-backed tests use public endpoints with fallback & retries.
|
|
53
|
-
For more reliability (recommended in CI), set:
|
|
64
|
+
---
|
|
54
65
|
|
|
55
|
-
-
|
|
56
|
-
- `BSC_RPC_URL`
|
|
66
|
+
## Reading on-chain data
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
set explicit RPC URLs via env.
|
|
68
|
+
All view helpers are async functions that accept a typed viem contract instance and return plain objects.
|
|
60
69
|
|
|
61
|
-
###
|
|
70
|
+
### Lender / pool views
|
|
62
71
|
|
|
63
72
|
```ts
|
|
64
|
-
|
|
73
|
+
// Pool rates, utilization, and APY
|
|
74
|
+
const rates = await views.readPoolRates({ pool: c.pool });
|
|
65
75
|
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
```
|
|
76
|
+
// Pool health score (utilization-based safety signal)
|
|
77
|
+
const health = await views.readPoolHealthScore({ pool: c.pool });
|
|
78
|
+
// → { kind: "ok", utilizationWad, scoreBps } or { kind: "no-liquidity" }
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
// Share price (assets per share, WAD precision)
|
|
81
|
+
const price = await views.readPoolSharePrice({ pool: c.pool });
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
// Full pool snapshot (caps, accounting, rates, share price)
|
|
84
|
+
const poolSnap = await views.readPoolSnapshot({ pool: c.pool });
|
|
75
85
|
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
//
|
|
86
|
+
// User's lender position: shares, current value, max withdrawable
|
|
87
|
+
const lender = await views.readLenderSnapshot({ pool: c.pool, user: "0x..." });
|
|
88
|
+
// → { shares, assets, maxWithdrawAssets, maxRedeemShares }
|
|
79
89
|
```
|
|
80
90
|
|
|
81
|
-
###
|
|
91
|
+
### Borrower / core views
|
|
82
92
|
|
|
83
93
|
```ts
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
// Full account overview: positions, debt, health factor, borrow limits
|
|
95
|
+
const account = await views.readAccountSnapshot({ core: c.core, user: "0x..." });
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
// Just borrow limits + health factor
|
|
98
|
+
const limits = await views.readBorrowLimits({ core: c.core, user: "0x..." });
|
|
88
99
|
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
// Health factor (liquidation threshold check)
|
|
101
|
+
const hf = await views.readHealthFactor({ core: c.core, user: "0x..." });
|
|
102
|
+
// → { healthFactor, canBeLiquidated }
|
|
91
103
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
import { getVarlaContracts } from "@varla/sdk";
|
|
96
|
-
|
|
97
|
-
const client = createPublicClient({
|
|
98
|
-
chain: polygon,
|
|
99
|
-
transport: http(process.env.POLYGON_RPC_URL!),
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const c = getVarlaContracts({ chain: "polygon", client });
|
|
104
|
+
// LTV tier configuration
|
|
105
|
+
const tiers = await views.readTieredLtvConfig({ core: c.core });
|
|
106
|
+
// → { tier0, tier1, tier2 } (CONSERVATIVE / MODERATE / RISK)
|
|
103
107
|
|
|
104
|
-
//
|
|
105
|
-
const
|
|
106
|
-
const hf = await c.core.read.getHealthFactor(["0xYourUserAddress"]); // note viem args are arrays
|
|
108
|
+
// Effective LTV for a specific position
|
|
109
|
+
const ltv = await views.readLtvForPosition({ core: c.core, positionId: 123n });
|
|
107
110
|
```
|
|
108
111
|
|
|
109
|
-
###
|
|
110
|
-
|
|
111
|
-
These are convenience helpers built on top of the contract bindings.
|
|
112
|
-
|
|
113
|
-
<!-- BEGIN GENERATED:VIEW_HELPERS -->
|
|
114
|
-
- `getInterestRateStrategyFromPool`
|
|
115
|
-
- `hydrateOraclePositionIds`
|
|
116
|
-
- `previewBorrow`
|
|
117
|
-
- `previewRepay`
|
|
118
|
-
- `readAccessManagerBasics`
|
|
119
|
-
- `readAccountPositions`
|
|
120
|
-
- `readAccountPositionsFull`
|
|
121
|
-
- `readAccountSnapshot`
|
|
122
|
-
- `readAdapterInfo`
|
|
123
|
-
- `readBadDebtStatus`
|
|
124
|
-
- `readBorrowLimits`
|
|
125
|
-
- `readBorrowerState`
|
|
126
|
-
- `readBorrowers`
|
|
127
|
-
- `readBorrowersPage`
|
|
128
|
-
- `readCalculateLiquidationBonus`
|
|
129
|
-
- `readCanLiquidate`
|
|
130
|
-
- `readConfiguredPositionIds`
|
|
131
|
-
- `readConvertLiquidatorBasics`
|
|
132
|
-
- `readCoreAddresses`
|
|
133
|
-
- `readCoreGlobalDebt`
|
|
134
|
-
- `readDefaultLtvConfig`
|
|
135
|
-
- `readHasRole`
|
|
136
|
-
- `readHealthFactor`
|
|
137
|
-
- `readHypotheticalBorrowCapacity`
|
|
138
|
-
- `readInterestRateStrategyBasics`
|
|
139
|
-
- `readLenderSnapshot`
|
|
140
|
-
- `readLiquidationBonusBps`
|
|
141
|
-
- `readLiquidationConfig`
|
|
142
|
-
- `readLiquidationParamsForPosition`
|
|
143
|
-
- `readLiquidatorBasics`
|
|
144
|
-
- `readLiquidity`
|
|
145
|
-
- `readLtvForPosition`
|
|
146
|
-
- `readManyAccountSnapshots`
|
|
147
|
-
- `readManyBorrowLimits`
|
|
148
|
-
- `readManyHasRole`
|
|
149
|
-
- `readManyLiquidationBonusBps`
|
|
150
|
-
- `readManyOraclePositionMeta`
|
|
151
|
-
- `readManyPositionSnapshots`
|
|
152
|
-
- `readManyTargetConfigs`
|
|
153
|
-
- `readManyTargetFunctionRoles`
|
|
154
|
-
- `readMaxPositionsConfig`
|
|
155
|
-
- `readMaxRedeem`
|
|
156
|
-
- `readMaxWithdraw`
|
|
157
|
-
- `readMergeLiquidatorBasics`
|
|
158
|
-
- `readNegRiskMarketPositionIds`
|
|
159
|
-
- `readOracleBasics`
|
|
160
|
-
- `readOracleCollateralStatus`
|
|
161
|
-
- `readOracleConfig`
|
|
162
|
-
- `readOracleFinalizationStatus`
|
|
163
|
-
- `readOracleGuardsStatus`
|
|
164
|
-
- `readOraclePositionMeta`
|
|
165
|
-
- `readOraclePriceData`
|
|
166
|
-
- `readOracleRegistry`
|
|
167
|
-
- `readOracleRegistryPage`
|
|
168
|
-
- `readOracleTiming`
|
|
169
|
-
- `readPoolAccounting`
|
|
170
|
-
- `readPoolCaps`
|
|
171
|
-
- `readPoolCoreAddress`
|
|
172
|
-
- `readPoolDebtState`
|
|
173
|
-
- `readPoolHealthScore`
|
|
174
|
-
- `readPoolRates`
|
|
175
|
-
- `readPoolSharePrice`
|
|
176
|
-
- `readPoolSnapshot`
|
|
177
|
-
- `readPortfolioValue`
|
|
178
|
-
- `readPositionBalance`
|
|
179
|
-
- `readPositionBalances`
|
|
180
|
-
- `readPositionCount`
|
|
181
|
-
- `readPositionLiquidationConfigOverride`
|
|
182
|
-
- `readPositionLtvOverride`
|
|
183
|
-
- `readPositionSnapshot`
|
|
184
|
-
- `readPreviewLiquidation`
|
|
185
|
-
- `readPrice`
|
|
186
|
-
- `readProxyAdminPaused`
|
|
187
|
-
- `readRepayTiming`
|
|
188
|
-
- `readRiskTier`
|
|
189
|
-
- `readRoleSummary`
|
|
190
|
-
- `readSpotPrice`
|
|
191
|
-
- `readSystemSnapshot`
|
|
192
|
-
- `readTargetConfig`
|
|
193
|
-
- `readTierLiquidationConfig`
|
|
194
|
-
- `readTieredLtvConfig`
|
|
195
|
-
- `readTryGetPrice`
|
|
196
|
-
- `readTwap`
|
|
197
|
-
<!-- END GENERATED:VIEW_HELPERS -->
|
|
112
|
+
### Oracle views
|
|
198
113
|
|
|
199
114
|
```ts
|
|
200
|
-
|
|
115
|
+
// Oracle registry (all configured positions)
|
|
116
|
+
const registry = await views.readOracleRegistry({ oracle: c.oracle });
|
|
201
117
|
|
|
202
|
-
//
|
|
203
|
-
const
|
|
118
|
+
// Price data for a position
|
|
119
|
+
const priceData = await views.readOraclePriceData({ oracle: c.oracle, positionId: 123n });
|
|
120
|
+
|
|
121
|
+
// Position snapshot (price + metadata)
|
|
122
|
+
const snap = await views.readPositionSnapshot({ oracle: c.oracle, positionId: 123n });
|
|
123
|
+
|
|
124
|
+
// Batch: many position snapshots in one multicall
|
|
125
|
+
const snaps = await views.readManyPositionSnapshots({
|
|
204
126
|
oracle: c.oracle,
|
|
205
|
-
|
|
127
|
+
positionIds: [1n, 2n, 3n],
|
|
206
128
|
});
|
|
207
|
-
|
|
208
|
-
// Read pool snapshot (wraps getPoolStats)
|
|
209
|
-
const pool = await readPoolSnapshot({ pool: c.pool });
|
|
210
129
|
```
|
|
211
130
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
The SDK supports explicit subpath imports for clearer dependency boundaries:
|
|
131
|
+
### System snapshot
|
|
215
132
|
|
|
216
133
|
```ts
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const ids = await views.readOracleRegistry({ oracle: c.oracle, client });
|
|
134
|
+
// Everything at once: pool + core + oracle state
|
|
135
|
+
const system = await views.readSystemSnapshot({
|
|
136
|
+
core: c.core,
|
|
137
|
+
pool: c.pool,
|
|
138
|
+
oracle: c.oracle,
|
|
139
|
+
});
|
|
225
140
|
```
|
|
226
141
|
|
|
227
|
-
|
|
142
|
+
---
|
|
228
143
|
|
|
229
|
-
|
|
144
|
+
## Writing transactions
|
|
230
145
|
|
|
231
|
-
|
|
232
|
-
2. submit it via `walletClient.writeContract`
|
|
146
|
+
All write helpers use the **simulate-first** pattern — they return a `SimulatedTx` with a pre-validated `request` you can send via any viem wallet client.
|
|
233
147
|
|
|
234
148
|
```ts
|
|
235
149
|
import * as actions from "@varla/sdk/actions";
|
|
236
150
|
|
|
237
|
-
|
|
238
|
-
|
|
151
|
+
// Deposit collateral
|
|
152
|
+
const sim = await actions.prepareCoreDeposit({
|
|
153
|
+
publicClient: client,
|
|
239
154
|
coreAddress: c.core.address,
|
|
240
|
-
account:
|
|
155
|
+
account: "0x...",
|
|
156
|
+
positionId: 123n,
|
|
241
157
|
amount: 1_000_000n,
|
|
242
158
|
});
|
|
243
159
|
|
|
160
|
+
// Send the transaction
|
|
244
161
|
const hash = await actions.sendTx({ walletClient, request: sim.request });
|
|
245
162
|
```
|
|
246
163
|
|
|
247
|
-
###
|
|
164
|
+
### Common actions
|
|
248
165
|
|
|
249
|
-
|
|
250
|
-
|
|
166
|
+
```ts
|
|
167
|
+
// Borrow from pool
|
|
168
|
+
await actions.prepareCoreBorrow({ publicClient, coreAddress, account, amount });
|
|
251
169
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
- `executeOracleSeedPlan(...)` submits the prepared requests sequentially (no retries/polling)
|
|
170
|
+
// Repay debt
|
|
171
|
+
await actions.prepareCoreRepay({ publicClient, coreAddress, account, amount });
|
|
255
172
|
|
|
256
|
-
|
|
173
|
+
// Withdraw collateral
|
|
174
|
+
await actions.prepareCoreWithdraw({ publicClient, coreAddress, account, positionId, amount });
|
|
257
175
|
|
|
258
|
-
|
|
259
|
-
|
|
176
|
+
// ERC-20 approval (for pool deposits)
|
|
177
|
+
await actions.prepareErc20Approve({ publicClient, tokenAddress, spender, amount });
|
|
260
178
|
|
|
261
|
-
|
|
262
|
-
|
|
179
|
+
// Pool deposit (lender)
|
|
180
|
+
await actions.preparePoolDeposit({ publicClient, poolAddress, account, assets });
|
|
263
181
|
|
|
264
|
-
|
|
265
|
-
|
|
182
|
+
// Pool withdraw (lender)
|
|
183
|
+
await actions.preparePoolWithdraw({ publicClient, poolAddress, account, assets });
|
|
184
|
+
```
|
|
266
185
|
|
|
267
|
-
|
|
186
|
+
---
|
|
268
187
|
|
|
269
|
-
|
|
188
|
+
## Leverage
|
|
270
189
|
|
|
271
|
-
|
|
272
|
-
import * as actions from "@varla/sdk/actions";
|
|
190
|
+
Plan and execute leveraged positions through iterative borrow → buy → deposit loops.
|
|
273
191
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
},
|
|
192
|
+
```ts
|
|
193
|
+
import { planLeverage, executeLeverage } from "@varla/sdk/leverage";
|
|
194
|
+
|
|
195
|
+
// Plan a 3× leveraged long position
|
|
196
|
+
const plan = planLeverage({
|
|
197
|
+
initialCapital: 100_000_000n, // 100 USDC (6 decimals)
|
|
198
|
+
tokenPriceE8: 50_000_000n, // $0.50
|
|
199
|
+
ltvWad: 650_000_000_000_000_000n, // 65% LTV
|
|
200
|
+
targetLeverageWad: 3_000_000_000_000_000_000n, // 3.0×
|
|
284
201
|
});
|
|
285
202
|
|
|
286
|
-
//
|
|
287
|
-
console.log(
|
|
203
|
+
console.log(plan.summary.effectiveLeverageWad); // actual achieved leverage
|
|
204
|
+
console.log(plan.summary.estimatedLiquidationPriceE8); // liquidation price
|
|
205
|
+
console.log(plan.steps); // ordered steps: buy → deposit → borrow → buy → ...
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Error decoding
|
|
288
211
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
212
|
+
Automatically decode custom Solidity errors from any Varla contract.
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { decodeVarlaError, formatVarlaError } from "@varla/sdk/errors";
|
|
216
|
+
|
|
217
|
+
try {
|
|
218
|
+
await publicClient.simulateContract({ /* ... */ });
|
|
219
|
+
} catch (err) {
|
|
220
|
+
const decoded = decodeVarlaError(err);
|
|
221
|
+
if (decoded) {
|
|
222
|
+
console.log(formatVarlaError(decoded));
|
|
223
|
+
// → "VarlaCore.InsufficientCollateral(required=1000, actual=500)"
|
|
224
|
+
console.log(decoded.contract, decoded.name, decoded.args, decoded.selector);
|
|
225
|
+
}
|
|
295
226
|
}
|
|
296
227
|
```
|
|
297
228
|
|
|
298
|
-
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Formatting utilities
|
|
299
232
|
|
|
300
233
|
```ts
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
234
|
+
import { formatWad, formatBps, formatPriceE8, parseUnits, parseWad } from "@varla/sdk/format";
|
|
235
|
+
|
|
236
|
+
formatWad(1_500_000_000_000_000_000n); // "1.5"
|
|
237
|
+
formatWad(1_500_000_000_000_000_000n, { fractionDigits: 4 }); // "1.5"
|
|
238
|
+
formatBps(1500); // "15%"
|
|
239
|
+
formatBps(1234); // "12.34%"
|
|
240
|
+
formatPriceE8(50_000_000n); // "0.5"
|
|
241
|
+
|
|
242
|
+
parseUnits("1.5", 18); // 1_500_000_000_000_000_000n
|
|
243
|
+
parseUnits("100", 6); // 100_000_000n
|
|
244
|
+
parseWad("2.5"); // 2_500_000_000_000_000_000n
|
|
307
245
|
```
|
|
308
246
|
|
|
309
|
-
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Multicall batching
|
|
310
250
|
|
|
311
|
-
|
|
251
|
+
Chunk large read batches to stay within RPC provider limits.
|
|
312
252
|
|
|
313
253
|
```ts
|
|
314
|
-
import
|
|
254
|
+
import { multicallChunks } from "@varla/sdk/batch";
|
|
315
255
|
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
256
|
+
const results = await multicallChunks({
|
|
257
|
+
client,
|
|
258
|
+
contracts: [
|
|
259
|
+
{ address: poolAddr, abi: poolAbi, functionName: "totalAssets" },
|
|
260
|
+
{ address: poolAddr, abi: poolAbi, functionName: "totalSupply" },
|
|
261
|
+
// ... hundreds of calls
|
|
262
|
+
],
|
|
263
|
+
chunkSize: 64, // calls per multicall (default: 128)
|
|
322
264
|
});
|
|
323
265
|
```
|
|
324
266
|
|
|
325
|
-
|
|
267
|
+
---
|
|
326
268
|
|
|
327
|
-
|
|
269
|
+
## Events & indexing
|
|
328
270
|
|
|
329
|
-
|
|
330
|
-
|
|
271
|
+
```ts
|
|
272
|
+
import {
|
|
273
|
+
getEventLogsChunked,
|
|
274
|
+
syncOracleRegistryViaEvents,
|
|
275
|
+
getRecentEvents,
|
|
276
|
+
ORACLE_EVENTS,
|
|
277
|
+
CORE_EVENTS,
|
|
278
|
+
POOL_EVENTS,
|
|
279
|
+
} from "@varla/sdk/events";
|
|
280
|
+
|
|
281
|
+
// Fetch oracle events in manageable chunks
|
|
282
|
+
const logs = await getEventLogsChunked({
|
|
283
|
+
client,
|
|
284
|
+
address: c.oracle.address,
|
|
285
|
+
events: ORACLE_EVENTS,
|
|
286
|
+
fromBlock: 50_000_000n,
|
|
287
|
+
toBlock: "latest",
|
|
288
|
+
chunkSize: 10_000,
|
|
289
|
+
});
|
|
331
290
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
291
|
+
// Reconstruct oracle registry from events (no paginated RPC needed)
|
|
292
|
+
const registry = await syncOracleRegistryViaEvents({
|
|
293
|
+
client,
|
|
294
|
+
oracleAddress: c.oracle.address,
|
|
295
|
+
fromBlock: 50_000_000n,
|
|
296
|
+
});
|
|
335
297
|
```
|
|
336
298
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
This suite also includes a real-contract RBAC + oracle seeding test:
|
|
340
|
-
- `packages/sdk/test/oracle.seed.rbac.anvil.test.ts`
|
|
299
|
+
---
|
|
341
300
|
|
|
342
|
-
|
|
343
|
-
(`publicClient.waitForTransactionReceipt`) before asserting state.
|
|
301
|
+
## Chain metadata
|
|
344
302
|
|
|
345
|
-
|
|
303
|
+
```ts
|
|
304
|
+
import { getChainMeta } from "@varla/sdk";
|
|
346
305
|
|
|
347
|
-
|
|
306
|
+
const meta = getChainMeta("polygon");
|
|
307
|
+
// → { chain: "polygon", platform: "polymarket", collateral: { kind: "USDC", symbol: "USDC", decimals: 6 } }
|
|
348
308
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
// polygon
|
|
352
|
-
}
|
|
353
|
-
if (c.opinionCtfExecutionEngineAdapter) {
|
|
354
|
-
// bsc
|
|
355
|
-
}
|
|
309
|
+
const bscMeta = getChainMeta("bsc");
|
|
310
|
+
// → { chain: "bsc", platform: "opinion", collateral: { kind: "USDT", symbol: "USDT", decimals: 18 } }
|
|
356
311
|
```
|
|
357
312
|
|
|
358
|
-
|
|
313
|
+
---
|
|
359
314
|
|
|
360
|
-
|
|
361
|
-
import { getRequiredVarlaContracts } from "@varla/sdk";
|
|
315
|
+
## Testing
|
|
362
316
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
317
|
+
```bash
|
|
318
|
+
cd packages/sdk
|
|
319
|
+
|
|
320
|
+
bun run test:quick # build + run all tests
|
|
321
|
+
bun run test:types # typecheck only (no runtime)
|
|
322
|
+
bun run test:rpc # RPC integration tests (needs POLYGON_RPC_URL, BSC_RPC_URL)
|
|
323
|
+
bun run test:rpc:slow # slow RPC tests (opt-in via SDK_SLOW_RPC_TESTS=1)
|
|
368
324
|
```
|
|
369
325
|
|
|
370
|
-
|
|
326
|
+
---
|
|
371
327
|
|
|
372
|
-
|
|
328
|
+
## Contributing
|
|
373
329
|
|
|
374
|
-
|
|
375
|
-
import { getErc20, getErc1155 } from "@varla/sdk";
|
|
330
|
+
This package lives in the [`varla-protocol`](https://github.com/Varla-xyz/varla-protocol) monorepo under `packages/sdk/`.
|
|
376
331
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const positionsToken = await c.core.read.positionsToken();
|
|
382
|
-
const ctf = getErc1155({ client, address: positionsToken });
|
|
383
|
-
const bal = await ctf.read.balanceOf(["0xUser", 123n]);
|
|
332
|
+
```bash
|
|
333
|
+
bun install # install from repo root
|
|
334
|
+
cd packages/sdk && bun run prepack # regenerate artifacts + build
|
|
335
|
+
cd packages/sdk && bun run test:quick # verify
|
|
384
336
|
```
|
|
385
337
|
|
|
386
|
-
|
|
338
|
+
See [`AGENTS.md`](./AGENTS.md) for the complete auto-generated API reference.
|
|
387
339
|
|
|
388
|
-
|
|
340
|
+
## License
|
|
389
341
|
|
|
390
|
-
|
|
342
|
+
[BUSL-1.1](../../LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpinionCtfExecutionEngineAdapter.js","sourceRoot":"","sources":["../../../src/abi/full/OpinionCtfExecutionEngineAdapter.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,kBAAkB;gBAC1B,MAAM,EAAE,SAAS;aAClB;YACD;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,iBAAiB,EAAE,YAAY;QAC/B,MAAM,EAAE,aAAa;KACtB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,WAAW;gBACnB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,MAAM,EAAE,+BAA+B;QACvC,MAAM,EAAE,OAAO;KAChB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,SAAS;aAClB;YACD;gBACE,cAAc,EAAE,QAAQ;gBACxB,MAAM,EAAE,OAAO;gBACf,MAAM,EAAE,QAAQ;aACjB;SACF;QACD,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,OAAO;KAChB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,MAAM,EAAE,2BAA2B;QACnC,MAAM,EAAE,OAAO;KAChB;IACD;QACE,QAAQ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