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

# Para Tutorial

> A tutorial on how to use Para with the Glider API

The Glider API is wallet agnostic. This means that as long as you can get an [EIP-191 signature](https://eips.ethereum.org/EIPS/eip-191) from the EOA that will own the portfolio, you can use the Glider API.

If you've followed along with the [Quickstart](/quickstart) guide you will notice there's two cases where your wallet architecture will need to interface with Glider. The first is when you're creating a portfolio, and the second is when you're funding a portfolio.

## Creating a Portfolio with Para

<Steps titleSize="h3">
  <Step title="Get the Message to Sign">
    Fetch the data to be signed by calling the `https://api.glider.fi/v1/portfolio/create/signature` endpoint.

    ```javascript theme={null}
    // First, get the message to sign
    const signDataResponse = await fetch(
      `https://api.glider.fi/strategies/sign-data/${strategy.strategyId}`,
      {
        method: "GET",
        headers: {
          "X-API-KEY": "your_api_key_here",
        },
      }
    );

    const signData = await signDataResponse.json();
    const messageToSign = signData.message;
    ```
  </Step>

  <Step title="Sign the Message">
    Sign the payload using the owner's wallet. The Para SDK, using the Viem integration, can be used to sign the message like so:

    ```javascript para.js theme={null}
    import { createParaViemClient, createParaAccount } from "@getpara/viem-v2-integration";
    import { http, parseEther } from "viem";
    import { mainnet } from "viem/chains";
    import Para, { Environment } from "@getpara/web-sdk";

    const para = new Para(Environment.BETA, API_KEY);
    const account = await createParaAccount(para);
    const walletClient = createParaViemClient(para, {
      account: account,
      chain: mainnet,
      transport: http("YOUR_RPC_URL"),
    });

    const signature = await walletClient.signMessage({
        message: messageToSign,
        account
    });
    ```
  </Step>
</Steps>

## Funding a Portfolio with Para

Funding a portfolio is done by sending funds to a portfolio's vault address.

<Steps titleSize="h3">
  <Step title="Get the Portfolio's Vault Address">
    Fetch the portfolio's vault address by calling the `https://api.glider.fi/v1/portfolio/{portfolioId}` endpoint.

    <FetchStrategyDataCodeblock />
  </Step>

  <Step title="Send Funds to the Portfolio's Vault">
    The Para SDK and the Para-Viem client can be used to send funds to the vault.

    ```javascript theme={null}
    import Para, { Environment } from "@getpara/react-sdk";
    import { createParaViemClient, createParaAccount } from "@getpara/viem-v2-integration";
    import { mainnet } from "viem/chains";
    import { parseEther } from "viem";

    const para = new Para(Environment.BETA, API_KEY);
    const account = await createParaAccount(para);
    const paraClient = createParaViemClient(para, {
        account,
        chain: mainnet,
        transport: http("YOUR_RPC_URL")
    });

    const transaction = {
        account: paraClient.account,
        to: "0xRecipientAddress",
        value: parseEther("0.02"),
    };

    const signedTx = await paraClient.signTransaction(transaction);
    const hash = await paraClient.broadcastTransaction({
        serializedTransaction: signedTx
    });
    ```
  </Step>
</Steps>
