Vault API Endpoints

GET /api/v1/vaults

List all available vaults with current APY and TVL.

bash
curl https://api.nester.finance/api/v1/vaults
json
{
    "success": true,
    "data": [
        {
            "id": "vault_conservative_01",
            "name": "Conservative",
            "type": "conservative",
            "apy": 7.2,
            "tvl": 250000,
            "total_depositors": 45,
            "status": "active",
            "allocations": [
                { "source": "Blend", "percentage": 60, "apy": 7.0 },
                { "source": "Aave", "percentage": 40, "apy": 7.5 }
            ]
        },
        {
            "id": "vault_balanced_01",
            "name": "Balanced",
            "type": "balanced",
            "apy": 9.5,
            "tvl": 580000,
            "total_depositors": 120,
            "status": "active",
            "allocations": [
                { "source": "Blend", "percentage": 40, "apy": 8.5 },
                { "source": "Kamino", "percentage": 35, "apy": 10.0 },
                { "source": "Aave", "percentage": 25, "apy": 9.0 }
            ]
        }
    ]
}

GET /api/v1/vaults/:id/allocations

Get detailed allocation breakdown for a specific vault.

POST /api/v1/vaults/{id}/deposit

Prepare and record a deposit to a vault.

bash
curl -X POST https://api.nester.finance/api/v1/vaults/vault_balanced_01/deposit \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "1000.00",
    "asset": "USDC"
  }'
json
{
    "success": true,
    "data": {
        "id": "vault_balanced_01",
        "user_id": "8c7d86f0-0b73-45cd-95f3-c5b9bf10e4a7",
        "contract_address": "CB...",
        "total_deposited": "6000.000000",
        "current_balance": "6250.500000",
        "currency": "USDC",
        "status": "active",
        "yield_earned": "250.500000",
        "fees_paid": "0.000000",
        "allocations": [
            {
                "id": "alloc_01_uuid",
                "vault_id": "vault_balanced_01",
                "protocol": "Blend",
                "amount": "2400.00",
                "apy": "8.5",
                "status": "active",
                "allocated_at": "2026-01-15T10:30:00Z"
            }
        ],
        "created_at": "2026-01-15T10:30:00Z",
        "updated_at": "2026-06-02T12:00:00Z"
    }
}

POST /api/v1/vaults/{id}/withdraw

Prepare and record a withdrawal from a vault.

bash
curl -X POST https://api.nester.finance/api/v1/vaults/vault_balanced_01/withdraw \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "500.00",
    "asset": "USDC"
  }'
json
{
    "success": true,
    "data": {
        "id": "vault_balanced_01",
        "user_id": "8c7d86f0-0b73-45cd-95f3-c5b9bf10e4a7",
        "contract_address": "CB...",
        "total_deposited": "5500.000000",
        "current_balance": "5750.500000",
        "currency": "USDC",
        "status": "active",
        "yield_earned": "250.500000",
        "fees_paid": "0.000000",
        "created_at": "2026-01-15T10:30:00Z",
        "updated_at": "2026-06-02T12:00:00Z"
    }
}