> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotstuff.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Redeem from Vault

> Send POST request to /exchange, or use the ExchangeClient SDKs.

Use the ExchangeClient `redeemFromVault` method to redeem shares from a vault and receive collateral.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.hotstuff.trade/exchange \
    --header 'Content-Type: application/json' \
    --data '{
      "action": {
        "data": {
          "vaultAddress": "0x1234567890123456789012345678901234567890",
          "shares": "50.0",
          "nonce": 1769691075449
        },
        "type": "1402"
      },
      "signature": "0xc1aa6c72696fe7396404049143da22d26301a565d3b9cdcab36ac5872def6a89...",
      "nonce": 1769691075449
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "tx_hash": "0xa04e3a17347b9561983107ce39ae6671d6a20a787a20427d07094c6ab7b7543e",
    "tx_type": 1402,
    "error": "",
    "data": {
      "assets_redeemed": "50.0"
    },
    "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
  }
  ```
</ResponseExample>

### Request body

<ParamField body="action" type="object" required>
  ```
  {
    "data": {
      "vaultAddress": String,
      "shares": String,
      "nonce": Number
    },
    "type": String
  }
  ```
</ParamField>

<ParamField body="signature" type="string" required>
  Signed payload in hexadecimal format
</ParamField>

<ParamField body="nonce" type="number" required>
  Current timestamp in milliseconds
</ParamField>


## OpenAPI

````yaml openapi/exchange/vaults/redeem-from-vault.json POST /exchange
openapi: 3.0.3
info:
  title: Hotstuff Exchange API — Redeem from Vault
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
security: []
paths:
  /exchange:
    post:
      summary: Redeem from Vault
      operationId: exchangeVaultsRedeemFromVault
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        vaultAddress:
                          type: string
                        shares:
                          type: string
                        nonce:
                          type: integer
                      required:
                        - vaultAddress
                        - shares
                        - nonce
                    type:
                      type: string
                  required:
                    - data
                    - type
                signature:
                  type: string
                nonce:
                  type: integer
              required:
                - action
                - signature
                - nonce
              example:
                action:
                  data:
                    vaultAddress: '0x1234567890123456789012345678901234567890'
                    shares: '50.0'
                    nonce: 1769691075449
                  type: '1402'
                signature: >-
                  0xc1aa6c72696fe7396404049143da22d26301a565d3b9cdcab36ac5872def6a89...
                nonce: 1769691075449
            examples:
              default:
                summary: Example request
                value:
                  action:
                    data:
                      vaultAddress: '0x1234567890123456789012345678901234567890'
                      shares: '50.0'
                      nonce: 1769691075449
                    type: '1402'
                  signature: >-
                    0xc1aa6c72696fe7396404049143da22d26301a565d3b9cdcab36ac5872def6a89...
                  nonce: 1769691075449
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tx_hash:
                    type: string
                  tx_type:
                    type: integer
                  error:
                    type: string
                  data:
                    type: object
                    properties:
                      assets_redeemed:
                        type: string
                    required:
                      - assets_redeemed
                  address:
                    type: string
              example:
                tx_hash: >-
                  0xa04e3a17347b9561983107ce39ae6671d6a20a787a20427d07094c6ab7b7543e
                tx_type: 1402
                error: ''
                data:
                  assets_redeemed: '50.0'
                address: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'

````