shortcuts/route/nontokenized endpoint constructs an optimal conversion route. This API allows entering a non-tokenized DeFi position from any ERC20 or native token.
Authentication
- Create an API key using Enso Dashboard.
- Securely store your API key and make it available in your environment:
authentication.sh
API Parameters
Required Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
chainId | number | Chain ID of the network to execute the transaction on | 999 |
fromAddress | string | The address making the request | 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 |
tokenIn | string | Ethereum address of the token to swap from. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
positionOut | string | Ethereum address of the position to receive | 0x200000000000000000000000000000000000010C |
amountIn | string | Amount of tokenIn to swap in wei | 100000000000000000000 |
receiver | string | Ethereum address of the receiver of the positionOut | 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 |
Optional Parameters
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
routingStrategy | string | Routing strategy to use (router, delegate, delegate-legacy) | "router" | "delegate" |
slippage | string | Slippage in basis points (1/10000) | "50" (0.5%) | "300" (3%) |
referralCode | string | Referral code for on-chain event tracking | - | "0123456789ABCDEF" |
destinationChainId | number | Chain ID to bridge to and receive nontokenized position | - | 10 |
fee | string | Fee in basis points (1/10000) for each amountIn value | - | 100 (1%) |
feeReceiver | string | Ethereum address to receive collected fees (required if fee is provided) | - | 0x220866B1A2219f40e72f5c628B65D54268cA3A9D |
spender | string | Ethereum address of the spender of the tokenIn | - | 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 |
refundReceiver | string | Ethereum address to receive any dust tokens produced during execution | - | 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 |
Response Schema
The API returns a non-tokenized route with the following fields:| Field | Type | Description |
|---|---|---|
createdAt | number | Block number the transaction was created on |
gas | string | Gas estimate for the transaction |
amountDeposited | string | Amount of value allocated to the position after the transaction completes |
priceImpact | number | null | Price impact in basis points (1/10000). Returns null if calculation is unavailable |
tx | Transaction | The transaction object with to, data, and other fields |
route | Hop[] | The route the shortcut will use |
feeAmount | string[] | Array of fee amounts charged |
ensoFeeAmount | string[] | Array of Enso platform fees charged |
userOp | UserOperation | The ERC-4337 user operation object (if applicable) |
Discovering Non-Tokenized Positions
To find available non-tokenized positions for routing, use the GET/api/v1/nontokenized endpoint to query the registry of supported non-tokenized positions.
Query Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
project | string | The overarching project or platform | "hypercore" |
protocolSlug | string | The specific standard integration or version | "hypercore-spot" |
chainId | number | Chain ID of the network | 999 |
address | string[] | Ethereum addresses of the positions | ["0x200000000000000000000000000000000000010C"] |
primaryAddress | string[] | Ethereum addresses for contract interaction | ["0x200000000000000000000000000000000000010C"] |
page | number | Pagination page number (1000 results per page) | 1 |
cursor | number | Cursor for pagination | 0 |
Response Schema
The API returns an array of non-tokenized positions with the following fields:| Field | Type | Description |
|---|---|---|
chainId | number | Chain ID of the network of the position |
protocol | string | The specific standard integration or version |
address | string | Ethereum address of the non-tokenized position |
primaryAddress | string | Ethereum address for contract interaction |
underlyingTokens | TokenModel[] | Underlying tokens of the position (may be null) |
Example Usage
Use the
address field from the discovery endpoint response as the
positionOut parameter in the routing endpoint.Example: Depositing into Hypercore
Here’s an example of how to route funds to deposit into a Hypercore position: Example: Depositing 100 HYPE into a Hypercore USDT- Input: 100 HYPE
- Output: Hypercore USDT position
- Chain: 999 (HyperEVM)
cURL
chainId: 999 (Hypercore chain)tokenIn:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee(ETH)positionOut:0x200000000000000000000000000000000000010C(Hypercore USDT position)amountIn:100000000000000000000(100 HYPE in wei)receiver: The address that will receive the position
Example: Cross-Chain Bridge to Hypercore
Here’s an example of how to bridge funds from Ethereum to a Hypercore position: Example: Bridging 0.5 ETH from Ethereum to HYPE Hypercore position- Input: 0.5 ETH (Ethereum)
- Output: HYPE Hypercore position
- Source Chain: 1 (Ethereum)
- Destination Chain: 999 (HyperEVM)
cURL
chainId: 1 (Ethereum - source chain)destinationChainId: 999 (HyperEVM - destination chain)tokenIn:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee(ETH on Ethereum)positionOut:0x2222222222222222222222222222222222222222(HYPE position on HyperEVM)amountIn:500000000000000000(0.5 ETH in wei)referralCode:0123456789ABCDEF(optional referral tracking)receiver: The address that will receive the position on the destination chain
Next steps
- Explore the Shortcuts Library for common DeFi workflows.
- Check out the API Reference for full parameter details
Updated
