Skip to main content
POST
/
markets
/
creditbook
/
borrow
Borrow principal
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/creditbook/borrow \
  --header 'Content-Type: application/json' \
  --header 'payer: <payer>' \
  --data '
{
  "loan": "<string>",
  "borrowParams": {
    "amount": 123,
    "expectedLoanValues": {
      "expectedApy": 123,
      "expectedLqt": [
        123
      ]
    },
    "assetIndexGuidance": [
      123
    ],
    "duration": 123,
    "skipSolUnwrap": true
  },
  "strategy": "<string>",
  "refinanceParams": {
    "ledgerIndex": 123,
    "durationIndex": 123,
    "assetIndexGuidance": [
      123
    ]
  },
  "isLoop": true
}
'
{
  "message": "<string>",
  "signatures": [
    {
      "publicKey": "<string>",
      "signature": "<string>"
    }
  ]
}

Headers

payer
string
required

Wallet that pays transaction fees for the borrow transaction.

Body

application/json
loan
string
required

Loan address to borrow against.

borrowParams
object
required
strategy
string
required

Strategy address to borrow from.

refinanceParams
object
isLoop
boolean

Optional loop marker used internally by Loopscale.

Response

Serialized transaction for borrowing additional principal.

message
string
required

Base64-encoded versioned transaction message

signatures
object[]
required