Skip to main content

Portals (2.1)

Download OpenAPI specification:Download

Supported

Get a list of supported tokens with optional filters

Returns a list of supported tokens by platform, including contextual information such as decimals, name, network, underlying tokens, price, TVL, etc. Each filter type is concatenated with logical AND. Filter inputs that are arrays are logical OR.

query Parameters
search
string

Optional search string that searches the contents for matches with token name (e.g. "balancer usdc usdt dai")

addresses
Array of strings

Optional addresses to filter. Addresses must be in "[network]:[address]" format. e.g. ethereum:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

ids
string

Optional comma-separated ids to filter

platforms
Array of strings
Items Enum: "native" "basic" "aavev2" "aavev2wrapped" "aavev3" "aerodrome" "agave" "alienbase" "apeswap" "apeswap-lending" "arbitrumexchange" "aura" "babydogeswap" "balancerv2" "balancerv2boosted" "bankerjoe" "baseswap" "beethovenx" "beethovenxboosted" "beefy" "biswap" "benqi" "camelotv2" "compound" "compound-v3" "convex" "curve" "curve-gauges" "dfynv1" "fraxswap" "fluxfinance" "gearbox" "geist" "honeyswap" "ironbank" "kokonutswap" "magnatefinance" "mdex" "mmfinance" "moonwell" "nomiswap" "pancakeswap" "pangolin" "pooltogether" "quickswap" "radiantv2" "rocketswap" "scream" "shibaswap" "sonne-finance" "soswap" "spark" "spiritswap" "spookyswap" "stakedao" "stakedao-vaults" "stakedao-gauges" "stargate" "sushiswap" "swapbased" "swirlend" "synthswap" "thegranary" "traderjoe" "uniswapv2" "uwulend" "velodrome-v2" "venus" "verse" "vesper" "yearn" "yearncrv" "custom"

Optional platforms to filter from

networks
Array of strings
Items Enum: "ethereum" "optimism" "fantom" "arbitrum" "polygon" "avalanche" "bsc" "base" "zksync" "gnosis" "polygon_zkevm"

Optional networks to search from (ethereum, avalanche, etc.) (Default: all)

minLiquidity
number

Optional minimum liquidity/TVL (in USD) available if asset is a pool

maxLiquidity
number

Optional maximum liquidity/TVL (in USD) available if asset is a pool

sortBy
string
Enum: "key" "decimals" "name" "symbol" "updatedAt" "price" "liquidity" "platform" "network" "apy" "volumeUsd1d" "volumeUsd7d"

Optional field to sort items by (Default: sorted by internal id)

sortDirection
string
Default: "asc"
Enum: "asc" "desc"

Optional sort direction (Default: asc)

limit
number
Default: 25

Optional number of items to return (Max: 250)

page
number
Default: 0

Optional page number for batch of items to return. Must also provide limit if page provided. (Default: 0)

tags
string

Optional comma-separated tags to filter

Responses

Response samples

Content type
application/json
{
  • "totalItems": 0,
  • "pageItems": 0,
  • "more": true,
  • "page": 0,
  • "tokens": [
    ]
}

Get a list of supported networks

Returns a list of supported networks

Responses

Response samples

Content type
application/json
[
  • "string"
]

Get a list of supported platforms Deprecated

Returns a list of supported platforms for network

path Parameters
network
required
string
Enum: "ethereum" "optimism" "fantom" "arbitrum" "polygon" "avalanche" "bsc" "base" "zksync" "gnosis" "polygon_zkevm"

The network to use (ethereum, avalanche, etc.)

Responses

Response samples

Content type
application/json
[
  • "string"
]

Get a list of enabled platforms

Returns a list of enabled platforms

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Portal

Create a portal transaction

Returns a validated, unsigned portal transaction that can be submitted to a node via ethers/web3.

query Parameters
sender
required
string

The address of the owner of the inputToken.

inputToken
required
string

The ERC20 token address to spend (e.g. DAI, USDC, etc.). Use address(0) for the native token. Address must be prepended with the network name. (e.g ethereum:0x6B175474E89094C44Da98b954EedeAC495271d0F for DAI)

inputAmount
required
string

The quantity of inputToken to spend in inputToken base units

outputToken
required
string

The ERC20 token address to buy (e.g. a Curve or Sushiswap pool, or a basic token like DAI). Use address(0) for the native token. Address must be prepended with the network name. (e.g. ethereum:0x0000000000000000000000000000000000000000 for the native token)

slippageTolerancePercentage
number

The maximum acceptable slippage for the portal. Must be a number between 0.1 and 10 (e.g. 0.25 for 0.25%, 2 for 2%). If not set, auto slippage will be used instead (requires that validate is set to true)

partner
string

The referral address.

feePercentage
number

The fee to charge for the portal. Must be a percentage between 0 and 1 (e.g. 0.45 for 0.45%). If a fee is used, a partner address must also be provided. Default fee is 0.3%

permitSignature
string

A valid secp256k1 signature of Permit by sender

validate
boolean
Default: true

When true, gas will be estimated and the portal transaction will be validated for success.

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "tx": {
    },
  • "signedOrder": {
    }
}

Submit a signed portal transaction onchain and pays the gas fee on behalf of the user

Returns a transaction hash that can be used to track the status of the transaction. Also returns transaction data for debugging purposes.

