Strategies

Build transactions to back a pair on Solana

Builds one backing transaction per Orca or Raydium strategy of a pair from one request, for the owner's wallet to sign. Both amounts at `0` end those backings instead.

POST
/api/solana/vaults/prepare-set-commitments

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/solana/vaults/prepare-set-commitments" \  -H "Content-Type: application/json" \  -d '{    "owner": "11111111111111111111111111111111",    "tokens": [      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",      "myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv"    ],    "amounts": [      "12000000",      "50000000"    ],    "tickLower": -15200,    "tickUpper": -13200,    "backings": [      {        "strategy": "2doUkP9hcAgiDJhpAXZrcWZQRhF1GS7rXXkFyjmUmFHH"      },      {        "strategy": "2azNKUt7vLEryzoqgh3EEtQP83h9R6xv9qdrmud998tv"      }    ]  }'
{  "owner": "11111111111111111111111111111111",  "transactions": [    {      "strategy": "AEFrumJC9heBMrxjkhQneUpMpCWhmyqfBUczaYCSnaQa",      "venue": "orca",      "pool": "2AW9cYg6sGwMqkHczyxWRZXYErM7UTMgVcZfDj8J2gLg",      "index": 0,      "action": "commit",      "requestId": "6f0c2f7e-2a0b-4b8e-9b54-0c2d7f0f5a11",      "transaction": "AQ==",      "expiresAt": "2030-01-01T00:00:00.000Z"    },    {      "strategy": "Zm3ZkMbBvvWDa3D3qUicqcDCFoe4giTFsCvZ3YZzRra",      "venue": "raydium",      "pool": "GqxUEcFw8GbfDPoWU6UG2ypvsM3aw3vZmiN4e1Nbv94G",      "index": 0,      "action": "commit",      "requestId": "0b6d3c8a-5f1e-4c2a-9a7e-3d8b1f4e6c20",      "transaction": "AQ==",      "expiresAt": "2030-01-01T00:00:00.000Z"    }  ]}
{  "error": "INVALID_REQUEST",  "code": "INVALID_REQUEST",  "message": "owner: Invalid input: expected string, received undefined",  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}
{  "error": "STRATEGY_NOT_FOUND",  "code": "STRATEGY_NOT_FOUND",  "message": "no aqua0 strategy at 2azNKUt7vLEryzoqgh3EEtQP83h9R6xv9qdrmud998tv",  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}
{  "error": "NO_PRINCIPAL_TO_COMMIT",  "code": "NO_PRINCIPAL_TO_COMMIT",  "message": "no principal in the EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v vault to back with",  "details": {    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"  },  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}

{  "error": "ASSET_NOT_IN_PAIR",  "code": "ASSET_NOT_IN_PAIR",  "message": "strategy 2azNKUt7vLEryzoqgh3EEtQP83h9R6xv9qdrmud998tv trades another pair",  "details": {    "strategy": "2azNKUt7vLEryzoqgh3EEtQP83h9R6xv9qdrmud998tv",    "mints": "myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"  },  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}

{  "error": "SERVICE_UNAVAILABLE",  "code": "SERVICE_UNAVAILABLE",  "message": "Solana cannot be read right now. Try again shortly.",  "details": {    "retryAfterSeconds": 2  },  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}