POST
/
markets
/
creditbook
/
swap_collateral
Swap collateral
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/creditbook/swap_collateral \
  --header 'Content-Type: application/json' \
  --data '{
  "loan": "<string>",
  "withdrawCollateral": [
    {
      "amount": 123,
      "collateralMint": "<string>"
    }
  ],
  "depositCollateral": [
    {
      "collateralAmount": 123,
      "collateralAssetData": {
        "Spl": {
          "mint": "<string>"
        }
      }
    }
  ],
  "cpiIxs": [
    {
      "programId": "<string>",
      "accounts": [
        {
          "pubkey": "<string>",
          "isSigner": true,
          "isWritable": true
        }
      ],
      "data": "<string>"
    }
  ],
  "cpiLuts": [
    "<string>"
  ],
  "cpiSigners": [
    "<string>"
  ]
}'
{
  "message": "<string>",
  "signatures": [
    {
      "publicKey": "<string>",
      "signature": "<string>"
    }
  ]
}

Body

application/json

Response

200
application/json

Single versioned transaction message and signatures

The response is of type object.