query Parameters
orderId
required
string

The order ID received in the PortalV2 response context

signature
required
string

The signed portal order

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "tx": {
    },
  • "signedOrder": {
    }
}

Retrieve portal order

Retrieves previously generated Portal Order

query Parameters
orderId
required
string

The order ID received in the PortalV2 response context

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "tx": {
    },
  • "signedOrder": {
    }
}

Estimate the output of a portal (much faster than /portal endpoint)

Returns the expected and minimum amount to be received as a result of using the portal. Does not guarantee or check valid execution at this price.

query Parameters
inputToken
required
string

The ERC20 token address to spend (e.g. DAI, USDC, etc.). Use address(0) for the native token. Address must be prepended with the network name. (e.g ethereum:0x6B175474E89094C44Da98b954EedeAC495271d0F for DAI)

inputAmount
required
string

The quantity of inputToken to spend

outputToken
required
string

The ERC20 token address to buy (e.g. a Curve or Sushiswap pool, or a basic token like DAI). Use address(0) for the native token. Address must be prepended with the network name. (e.g. ethereum:0x0000000000000000000000000000000000000000 for the native token)

slippageTolerancePercentage
number

The maximum acceptable slippage for the portal. Must be a number between 0.1 and 10 (e.g. 0.25 for 0.25%, 2 for 2%).

Responses

Response samples

Content type
application/json
{
  • "outputToken": "string",
  • "outputAmount": "string",
  • "minOutputAmount": "string",
  • "outputTokenDecimals": 0
}

Check portal allowances and approve if needed

Returns the current allowance for the appropriate target based on buyToken, in addition to an unsigned approval transaction for use by takerAddress if the returned property shouldApprove is true

query Parameters
sender
required
string

The address of the owner.

inputToken
required
string

The token key to spend. Use address(0) for the native token. Address must be prepended with the network name. (e.g ethereum:0x6B175474E89094C44Da98b954EedeAC495271d0F for DAI)

inputAmount
required
string

The quantity of inputToken to spend

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "approve": {
    },
  • "permit": {
    }
}

Account

Get token balances

Returns the current balance for ERC20 or network tokens for the ownerAddress if the balance is greater than 0

query Parameters
owner
required
string

Required address of the owner of the ERC20 token whose balance is being queried

networks
required
Array of strings
Items Enum: "ethereum" "optimism" "fantom" "arbitrum" "polygon" "avalanche" "bsc" "base" "zksync" "gnosis" "polygon_zkevm"

Required list of networks to search from (ethereum, avalanche, etc.)

Responses

Response samples

Content type
application/json
{
  • "totalQueried": 0,
  • "balances": [
    ]
}

Farm 🧑‍🌾 [BETA]

Get an unsigned {stake/unstake/exit/claim} transaction for the requested platform and token

query Parameters
id
required
string

ID of the opportunity to perform the action on

takerAddress
required
string

User address

amount
string

Amount of tokens

action
required
string
Enum: "stake" "unstake" "claim" "exit"

Type of action

validate
boolean
Default: true

When true, gas will be estimated and the transaction will be validated for success.

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "tx": {
    }
}

Returns the current allowance for the appropriate target based on the stake `action`, in addition to an unsigned approval transaction if the context property `shouldApprove` is true

query Parameters
id
required
string

ID of the opportunity to perform the action on

takerAddress
required
string

User address

amount
string

Amount of tokens

action
required
string
Enum: "stake" "unstake" "claim" "exit"

Type of action

validate
boolean
Default: true

When true, gas will be estimated and the transaction will be validated for success.

Responses

Response samples

Content type
application/json
{
  • "context": {
    },
  • "tx": {
    }
}

Get a list of all farming opportunities

query Parameters
search
string

Optional search string that searches the contents for matches with token name (e.g. "balancer usdc usdt dai")

ids
string

Optional comma-separated unique ids of the opportunities to query

tokens
string

Optional comma-separated list of keys of the tokens to stake, in [network]:[address] format

rewards
string

Optional comma-separated list of keys for the rewards to filter by (farm should reward at least one of these), in [network]:[address] format

networks
string

Optional comma-separated list of networks to select from (ethereum, avalanche, etc.)

platforms
string

Optional comma-separated list of platforms to select from

minLiquidity
number

Optional minimum liquidity/TVL (in USD) in the farm

maxLiquidity
number

Optional maximum liquidity/TVL (in USD) in the farm

sortBy
required
string
Default: "apr"
Enum: "platform" "tvl" "total" "apr" "name"

Field to sort items by (Default: apr)

sortDirection
required
string
Default: "desc"
Enum: "asc" "desc"

Sort direction (Default: desc)

limit
required
number
Default: 25

Number of items to return (Max: 250)

page
required
number
Default: 0

Page number for batch of items to return. Must also provide limit if page provided. (Default: 0)

Responses

Response samples

Content type
application/json
{
  • "totalItems": 0,
  • "pageItems": 0,
  • "more": true,
  • "page": 0,
  • "opps": [
    ],
  • "rewards": [
    ]
}

Get the farming positions for the user

query Parameters
takerAddress
required
string

User address

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get information on supported farms

query Parameters
platform
string

Platform ID

opportunities
boolean

If true return tokens and their opportunities in each farm

Responses

Response samples

Content type
application/json
[
  • {
    }
]