Skip to main content
POST
/
markets
/
creditbook
/
repay_simple
Simple repay loan
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/creditbook/repay_simple \
  --header 'Content-Type: application/json' \
  --header 'payer: <payer>' \
  --data '
{
  "loan": "<string>",
  "repayParams": {
    "amount": 123,
    "ledgerIndex": 123,
    "repayAll": true
  },
  "strategy": "<string>",
  "weightMatrixUpdates": [
    {
      "weightMatrixUpdate": [
        123
      ],
      "collateralIndex": 123
    }
  ],
  "isLoop": true
}
'
{
  "transactions": [
    {
      "message": "<string>",
      "signatures": [
        {
          "publicKey": "<string>",
          "signature": "<string>"
        }
      ]
    }
  ],
  "expectedLoanInfo": {
    "loan": {
      "address": "<string>"
    }
  }
}

Headers

payer
string
required

Wallet that pays transaction fees for the repay transaction.

Body

application/json
loan
string
required

Address of the loan to repay.

repayParams
object
required

Repayment parameters for the targeted ledger.

strategy
string
required

Address of the strategy (vault) to repay against.

weightMatrixUpdates
object[]

Optional weight matrix updates. If omitted and a ledger is fully repaid on a multi-ledger loan, these are auto-generated.

isLoop
boolean

Optional flag indicating whether this repayment is part of a loop transaction.

Response

Serialized transactions and expected post-repayment loan state.

transactions
object[]
expectedLoanInfo
object

Loan post transaction state used for verification