New integrations:
- src/venues/adrena.ts: Adrena Protocol perp venue (funding rates + market data)
- scripts/vault-ops/: 15 multi-protocol vault management scripts from client-scripts
- Admin: init vault, add strategies, harvest fees, direct withdraw
- Manager: deposit/withdraw across Drift + Jupiter + Kamino strategies
- User: deposit, withdraw, query positions
Engine upgrade:
- Cross-venue funding comparison now checks Drift vs Flash vs Adrena (3 venues)
- Finds arb when spread > 5% APY across venues
- Logs: "Short on {best venue}, long on {worst venue}"
Stats:
- 5 venue modules: Drift, Flash, Adrena, Orca, Meteora
- 96 scripts across vault-ops, lending, raydium-clmm, rebalance-bot
- 20/20 test suites, 181/181 tests pass
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
import * as fs from "fs";
|
|
import { sendAndConfirmOptimisedTx } from "../utils/helper";
|
|
import { VoltrClient } from "@voltr/vault-sdk";
|
|
import {
|
|
adminFilePath,
|
|
heliusRpcUrl,
|
|
vaultAddress,
|
|
vaultConfig,
|
|
} from "../variables";
|
|
|
|
const adminKpFile = fs.readFileSync(adminFilePath, "utf-8");
|
|
const adminKpData = JSON.parse(adminKpFile);
|
|
const adminSecret = Uint8Array.from(adminKpData);
|
|
const adminKp = Keypair.fromSecretKey(adminSecret);
|
|
const admin = adminKp.publicKey;
|
|
|
|
const vault = new PublicKey(vaultAddress);
|
|
|
|
const connection = new Connection(heliusRpcUrl);
|
|
const vc = new VoltrClient(connection);
|
|
|
|
const updateVaultHandler = async () => {
|
|
const createUpdateVaultIx = await vc.createUpdateVaultIx(vaultConfig, {
|
|
vault,
|
|
admin,
|
|
});
|
|
|
|
const txSig = await sendAndConfirmOptimisedTx(
|
|
[createUpdateVaultIx],
|
|
heliusRpcUrl,
|
|
adminKp
|
|
);
|
|
|
|
console.log(`Vault updated with signature: ${txSig}`);
|
|
};
|
|
|
|
const main = async () => {
|
|
await updateVaultHandler();
|
|
};
|
|
|
|
main();
|