Aquarius Documentation
  • Aquarius Loan Documentation
  • Getting Started
    • Networks
    • Protocol Math
      • aToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • Gas Costs
  • ATokens
    • Mint
    • Redeem
    • Redeem Underlying
    • Borrow
    • Repay Borrow
    • Repay Borrow Behalf
    • Transfer
    • Liquidate Borrow
    • Key Events
    • Error Codes
    • Failure Info
    • Exchange Rate
    • Get Cash
    • Total Borrow
    • Borrow Balance
    • Borrow Rate
    • Total Supply
    • Underlying Balance
    • Supply Rate
    • Total Reserves
    • Reserve Factor
  • Comptroller
    • Enter Markets
    • Exit Market
    • Get Assets In
    • Collateral Factor
    • Get Account Liquidity
    • Close Factor
    • Liquidation Incentive
    • Key Events
    • Error Codes
    • Failure Info
    • ARS Distribution Speeds
    • Claim ARS
    • Market Metadata
  • Governance
    • Delegate
    • Delegate By Signature
    • Get Current Votes
    • Get Prior Votes
    • Key Events
    • Governor Bravo
    • Quorum Votes
    • Proposal Threshold
    • Proposal Max Operations
    • Voting Delay
    • Voting Period
    • Propose
    • Queue
    • Execute
    • Cancel
    • Get Actions
    • Get Receipt
    • State
    • Cast Vote
    • Cast Vote With Reason
    • Cast Vote By Signature
    • Timelock
    • Pause Guardian
  • Reward Vesting and Staking
    • Reward Vesting
    • ARS Staking
    • Explainer Video
  • LP Staking
    • LP Utility
    • LP Staking Options
    • Zapping LP
    • Maintaining Eligibility Status
    • Explainer Video
  • API
    • ATokenService
      • GET: /atoken
    • MarketHistoryService
      • GET: /market_history/graph
    • ProposalService
      • GET: /proposals
      • GET: /proposals/:id
      • GET: /proposals/statistics
    • VoterService
      • GET: /voters/accounts
      • GET: /voters/accounts/:address
      • GET: /voters/history/:address
      • GET: /voters/:proposalId
    • GovernanceService
      • GET: /governance/aquarius
      • GET: /governance/proposals
      • GET: /governance/proposal_vote_receipts
      • GET: /governance/accounts
    • Shared Data Types
  • Aquarius.js
    • Aquarius Constructor
    • API Methods
      • Account
      • aToken
      • Market History
      • Governance
    • aToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • ARS Methods
      • To Checksum Address
      • Get ARS Balance
      • Get ARS Accrued
      • Claim ARS
      • Delegate
      • Delegate By Sig
      • Create Delegate Signature
    • Comptroller Methods
      • Enter Markets
      • Exit Market
    • Ethereum Methods
      • Read
      • Trx
      • Get Balance
    • Governance Methods
      • Cast Vote
      • Cast Vote By Sig
      • Create Vote Signature
    • Price Feed Methods
      • Get Price
    • Utility Methods
      • Get Address
      • Get ABI
      • Get Network Name With Chain ID
  • Security
    • Formal Verification
    • Bug Bounty Program
  • Terms of Service
Powered by GitBook
On this page
  1. Aquarius.js
  2. aToken Methods

Repay Borrow

Repays a borrowed Ethereum asset for the user or on behalf of another Ethereum address.

  • asset (string) A string of the asset that was borrowed (must be a supported underlying asset).

  • amount (number | string | BigNumber) A string, number, or BigNumber object of the amount of an asset to borrow. Use the mantissa boolean in the options parameter to indicate if this value is scaled up (so there are no decimals) or in its natural scale.

  • [borrower] (string | null) The Ethereum address of the borrower to repay an open borrow for. Set this to null if the user is repaying their own borrow.

  • noApprove (boolean) Explicitly prevent this method from attempting an ERC-20 approve transaction prior to sending the subsequent repayment transaction.

  • [options] (CallOptions) Call options and Ethers.js overrides for the transaction. A passed gasLimit will be used in both the approve (if not supressed) and repayBorrow or repayBorrowBehalf transactions.

  • RETURN (object) Returns an Ethers.js transaction object of the repayBorrow or repayBorrowBehalf transaction.

const aquarius = new Aquarius(window.ethereum);

(async function() {

  console.log('Repaying Usdc borrow...');
  const address = null; // set this to any address to repayBorrowBehalf
  const trx = await aquarius.repayBorrow(Aquarius.USDC, 32, address);

  console.log('Ethers.js transaction object', trx);

})().catch(console.error);
PreviousBorrowNextARS Methods

Last updated 1 year ago