Markets

Build a market's setup on Solana

Builds the transactions that set up an Orca or Raydium market and its strategy, for the owner's wallet to sign and send in order. When `ready` is false, send them and call again.

POST
/api/solana/strategies/pools/setup

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/strategies/pools/setup" \  -H "Content-Type: application/json" \  -d '{    "owner": "11111111111111111111111111111111",    "venue": "orca",    "tokenA": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",    "tokenB": "myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv",    "config": "2LecshUwdy9xi7meFgHtFJQNSKk4KdTrcpvaB56dP2NQ",    "tickSpacing": 16,    "feeTierIndex": 16,    "tickLower": -15200,    "tickUpper": -13200  }'
{  "pool": "2AW9cYg6sGwMqkHczyxWRZXYErM7UTMgVcZfDj8J2gLg",  "strategy": "AEFrumJC9heBMrxjkhQneUpMpCWhmyqfBUczaYCSnaQa",  "ready": true,  "payer": "owner",  "lamports": "7863920",  "transactions": [    {      "requestId": "6f0c2f7e-2a0b-4b8e-9b54-0c2d7f0f5a11",      "transaction": "AQ==",      "expiresAt": "2030-01-01T00:00:00.000Z",      "step": "tick-arrays",      "feePayer": "11111111111111111111111111111111",      "lamports": "3851920"    },    {      "requestId": "0b6d3c8a-5f1e-4c2a-9a7e-3d8b1f4e6c20",      "transaction": "AQ==",      "expiresAt": "2030-01-01T00:00:00.000Z",      "step": "strategy",      "feePayer": "11111111111111111111111111111111",      "lamports": "4012000"    }  ]}
{  "error": "INVALID_REQUEST",  "code": "INVALID_REQUEST",  "message": "owner: Invalid input: expected string, received undefined",  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}
{  "error": "VAULT_NOT_FOUND",  "code": "VAULT_NOT_FOUND",  "message": "no aqua0 vault for myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv",  "details": {    "asset": "myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv"  },  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}
{  "error": "VAULT_PAUSED",  "code": "VAULT_PAUSED",  "message": "a vault of this market is paused, so it takes no new market",  "details": {    "pool": "FvLPJwGkSiiR6J5TSqFRZPjwtHQHtA6a4n1mwoh6ozC2",    "mints": "myrcAs6bpP2g5oGHZ3qpgrfZQAFkbo9KUHdqYDXMjGv"  },  "requestId": "3f2b8c1e-7a4d-4e9b-b6c5-0d1e2f3a4b5c"}
{  "error": "INSUFFICIENT_SOL",  "code": "INSUFFICIENT_SOL",  "message": "setting up this market needs 0.0612 SOL in your wallet, and it holds 0.0100",  "details": {    "pool": "FvLPJwGkSiiR6J5TSqFRZPjwtHQHtA6a4n1mwoh6ozC2",    "lamports": "61240000",    "ownerLamports": "10000000",    "shortLamports": "51240000"  },  "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"}