@dfm-fi/agent 0.2.1565 → 0.2.1567
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebalance-drill.d.ts","sourceRoot":"","sources":["../../src/examples/rebalance-drill.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rebalance drill: converge a vault to its config and report what landed.
|
|
3
|
+
*
|
|
4
|
+
* DFM_API_URL=… DFM_AGENT_KEYPAIR_PATH=… VAULT=<pda> [SLIPPAGE_BPS=100]
|
|
5
|
+
* npx tsx src/examples/rebalance-drill.ts
|
|
6
|
+
*/
|
|
7
|
+
import { loadConfig } from '../config.js';
|
|
8
|
+
import { SiwsSession } from '../session.js';
|
|
9
|
+
import { DfmApiClient } from '../api-client.js';
|
|
10
|
+
const config = loadConfig();
|
|
11
|
+
const api = new DfmApiClient(config, new SiwsSession(config));
|
|
12
|
+
const vault = process.env.VAULT;
|
|
13
|
+
if (!vault)
|
|
14
|
+
throw new Error('VAULT is required');
|
|
15
|
+
const r = await api.executeViaOperatingWallet('rebalance_to_targets', {
|
|
16
|
+
vault,
|
|
17
|
+
slippageBps: Number(process.env.SLIPPAGE_BPS ?? '100'),
|
|
18
|
+
});
|
|
19
|
+
console.log('REBALANCE', JSON.stringify(r, null, 2));
|
|
20
|
+
//# sourceMappingURL=rebalance-drill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebalance-drill.js","sourceRoot":"","sources":["../../src/examples/rebalance-drill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;AAC5B,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;AAChC,IAAI,CAAC,KAAK;IAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACjD,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,yBAAyB,CAAC,sBAAsB,EAAE;IACpE,KAAK;IACL,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,KAAK,CAAC;CACvD,CAAC,CAAC;AACH,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED