Vortex
    Vortex
    • General overview
    • Vortex Ramp Integration Guide
    • Vortex SDK
    • Quotes
      • Create a new quote
        POST
      • Get existing quote
        GET
    • Ramp
      • Register new ramp process
        POST
      • Get ramp status
        GET
      • Update ramp process
        POST
      • Start ramp process
        POST
    • Account Management
      • Brazil
        • Brazilian KYC Process Overview
        • Get user's remaining transaction limits
        • Get user information
        • Get status of the last ramp event for a user
        • Create user or retry KYC
        • Get user's KYC status
        • Start KYC level 2 process for a user
      • Europe
        • Coming soon...
    • Supported Payment Methods
      GET
    • Supported Cryptocurrencies
      GET

    Vortex SDK

    Vortex SDK (https://www.npmjs.com/package/@vortexfi/sdk) was implemented to avoid the need for ephemeral account creation, and handling signing process.
    Any Vortex ramp process always implements the register - update - ramp sequence. Since any ramp requires different information to be sent by the user during the update stage, the SDK implements an easy-to-use interface which is generic for any ramp, as well as the corresponding typing.

    Getting started#

    The following snippets demonstrate the general steps required for a generic ramp.
    1.
    Create a Quote: First, get a price quote for the operation.
    2.
    Register the Ramp: Next, register the ramp using the quote and any extra data required for that specific ramp type (e.g. a destination wallet address or a PIX key). This call always returns the rampProcess and a list of unsignedTransactions.
    The unsignedTransactions array contains objects that your application must process. Each object has a standard structure:
    phase: A string identifying the purpose of the transaction (e.g., squidRouterApprove).
    txData: An object containing the raw transaction details.
    to: The destination EVM address (e.g., a contract address).
    data: The encoded calldata for the transaction.
    3.
    Update the Ramp: After you sign and broadcast the transactions from the previous step, you must call updateRamp. This step requires you to pass the resulting transaction hashes from the previous step.
    4.
    Start the Ramp: This is the final call to have Vortex begin executing the final leg of the process (e.g., sending the fiat or crypto).

    Signing Transactions#

    As mentioned in the previous section, certain ramp types necessitate that users sign and send transactions directly from their wallets. This SDK is designed to be flexible and does not depend on any specific signing package. Instead, it provides the raw data that needs to be sent, allowing users to manage the signing process independently.
    Below is an example of how you can utilize the wagmi package for signing transactions. This example demonstrates the process of acquiring the necessary data and handling the signing:
    import { useSendTransaction } from 'wagmi';
    import { VortexSdk } from '@vortexfi/sdk';
    
    // Assumes 'sdk', 'quote', and 'brlOfframpData' are already defined.
    
    // 1. Get the transactions to sign.
    const { rampProcess, unsignedTransactions } = await sdk.registerRamp(quote, rampData);
    
    const address = '0xasdf...' // This is the address of your wallet account that you want to use for submitting the transactions
    
    const { sendTransactionAsync } = useSendTransaction();
    const transactionHashes: { [key: string]: string } = {};
    
    // 2. Sign and send user transactions.
    for (const tx of unsignedTransactions) {
      const hash = await sendTransactionAsync({
        to: tx.txData.to,
        data: tx.txData.data,
      });
      
      // Wait for transaction confirmation here.
      transactionHashes[`${tx.phase}`] = hash;
    }
    
    // 3. Create additionalData object with relevant hashes. The required fields are depending on the ramp type.
    const additionalData = {
      squidRouterApproveHash: transactionHashes['squidRouterApprove'],
      squidRouterSwapHash: transactionHashes['squidRouterSwap']
    }
    
    await sdk.updateRamp(quote, rampProcess.id, additionalData);
    await sdk.startRamp(rampProcess.id);
    

    BRL Onramp (Buy)#

    The following snippet shows how the SDK can be used to trigger a BRL onramp:
    import {  VortexSdk } from "@vortexfi/sdk";
    import { FiatToken, EvmToken, Networks} from "@vortexfi/sdk";
    import type { VortexSdkConfig } from "@vortexfi/sdk";
    
    const config: VortexSdkConfig = {
      apiBaseUrl: "http://localhost:3000",
    };
    
    const sdk = new VortexSdk(config);
    
    const quoteRequest = {
      from: "pix" as const,
      inputAmount: "150000",
      inputCurrency: FiatToken.BRL,
      outputCurrency: EvmToken.USDC,
      rampType: RampDirection.BUY,
      to: Networks.Polygon,
    };
    
    const quote = await sdk.createQuote(quoteRequest);
    
    const brlOnrampData = {
      destinationAddress: "0x1234567890123456789012345678901234567890",
      taxId: "123.456.789-00"
    };
    
    cconst { rampProcess } = await = await sdk.registerRamp(quote, brlOnrampData);
    
    // Make the FIAT payment.
    // The sdk will provide the information to make the payment.
    const { depositQrCode } = registeredRamp
    console.log("Please do the pix transfer using the following code: ", brCode)
    
    //Once the payment is done, start the ramp.
    const startedRamp = await sdk.startRamp(quote, registeredRamp.id);

    BRL Offramps (Sell)#

    A BRL offramp requires an initial on-chain operation for the ramp to be triggered. Vortex uses the Squidrouter cross-chain swap service to start this process.
    After calling registerRamp, the returned unsignedTransactions array will contain data for a token approval and swap. You must sign and broadcast these transactions, then provide their resulting hashes to updateRamp to confirm the sale and trigger your ramp process.

    Current limitations#

    The Vortex SDK does not yet support the KYC/KYB required for onboarding new users. Only users who have already completed KYC/KYB verification can use the SDK to buy and sell tokens with Vortex.
    New users need to first initiate the KYC/KYB verification on app.vortexfinance.co.
    Once the process is finished, the sdk can be used for any further ramp requests, by only using the user's identifier for the corresponding country (eg.: tax-id for Brazil).
    Modified at 2025-08-12 14:20:55
    Previous
    Vortex Ramp Integration Guide
    Next
    Create a new quote
    Built with