Contract Interaction Examples

This section shows how developers interact with PLX vault contracts directly — either through the SDK or Solana’s Anchor framework.


Example 1: Minting a Leveraged Token (SOL2X)

POST https://api.plx.fi/v1/actions/mint

Payload

{
  "wallet": "B3kPq...x7xA",
  "symbol": "SOL2X",
  "amount": 25.0,
  "signature": "5q9NQhC8bX..."
}

Response

{
  "status": "success",
  "tx_hash": "2WfxZ...kLB7",
  "new_balance": 25.0,
  "vault_ratio": 2.03
}

Example 2: Claiming Rewards Automatically

Response


Example 3: Subscribing to Rebalance Events (WebSocket)

Event Example

These examples mirror the actual Anchor program interactions, making it possible for developers to simulate transactions without deploying on-chain code.

Last updated