Every request requires specifying the following headers:

  • x-api-key

  • chain-id

Get your API key

The 31Third API is available under https://api.31third.com.

Swagger documentations can be found under:

The following chains are currently supported:


Ethereum Mainnet


Polygon Mainnet


OP Mainnet


[SOON] Base


[SOON] Arbitrum One


[SOON] Blast


[SOON] BNB Smart Chain


31Third API flow

The API flow for integrators looks as follows. All the steps are described in more details below.

Please note that the endpoints used in the picture are for basic wallet rebalancings, however similar endpoints exist for Enzyme vaults as well.

Step 1: Assets

You can either use your own or some external service to load token/asset data or use 31Third's asset endpoints. If you use some external source keep in mind that what don't support all existing tokens, so a rebalancing calculation might fail.

More details on assets:

Step 2: Settings


31Third supports multiple liquidity sources. The available sources can be fetched and then be used to configure the rebalancing calculation.

More details on settings:


Step 3: Configure rebalancing

This can either be done by a user via an UI or through a script.

Step 4: Calculate rebalancing

Calculate the rebalancing with the 31Third API. It's possible to calculate rebalancings for wallets or protocol contracts (e.g. Enzyme vaults).

More details on rebalancings:

Step 4.1: async

The calculation of rebalancings might take some seconds depending on how many assets are involved. Therefore all rebalancing endpoints have the option to calculate them async, show the progress to the user and then receive the rebalancing when the calculation is done.

More details on async:

Step 5: Show rebalancing

Show rebalancing with details to the user. Or if you use a script maybe do some checks or analysis on top.

Step 6: Refresh Quotes

After you calculated a rebalancing it might be that you have to refresh quotes. For example if you have a user interface and user don't directly execute received rebalancings.

More details on refreshing quotes:

Step 7: Sign and execute

Users can now sign and execute the rebalancing on-chain. The following 3 params may be used for that:


the contract address where the the data should be sent to


the calldata to send to the contract


the native currency value sent with the tx (optional)

Last updated