Skip to main content
GET
/
strategies
/
{strategyId}
/
bytecode
Generate strategy transaction bytecode
curl --request GET \
  --url https://api.deframe.io/strategies/{strategyId}/bytecode \
  --header 'x-api-key: <api-key>'
{
  "bytecode": [
    {
      "chainId": 1,
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x...",
      "value": "0",
      "from": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
    }
  ],
  "feeCharged": "0",
  "metadata": {
    "isCrossChain": true,
    "isSameChainSwap": true,
    "crossChainQuoteId": "<string>"
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain from your Deframe dashboard.

Path Parameters

strategyId
string
required

Strategy ID or slug

Query Parameters

action
enum<string>
required

Action type

Available options:
lend,
withdraw
amount
string
required

Amount in token smallest unit

Example:

"1000000"

wallet
string
required

User wallet address

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

fromToken
string

Token address to swap from before depositing (same-chain only). When provided, the API returns additional swap transaction(s) before the deposit bytecode, converting fromToken into the strategy's underlying asset on the same chain.

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

Response

Bytecode generated successfully

bytecode
object[]
required
feeCharged
string
Example:

"0"

metadata
object