Lock and withdraw liquidity
Build the transactions that lock liquidity into an asset vault and withdraw it.
Each asset has one asset vault per chain. Aqua0 builds the transactions, and the liquidity provider signs and sends
them. A wallet's positions on any chain, Solana included, come from GET /api/vaults/positions/{chainId}/{lp}.
Lock
curl -X POST "$AQUA0_API/api/vaults/8453/0x<asset>/prepare-deposit" \
-H "X-API-Key: $AQUA0_API_KEY" -H "Content-Type: application/json" \
-d '{ "amount": "1000000", "owner": "0x<wallet>" }'Send each transaction in calls, in order, from sender. When requiresApproval is true, the first one is the token
approval.
Withdraw
curl -X POST "$AQUA0_API/api/vaults/8453/0x<asset>/prepare-withdraw" \
-H "X-API-Key: $AQUA0_API_KEY" -H "Content-Type: application/json" \
-d '{ "amount": "1000000", "owner": "0x<wallet>" }'A withdrawal is one transaction, up to the wallet's free balance, freePrincipal in
GET /api/vaults/positions/{chainId}/{lp}.
Backing a Uniswap V4 strategy does not reduce the free balance. A slice backing a 1inch Aqua range, and liquidity held by a cross-chain swap in progress, return to it once they settle.
Lock
curl -X POST "$AQUA0_API/api/solana/vaults/transactions" \
-H "X-API-Key: $AQUA0_API_KEY" -H "Content-Type: application/json" \
-d '{ "action": "deposit", "owner": "<wallet>", "asset": "<mint>", "amount": "1000000" }'The response has requestId and the unsigned transaction in base64. Sign it in the wallet without changing it, then
send it.
curl -X POST "$AQUA0_API/api/solana/vaults/transactions/<requestId>/submit" \
-H "X-API-Key: $AQUA0_API_KEY" -H "Content-Type: application/json" \
-d '{ "signedTransaction": "<base64>" }'Poll GET /api/solana/vaults/transactions/{requestId} until status reads confirmed, failed or expired.
Withdraw
The same calls with "action": "withdraw", up to the wallet's free balance, freePrincipal in
GET /api/vaults/positions/1151111081099710/{wallet}.
The wallet pays the network fee and any rent.