# Look up bond assets

`POST /sigmafi/assets` · Lithos client API · SigmaFi Bonds

Source: https://lithosprotocol.org/docs/api/lookup-sf-assets

Whether each token is a SigmaFi bond asset, read from the chain and never from its name or description: the order that minted it, the bond it claims while that is live, and what the vault holds for it once settled. Up to 50 token ids.

## Request body

`SFAssetLookupRequest`, application/json.

- `tokenIds` (string[], required)

## Responses

### 200: One entry per token id, in the order asked

`SFAssetLookup[]`

- `tokenId` (string, required)
- `bondAsset` (boolean, required): Whether a SigmaFi order minted it.
- `verified` (boolean, required)
- `verification` (string)
- `bond` (SFBondView)
  - `boxId` (string, required)
  - `assetId` (string, required): The bond asset whose holder is paid.
  - `terms` (SFTerms, required): A bond's terms, as its order states them and the bond carries them.
    - `kind` (string, required): The bond's kind. Every SigmaFi V2 bond is `zero-coupon`.
    - `principalNanoErgs` (string): Agreed nanoERG lent; for a token loan, the principal box's floor. Read directly from a bond's R6.
    - `principalToken` (SFTokenAmount)
      - `tokenId` (string, required)
      - `amount` (string, required): Base units.
    - `repayment` (string, required): What the borrower repays, in nanoERG or in base units of `repayToken`.
    - `repayToken` (string): The token a token loan is repaid in. Absent when repaid in ERG.
    - `collateralNanoErgs` (string, required): Borrower collateral nanoERG, excluding the lender-funded reserve.
    - `collateralTokens` (SFTokenAmount[], required)
    - `maturityHeight` (integer · int64): Repayment is open strictly below it. Absent for an on-close order until it is filled.
    - `durationBlocks` (integer · int64): An on-close order's term, counted from its fill.
    - `batchingFee` (string, required): Lender-funded reserve selected on fill; zero on unfilled orders. Refunded on repayment.
    - `liquidation` (string): The liquidation script's name. Absent when this client does not know it.
    - `liquidationHash` (string, required)
  - `verified` (boolean, required): Whether this is the bond its asset's genesis order created.
  - `verification` (string): Why it is not verified.
  - `status` (string, required, one of open, matured)
  - `blocksLeft` (integer · int64, required): Blocks before repayment closes. 0 once matured.
  - `borrowerIsMe` (boolean, required)
  - `creationHeight` (integer, required)
- `vault` (SFVaultView[], required)
  - `boxId` (string, required)
  - `bondId` (string): The bond this box settles.
  - `assetId` (string, required)
  - `nanoErgs` (string, required)
  - `tokens` (SFTokenAmount[], required)
- `status` (string, required, one of Open, Matured, Repaid, Liquidated, Unknown, Unverified): Confirmed indexed bond state. Repaid and Liquidated are established from the actual spend, tagged payout and singleton burn, not inferred from maturity or absence in the live scan. Unknown means the index or spend evidence is incomplete or the spend used a rent extension.
- `settlement` (SFSettlement): Historical confirmed settlement, available even after the vault output is claimed.
  - `txId` (string, required)
  - `height` (integer, required)
  - `timestamp` (integer · int64): Confirmed block timestamp in milliseconds, when the index provides it.
  - `bondBoxId` (string, required)
  - `vault` (SFVaultView, required)
  - `returnedCollateral` (SFBoxValue)
    - `boxId` (string, required)
    - `nanoErgs` (string, required)
    - `tokens` (SFTokenAmount[], required)
  - `liquidationHash` (string): Authenticated liquidation expression hash; present for Liquidated, absent for Repaid.
- `statusReason` (string): Why a verified asset's current settlement state could not be established.

### 400: A malformed field, or terms no contract or shipped client accepts.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### 503: Node or index unavailable. Never returns a partial answer.

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X POST "http://localhost:9000/sigmafi/assets" \
  -H "Content-Type: application/json" \
  -d '{ "tokenIds": [ "string" ] }'
```

## Example response

```json
[
  {
    "tokenId": "string",
    "bondAsset": true,
    "verified": true,
    "verification": "string",
    "bond": {
      "boxId": "string",
      "assetId": "string",
      "terms": {
        "kind": "string",
        "principalNanoErgs": "string",
        "principalToken": {
          "tokenId": "string",
          "amount": "string"
        },
        "repayment": "string",
        "repayToken": "string",
        "collateralNanoErgs": "string",
        "collateralTokens": [
          {
            "tokenId": "string",
            "amount": "string"
          }
        ],
        "maturityHeight": 0,
        "durationBlocks": 0,
        "batchingFee": "string",
        "liquidation": "string",
        "liquidationHash": "string"
      },
      "verified": true,
      "verification": "string",
      "status": "open",
      "blocksLeft": 0,
      "borrowerIsMe": true,
      "creationHeight": 0
    },
    "vault": [
      {
        "boxId": "string",
        "bondId": "string",
        "assetId": "string",
        "nanoErgs": "string",
        "tokens": [
          {
            "tokenId": "string",
            "amount": "string"
          }
        ]
      }
    ],
    "status": "Open",
    "settlement": {
      "txId": "string",
      "height": 0,
      "timestamp": 0,
      "bondBoxId": "string",
      "vault": {
        "boxId": "string",
        "bondId": "string",
        "assetId": "string",
        "nanoErgs": "string",
        "tokens": [
          {
            "tokenId": "string",
            "amount": "string"
          }
        ]
      },
      "returnedCollateral": {
        "boxId": "string",
        "nanoErgs": "string",
        "tokens": [
          {
            "tokenId": "string",
            "amount": "string"
          }
        ]
      },
      "liquidationHash": "string"
    },
    "statusReason": "string"
  }
]
```
