Strategies

Build transactions to set an LP's positions

Returns one `setCommitments` transaction per asset vault that commits, resizes or clears the LP's positions on a pair. A refused position answers 422 with the rule it breaks.

POST
/api/vaults/{chainId}/prepare-set-commitments

Authorization

ApiKeyAuth
X-API-Key<token>

Your API key. Authorizing a swap or opening a market takes a key issued to your integration, and the shared key the docs fill in reads and quotes only.

In: header

Path Parameters

chainId*integer

The chain's numeric id, for example 8453 for Base. GET /api/vaults/chains lists them.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/vaults/1/prepare-set-commitments" \  -H "Content-Type: application/json" \  -d '{    "lp": "0x1111111111111111111111111111111111111111",    "groups": [      {        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",        "expectedVault": "0xb367A4306087d3981B38C032464cD7E3A7a03A4E",        "updates": [          {            "strategyId": "38960560214548620419581884607967218229413556116830054641371650059665611327033",            "position": 0,            "amount": "100000000",            "tickLower": -199140,            "tickUpper": -197100          }        ]      }    ]  }'
{  "calls": [    {      "to": "0xb367A4306087d3981B38C032464cD7E3A7a03A4E",      "data": "0xd94ee4c6000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000015622e547d200169623684248c4e4ac258688aea6dd540acf5fb26965861e863900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f5e100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcf61cfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfe14",      "value": "0",      "description": "Back strategy 38960560214548620419581884607967218229413556116830054641371650059665611327033 position 0 with 100000000 from this asset vault"    }  ]}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}
{  "error": "string",  "code": "string",  "message": "string",  "details": {},  "requestId": "string"}