How to execute a new loan
In this section, you'll learn how to request ready-to-use transaction data (bytecode) for a new loan.
Prerequisites
As in the How to Quote for a New Loan section, you can choose either the explicit path or the protocol-agnostic (less explicit) path to get the transaction data.
A) Protocol-Specific Approach (Explicit)
Use this when you want to work with a specific lending protocol.
Request Transaction Data Fetch specific protocol information using:
GET /strategies/:id/bytecodeRequired Parameters:
ParameterDescriptionExampleaction
Type of operation
borrowchainId
Blockchain network ID
137(Polygon)protocol
Protocol name
aaveamount
Borrow amount
10000000(with decimals)asset
Asset to borrow
USDCcollateralAsset
Collateral asset
ETHcollateralAmount
Amount of collateral
900000000000000000000000(0.009 ETH with decimals)Example Request:
GET /strategies/3341412233111/bytecode?action=borrow&chainId=137&protocol=aave&amount=10000000&asset=USDC&collateralAsset=ETH&collateralAmount=900000000000000000000000Response:
{ "bytecode": [ { "to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", "value": "0", "data": "0xa9059cbb0000000000000000000000005900efdd79bc1541cf1f9fd0f56c0a869194430300000000000000000000000000000000000000000000000000000000000003e8" }, { "to": "0x794a61358D6845594F94dc1DB02A252b5b4814aD", "value": "0", "data": "0x617ba0370000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c335900000000000000000000000000000000000000000000000000000000000f3e58000000000000000000000000d90aa547a8c6b535e8cdce7b67f01b41035d925e0000000000000000000000000000000000000000000000000000000000000000" } ] }
Our API returns the transaction data as an array of objects. Each object contains to, value, and data fields.
B) Protocol-Agnostic Approach (Less Explicit)
Let our system automatically select the optimal protocol for your needs.
Use the Generic Endpoint
GET /strategies/0x0/bytecodeUse the same parameters as the explicit approach above, excluding protocol.
Example Request:
GET /strategies/0x0/bytecode?action=borrow&chainId=137&amount=10000000&asset=USDC&collateralAsset=ETH&collateralAmount=900000000000000000000000The response format will be identical to the explicit approach.
Execute the Transaction You'll need to sign and propagate the transaction data to the blockchain. This happens on your end - we don't touch your funds, custody remains yours.

Next Steps
After executing the loan, you can:
Last updated