@varla/sdk 2.20.0 → 3.0.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/AGENTS.md +7 -7
- package/CHANGELOG.md +27 -0
- package/README.md +2 -2
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.d.ts +4 -0
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.d.ts.map +1 -1
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js +5 -0
- package/dist/abi/full/OpinionCtfExecutionEngineAdapter.js.map +1 -1
- package/dist/abi/full/PolymarketCtfAdapter.d.ts +32 -0
- package/dist/abi/full/PolymarketCtfAdapter.d.ts.map +1 -1
- package/dist/abi/full/PolymarketCtfAdapter.js +41 -0
- package/dist/abi/full/PolymarketCtfAdapter.js.map +1 -1
- package/dist/abi/full/VarlaConvertLiquidator.d.ts +39 -0
- package/dist/abi/full/VarlaConvertLiquidator.d.ts.map +1 -1
- package/dist/abi/full/VarlaConvertLiquidator.js +50 -0
- package/dist/abi/full/VarlaConvertLiquidator.js.map +1 -1
- package/dist/abi/full/VarlaCore.d.ts +82 -0
- package/dist/abi/full/VarlaCore.d.ts.map +1 -1
- package/dist/abi/full/VarlaCore.js +106 -0
- package/dist/abi/full/VarlaCore.js.map +1 -1
- package/dist/abi/full/VarlaMergeLiquidator.d.ts +0 -39
- package/dist/abi/full/VarlaMergeLiquidator.d.ts.map +1 -1
- package/dist/abi/full/VarlaMergeLiquidator.js +0 -50
- package/dist/abi/full/VarlaMergeLiquidator.js.map +1 -1
- package/dist/abi/full/VarlaPool.d.ts +326 -0
- package/dist/abi/full/VarlaPool.d.ts.map +1 -1
- package/dist/abi/full/VarlaPool.js +424 -0
- package/dist/abi/full/VarlaPool.js.map +1 -1
- package/dist/abi/index.d.ts +0 -1
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +0 -1
- package/dist/abi/index.js.map +1 -1
- package/dist/actions/admin.d.ts +14 -0
- package/dist/actions/admin.d.ts.map +1 -1
- package/dist/actions/admin.js +18 -0
- package/dist/actions/admin.js.map +1 -1
- package/dist/actions/core.d.ts +14 -0
- package/dist/actions/core.d.ts.map +1 -1
- package/dist/actions/core.js +18 -0
- package/dist/actions/core.js.map +1 -1
- package/dist/actions/pool.d.ts +17 -0
- package/dist/actions/pool.d.ts.map +1 -1
- package/dist/actions/pool.js +18 -0
- package/dist/actions/pool.js.map +1 -1
- package/dist/addresses/polygon.d.ts.map +1 -1
- package/dist/addresses/polygon.js +11 -12
- package/dist/addresses/polygon.js.map +1 -1
- package/dist/addresses/polygonProxy.d.ts.map +1 -1
- package/dist/addresses/polygonProxy.js +4 -5
- package/dist/addresses/polygonProxy.js.map +1 -1
- package/dist/contracts.d.ts +1 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +0 -8
- package/dist/contracts.js.map +1 -1
- package/dist/generated.d.ts +470 -273
- package/dist/generated.d.ts.map +1 -1
- package/dist/generated.js +0 -1
- package/dist/generated.js.map +1 -1
- package/dist/meta.d.ts +16 -1
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +17 -2
- package/dist/meta.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/views/core.d.ts +2 -1
- package/dist/views/core.d.ts.map +1 -1
- package/dist/views/core.js +2 -1
- package/dist/views/core.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/full/OpinionCtfExecutionEngineAdapter.ts +5 -0
- package/src/abi/full/PolymarketCtfAdapter.ts +41 -0
- package/src/abi/full/VarlaConvertLiquidator.ts +50 -0
- package/src/abi/full/VarlaCore.ts +106 -0
- package/src/abi/full/VarlaMergeLiquidator.ts +0 -50
- package/src/abi/full/VarlaPool.ts +424 -0
- package/src/abi/index.ts +0 -1
- package/src/actions/admin.ts +32 -0
- package/src/actions/core.ts +32 -0
- package/src/actions/pool.ts +35 -0
- package/src/addresses/polygon-proxy.json +18 -0
- package/src/addresses/polygon.json +11 -10
- package/src/addresses/polygon.ts +11 -12
- package/src/addresses/polygonProxy.ts +4 -5
- package/src/contracts.ts +0 -11
- package/src/generated.ts +0 -1
- package/src/meta.ts +33 -3
- package/src/types.ts +0 -1
- package/src/views/core.ts +2 -1
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
"generatedAt": "",
|
|
4
4
|
"deploymentsDir": "polygon",
|
|
5
5
|
"contracts": {
|
|
6
|
-
"VarlaAccessManager": "
|
|
7
|
-
"VarlaOracle": "
|
|
8
|
-
"VarlaCore": "
|
|
9
|
-
"VarlaPool": "
|
|
10
|
-
"OracleUpdaterRouter": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
6
|
+
"VarlaAccessManager": "0x9d880933Def30A33f706dC2c1882a66598d2e891",
|
|
7
|
+
"VarlaOracle": "0x4E3d7d4264579473FDC2a40db15b42e8CA27CE4f",
|
|
8
|
+
"VarlaCore": "0x7bD415806e99e852B92fb55cD830F55e7F026C40",
|
|
9
|
+
"VarlaPool": "0x0B51D2497EdceCF5eedDB16ed6E12270410E18fE",
|
|
10
|
+
"OracleUpdaterRouter": "0x0e298855e9D06c0a05Efe13163e8D6bfD98ea8BA",
|
|
11
|
+
"VarlaInterestRateStrategy": "0xA0228e70AdaEb6E64037ca74d033f26d61e16F91",
|
|
12
|
+
"VarlaProxyAdmin": "0xAF6a35C861f377060a40B14aD18fd167b6AF6d3C",
|
|
13
|
+
"VarlaLiquidator": "0xacd5FDebE867536703bbC18e6b49fA6053179cf7",
|
|
14
|
+
"VarlaMergeLiquidator": "0xFfAF752671360cb6baFc7290155e8a81109d4589",
|
|
15
|
+
"VarlaConvertLiquidator": "0xE8507e011dAC6Bf07e742AF39e16deC647a70746",
|
|
16
|
+
"PolymarketCtfAdapter": "0xEbB92A5374D277A3e1CA915741ce3077364d95c0"
|
|
16
17
|
}
|
|
17
18
|
}
|
package/src/addresses/polygon.ts
CHANGED
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
import type { AddressBook } from "../types";
|
|
3
3
|
|
|
4
4
|
export const polygon: AddressBook = {
|
|
5
|
-
accessManager: "
|
|
6
|
-
oracle: "
|
|
7
|
-
core: "
|
|
8
|
-
pool: "
|
|
9
|
-
oracleUpdaterRouter: "
|
|
10
|
-
interestRateStrategy: "
|
|
11
|
-
proxyAdmin: "
|
|
12
|
-
liquidator: "
|
|
13
|
-
mergeLiquidator: "
|
|
14
|
-
convertLiquidator: "
|
|
15
|
-
polymarketCtfAdapter: "
|
|
16
|
-
negRiskMergeAdapter: "0x3611E0AA36ebEFe3b555Db9b5BDcB071Fb64a477",
|
|
5
|
+
accessManager: "0x9d880933Def30A33f706dC2c1882a66598d2e891",
|
|
6
|
+
oracle: "0x4E3d7d4264579473FDC2a40db15b42e8CA27CE4f",
|
|
7
|
+
core: "0x7bD415806e99e852B92fb55cD830F55e7F026C40",
|
|
8
|
+
pool: "0x0B51D2497EdceCF5eedDB16ed6E12270410E18fE",
|
|
9
|
+
oracleUpdaterRouter: "0x0e298855e9D06c0a05Efe13163e8D6bfD98ea8BA",
|
|
10
|
+
interestRateStrategy: "0xA0228e70AdaEb6E64037ca74d033f26d61e16F91",
|
|
11
|
+
proxyAdmin: "0xAF6a35C861f377060a40B14aD18fd167b6AF6d3C",
|
|
12
|
+
liquidator: "0xacd5FDebE867536703bbC18e6b49fA6053179cf7",
|
|
13
|
+
mergeLiquidator: "0xFfAF752671360cb6baFc7290155e8a81109d4589",
|
|
14
|
+
convertLiquidator: "0xE8507e011dAC6Bf07e742AF39e16deC647a70746",
|
|
15
|
+
polymarketCtfAdapter: "0xEbB92A5374D277A3e1CA915741ce3077364d95c0",
|
|
17
16
|
};
|
|
18
17
|
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
import type { AddressBook } from "../types";
|
|
3
3
|
|
|
4
4
|
export const polygonProxy: AddressBook = {
|
|
5
|
-
accessManager: "
|
|
5
|
+
accessManager: "0x9d880933Def30A33f706dC2c1882a66598d2e891",
|
|
6
6
|
oracle: "0xf507345D044D29DE9696c9fce02E9202cB902107",
|
|
7
7
|
core: "0x760453D0380222AaFB959145c20C9B32EBb1B636",
|
|
8
8
|
pool: "0x0fe32e729aE12600Ec8CbE6950456171C98120AE",
|
|
9
|
-
oracleUpdaterRouter: "
|
|
9
|
+
oracleUpdaterRouter: "0x0e298855e9D06c0a05Efe13163e8D6bfD98ea8BA",
|
|
10
10
|
interestRateStrategy: "0xf3aac20247fd73ae5C8ACFA0Cf25cfC463332E82",
|
|
11
|
-
proxyAdmin: "
|
|
11
|
+
proxyAdmin: "0xAF6a35C861f377060a40B14aD18fd167b6AF6d3C",
|
|
12
12
|
liquidator: "0x76B21eFF6F232CB9b647007A5E505a5392C7417F",
|
|
13
13
|
mergeLiquidator: "0xd0017264cd4Ee870F6869F1ab47f6ff579c31ba5",
|
|
14
14
|
convertLiquidator: "0x68421cDD230e550ac467Ae980454032bf8CE3651",
|
|
15
|
-
polymarketCtfAdapter: "
|
|
16
|
-
negRiskMergeAdapter: "0x3611E0AA36ebEFe3b555Db9b5BDcB071Fb64a477",
|
|
15
|
+
polymarketCtfAdapter: "0xEbB92A5374D277A3e1CA915741ce3077364d95c0",
|
|
17
16
|
};
|
|
18
17
|
|
package/src/contracts.ts
CHANGED
|
@@ -44,7 +44,6 @@ export type VarlaContracts = {
|
|
|
44
44
|
staking?: ReadonlyContract<typeof abis.VARLASTAKING_ABI>;
|
|
45
45
|
|
|
46
46
|
polymarketCtfAdapter?: ReadonlyContract<typeof abis.POLYMARKETCTFADAPTER_ABI>;
|
|
47
|
-
negRiskMergeAdapter?: ReadonlyContract<typeof abis.POLYMARKETNEGRISKMERGEADAPTER_ABI>;
|
|
48
47
|
opinionCtfExecutionEngineAdapter?: ReadonlyContract<
|
|
49
48
|
typeof abis.OPINIONCTFEXECUTIONENGINEADAPTER_ABI
|
|
50
49
|
>;
|
|
@@ -188,14 +187,6 @@ export function getVarlaContracts({
|
|
|
188
187
|
})
|
|
189
188
|
: undefined;
|
|
190
189
|
|
|
191
|
-
const negRiskMergeAdapter = book.negRiskMergeAdapter
|
|
192
|
-
? getContract({
|
|
193
|
-
address: book.negRiskMergeAdapter as Address,
|
|
194
|
-
abi: abis.POLYMARKETNEGRISKMERGEADAPTER_ABI,
|
|
195
|
-
client,
|
|
196
|
-
})
|
|
197
|
-
: undefined;
|
|
198
|
-
|
|
199
190
|
const opinionCtfExecutionEngineAdapter = book.opinionCtfExecutionEngineAdapter
|
|
200
191
|
? getContract({
|
|
201
192
|
address: book.opinionCtfExecutionEngineAdapter as Address,
|
|
@@ -219,7 +210,6 @@ export function getVarlaContracts({
|
|
|
219
210
|
convertLiquidator,
|
|
220
211
|
staking,
|
|
221
212
|
polymarketCtfAdapter,
|
|
222
|
-
negRiskMergeAdapter,
|
|
223
213
|
opinionCtfExecutionEngineAdapter,
|
|
224
214
|
};
|
|
225
215
|
}
|
|
@@ -239,7 +229,6 @@ export function getRequiredVarlaContracts(
|
|
|
239
229
|
| "convertLiquidator"
|
|
240
230
|
| "staking"
|
|
241
231
|
| "polymarketCtfAdapter"
|
|
242
|
-
| "negRiskMergeAdapter"
|
|
243
232
|
| "opinionCtfExecutionEngineAdapter"
|
|
244
233
|
>;
|
|
245
234
|
},
|
package/src/generated.ts
CHANGED
|
@@ -17,7 +17,6 @@ export const abis = {
|
|
|
17
17
|
VARLACONVERTLIQUIDATOR_ABI: abi_.VARLACONVERTLIQUIDATOR_ABI,
|
|
18
18
|
VARLASTAKING_ABI: abi_.VARLASTAKING_ABI,
|
|
19
19
|
POLYMARKETCTFADAPTER_ABI: abi_.POLYMARKETCTFADAPTER_ABI,
|
|
20
|
-
POLYMARKETNEGRISKMERGEADAPTER_ABI: abi_.POLYMARKETNEGRISKMERGEADAPTER_ABI,
|
|
21
20
|
OPINIONCTFEXECUTIONENGINEADAPTER_ABI: abi_.OPINIONCTFEXECUTIONENGINEADAPTER_ABI,
|
|
22
21
|
VARLAORACLE_ABI_REGISTRY: abi_.VARLAORACLE_ABI_REGISTRY,
|
|
23
22
|
} as const;
|
package/src/meta.ts
CHANGED
|
@@ -32,7 +32,7 @@ export function assertSupportedChain(value: string): asserts value is VarlaChain
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export type StablecoinKind = "USDC" | "USDT";
|
|
35
|
+
export type StablecoinKind = "PUSD" | "USDC" | "USDT";
|
|
36
36
|
|
|
37
37
|
export type CollateralMeta = {
|
|
38
38
|
kind: StablecoinKind;
|
|
@@ -42,13 +42,34 @@ export type CollateralMeta = {
|
|
|
42
42
|
address?: Address;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
export type WrappedCollateralAssetsMeta = {
|
|
46
|
+
nativeUsdc: Address;
|
|
47
|
+
bridgedUsdc: Address;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type PolymarketAdapterMeta = {
|
|
51
|
+
ctfCollateralAdapter: Address;
|
|
52
|
+
negRiskCtfCollateralAdapter: Address;
|
|
53
|
+
};
|
|
54
|
+
|
|
45
55
|
export type ChainMeta = {
|
|
46
56
|
chain: VarlaChainKey;
|
|
47
57
|
/** Platform/integration name shown to users. */
|
|
48
58
|
platform: "polymarket" | "opinion";
|
|
49
59
|
collateral: CollateralMeta;
|
|
60
|
+
wrappedCollateralAssets?: WrappedCollateralAssetsMeta;
|
|
61
|
+
polymarketAdapters?: PolymarketAdapterMeta;
|
|
50
62
|
};
|
|
51
63
|
|
|
64
|
+
// Polygon (Polymarket) token + adapter addresses.
|
|
65
|
+
export const POLYGON_PUSD_ADDRESS = "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB" as Address;
|
|
66
|
+
export const POLYGON_USDC_ADDRESS = "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359" as Address;
|
|
67
|
+
export const POLYGON_USDCE_ADDRESS = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" as Address;
|
|
68
|
+
export const POLYGON_CTF_COLLATERAL_ADAPTER_ADDRESS =
|
|
69
|
+
"0xADa100874d00e3331D00F2007a9c336a65009718" as Address;
|
|
70
|
+
export const POLYGON_NEG_RISK_CTF_COLLATERAL_ADAPTER_ADDRESS =
|
|
71
|
+
"0xAdA200001000ef00D07553cEE7006808F895c6F1" as Address;
|
|
72
|
+
|
|
52
73
|
/**
|
|
53
74
|
* Returns chain defaults for UI/backends.
|
|
54
75
|
*
|
|
@@ -63,9 +84,18 @@ export function getChainMeta(chain: VarlaChainKey): ChainMeta {
|
|
|
63
84
|
chain,
|
|
64
85
|
platform: "polymarket",
|
|
65
86
|
collateral: {
|
|
66
|
-
kind: "
|
|
67
|
-
symbol: "
|
|
87
|
+
kind: "PUSD",
|
|
88
|
+
symbol: "pUSD",
|
|
68
89
|
decimals: 6,
|
|
90
|
+
address: POLYGON_PUSD_ADDRESS,
|
|
91
|
+
},
|
|
92
|
+
wrappedCollateralAssets: {
|
|
93
|
+
nativeUsdc: POLYGON_USDC_ADDRESS,
|
|
94
|
+
bridgedUsdc: POLYGON_USDCE_ADDRESS,
|
|
95
|
+
},
|
|
96
|
+
polymarketAdapters: {
|
|
97
|
+
ctfCollateralAdapter: POLYGON_CTF_COLLATERAL_ADAPTER_ADDRESS,
|
|
98
|
+
negRiskCtfCollateralAdapter: POLYGON_NEG_RISK_CTF_COLLATERAL_ADAPTER_ADDRESS,
|
|
69
99
|
},
|
|
70
100
|
};
|
|
71
101
|
}
|
package/src/types.ts
CHANGED
package/src/views/core.ts
CHANGED
|
@@ -1320,7 +1320,8 @@ export async function readPositionLtvOverride(params: {
|
|
|
1320
1320
|
/**
|
|
1321
1321
|
* Thin wrapper over `VarlaCore.getLtvForPosition(positionId)`.
|
|
1322
1322
|
*
|
|
1323
|
-
* This is the *effective* LTV for the position (includes
|
|
1323
|
+
* This is the *effective* runtime LTV for the position (includes overrides and oracle adjustments).
|
|
1324
|
+
* It can be `0` when a position is manually invalidated by the oracle.
|
|
1324
1325
|
*/
|
|
1325
1326
|
// wraps: VarlaCore.getLtvForPosition
|
|
1326
1327
|
export async function readLtvForPosition(params: {
|