Overview
Last updated
Last updated
The 31Third API is available under https://api.31third.com.
Swagger documentations can be found under:
General: https://api.31third.com/0.1/api
The following chains are currently supported:
Name | Id |
---|---|
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.
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:
(COMING SOON)
31Third supports multiple liquidity sources. The available sources can be fetched and then be used to configure the rebalancing calculation.
More details on settings:
COMING SOON
This can either be done by a user via an UI or through a script.
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:
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:
Show rebalancing with details to the user. Or if you use a script maybe do some checks or analysis on top.
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:
Users can now sign and execute the rebalancing on-chain. The following 3 params may be used for that:
Ethereum Mainnet
0x1
Polygon Mainnet
0x89
OP Mainnet
0xa
[SOON] Base
0x2105
[SOON] Arbitrum One
0xa4b1
[SOON] Blast
0x13e31
[SOON] BNB Smart Chain
0x38
txHandler
the contract address
where the the data should be sent to
txData
the calldata
to send to the contract
txValue
the native currency value
sent with the tx (optional)