Vault Actions API

Signed actions to deposit, withdraw, mint, burn. The backend verifies your signature and relays a transaction to the vault program.

Endpoints

  • POST /actions/deposit

  • POST /actions/withdraw

  • POST /actions/mint

  • POST /actions/burn

Headers (signed)

  • Authorization: Bearer <API_KEY>

  • x-plx-ts: <unix_ts>

  • x-plx-wallet: <pubkey>

Payload fields

  • symbol (e.g., SOL2X)

  • amount (decimal SOL)

  • wallet (base58 pubkey)

  • signature (ed25519 signature over wallet|symbol|amount|ts)

curl (deposit 10 SOL to SOL2X)

curl -s -X POST https://api.plx.fi/v1/actions/deposit \
 -H "Authorization: Bearer $PLX_API_KEY" \
 -H "Content-Type: application/json" \
 -H "x-plx-ts: 1735698200" \
 -H "x-plx-wallet: FfQp7...Rz9A" \
 -d '{
  "symbol":"SOL2X",
  "amount":10.0,
  "wallet":"FfQp7...Rz9A",
  "signature":"5YwqP2...ed25519sig..."
 }'
{
  "status":"submitted",
  "tx":"5c4Jq1...G2Z",
  "vault":"SOL2X",
  "queued_rebalance":true,
  "share_mint":"vSOL2X",
  "estimated_shares":9.9983
}

mint leveraged token (PUMP5X)

curl -s -X POST https://api.plx.fi/v1/actions/mint \
 -H "Authorization: Bearer $PLX_API_KEY" \
 -H "Content-Type: application/json" \
 -H "x-plx-ts: 1735698212" \
 -H "x-plx-wallet: 7Kf3...LGa" \
 -d '{
  "symbol":"PUMP5X",
  "amount":50.0,
  "wallet":"7Kf3...LGa",
  "signature":"3x9Dt...ed25519sig..."
 }'
{"status":"success","tx":"9df8x...2rZ","mint":"PUMP5X","received":49.9921}

TypeScript (sign + call)

import nacl from "tweetnacl";
import bs58 from "bs58";
import { api } from "./plx-api";

async function signAndDeposit({walletSecret, walletPub, symbol, amount, key}:{walletSecret:Uint8Array, walletPub:string, symbol:string, amount:number, key:string}) {
  const ts = Math.floor(Date.now()/1000);
  const msg = Buffer.from(`${walletPub}|${symbol}|${amount}|${ts}`);
  const sig = nacl.sign.detached(msg, walletSecret);
  const signature = bs58.encode(sig);

  return api("/actions/deposit", key, {
    method:"POST",
    body: JSON.stringify({symbol, amount, wallet: walletPub, signature}),
  });
}

Note: For production, sign the transaction (Anchor/solanaWeb3) returned by a /tx/build endpoint; the example above demonstrates simple payload auth.

Last updated