> ## Documentation Index
> Fetch the complete documentation index at: https://docs.silvana.one/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Interaction Flow

# SDK Interaction Flow

Trading logic stays inside the agent, while transaction preparation, verification, signing, and submission follow a controlled flow.

<Steps>
  <Step title="Connect">
    The agent loads its configuration and connects to the Silvana orderbook server through the required gRPC services.
  </Step>

  <Step title="Trade">
    The agent reads market data, submits orders, processes RFQs when configured, and reacts to orderbook or settlement events.
  </Step>

  <Step title="Verify and Sign">
    For ledger-mutating actions, the server prepares the transaction, and the agent verifies the transaction before signing it locally.
  </Step>

  <Step title="Execute and Settle">
    The signed transaction is sent back to the service, submitted to Canton, and finalized through the DvP settlement flow.
  </Step>
</Steps>

# Two-Phase Transaction Flow

All ledger-mutating operations use a two-phase signing protocol:

1. Agent calls `PrepareTransaction` with an operation type and parameters.
2. Server returns the full `prepared_transaction` bytes and a hash.
3. Agent uses `tx-verifier` to independently verify the transaction matches the requested operation (correct template, parties, amounts).
4. Agent signs the hash locally with its Ed25519 private key.
5. Agent calls `ExecuteTransaction` with the signature.
6. Server submits the signed transaction to the Canton ledger.

Supported operation types include: `TRANSFER_CC`, `TRANSFER_CIP56`, `ACCEPT_CIP56`, `PAY_DVP_FEE`, `PROPOSE_DVP`, `ACCEPT_DVP`, `PAY_ALLOC_FEE`, `ALLOCATE`, `EXECUTE_MULTICALL`, `SPLIT_CC`, `REQUEST_PREAPPROVAL`, `REQUEST_RECURRING_PREPAID`, `REQUEST_RECURRING_PAYASYOUGO`, `REQUEST_USER_SERVICE`, `LOCK_HOLDINGS`, `PROCESS_LOCK_UNLOCK_REQUESTS`, `RESIZE_LOCK`, `TERMINATE_LOCK`.
