POST
/
api
/
algebra
/
interactions
/
transfer
curl --request POST \
  --url https://public-beam-backend-mainnet.codemelt.codes/api/algebra/interactions/transfer \
  --header 'Content-Type: application/json' \
  --data '{
  "from": "<string>",
  "to": "<string>",
  "tokenId": "<string>",
  "networkName": "<string>"
}'
{
  "message": "<string>",
  "data": null,
  "status": "<any>"
}

Transfer Liquidity

This endpoint provides functionality for transferring Algebra positions between addresses. It supports full position transfers including accrued fees.

Using the SDK

import api, { IConnection } from "codemelt-retro-api-sdk"
import { TransferLiquidityDTO } from 'codemelt-retro-api-sdk/structures/TransferLiquidityDTO'

const connection: IConnection = {
  host: '<enter your host url here>',
  headers: {
    'x-api-key': '<enter your api key here>'
  }
}

const networkName = 'Zeta Mainnet'
const input: TransferLiquidityDTO = {
  from: signer.address,
  to: transferAddress,
  tokenId: selectedPosition.tokenId,
  networkName: networkName
}

const resp = await api.functional.api.algebra.interactions.transfer.transferLiquidity(
  connection,
  input
)

Security Considerations

  1. Ownership Validation

    • Position must exist and belong to the sender
    • Recipient address must be valid and active
    • Smart contract addresses should be verified for compatibility
  2. Position State

    • Unclaimed fees remain with the position
    • Position settings (tick ranges, liquidity) remain unchanged
    • Transfer includes all associated rights and permissions

Common Errors and Solutions

  1. Position Verification
const resp = await api.algebra.pool.manual.getUserPools(
  connection,
  signer.address,
  networkName
)

const position = resp.data.data.positions.find(
  elm => elm.tokenId === desiredTokenId
)

if (!position) {
  throw new Error('Position not found or not owned by sender')
}

Best Practices

  1. Pre-transfer Checklist

    • Verify recipient address carefully
    • Consider collecting fees before transfer
    • Document transfer for accounting purposes
    • Inform recipient of position details
  2. Security Steps

    • Use address whitelisting when possible
    • Implement transfer delays for large positions
    • Double-check all addresses
    • Consider using a test transfer with small positions first

Body

application/json
from
string
required
to
string
required
tokenId
string
required
networkName
string
required

Response

201 - application/json
message
string
required
data
null
required
status
any
required