How to repay a loan
In this section, you'll learn how to request ready-to-use transaction data (bytecode) for repaying a loan.
Prerequisites
How to Repay a Loan
Use this when you want to work with a specific lending protocol.
Request Transaction Data Fetch specific protocol information using:
GET /strategies/:id/bytecodeRequired Parameters:
ParameterDescriptionExampleaction
Type of operation
repaychainId
Blockchain network ID
137(Polygon)protocol
Protocol name
aaveamount
Repay amount
10000000(with decimals)asset
Asset to repay
USDCloanId
ID of the loan
123456Example Request:
GET /strategies/3341412233111/bytecode?action=repay&chainId=137&protocol=aave&amount=10000000&asset=USDC&loanId=123456Response:
{ "bytecode": [ { "to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359", "value": "0", "data": "0xa9059cbb0000000000000000000000005900efdd79bc1541cf1f9fd0f56c0a869194430300000000000000000000000000000000000000000000000000000000000003e8" }, { "to": "0x794a61358D6845594F94dc1DB02A252b5b4814aD", "value": "0", "data": "0x573ade81000000000000000000000000000000000000000000000000000000000000000" } ] }
Our API returns the transaction data as an array of objects. Each object contains to, value, and data fields.
Next Steps
Last updated