Arcade Protocol Migration Guide

This guide helps users interact directly with Arcade protocol smart contracts on Ethereum mainnet after the UI is sunset. It covers all critical operations for reclaiming assets, repaying loans, claiming collateral, and withdrawing NFTs from vaults.


1. Introduction & Prerequisites

What You'll Need

  • A Web3 Wallet: MetaMask, Rabby, or similar browser wallet
  • ETH for Gas: Ensure you have ETH in your wallet to pay transaction fees
  • Etherscan Access: All interactions will be done via Etherscan

How to Use Etherscan's Write Contract Feature

  1. Navigate to the contract address on Etherscan
  2. Click the "Contract" tab
  3. Click "Write Contract" (or "Write as Proxy" if available)
  4. Click "Connect to Web3" and connect your wallet
  5. Find the function you want to call
  6. Enter the required parameters
  7. Click "Write" and confirm the transaction in your wallet

How to Use Etherscan's Read Contract Feature

  1. Navigate to the contract address on Etherscan
  2. Click the "Contract" tab
  3. Click "Read Contract" (or "Read as Proxy" if available)
  4. Find the function you want to query
  5. Enter any required parameters
  6. Click "Query" to see the result

2. Contract Reference

Core Protocol Contracts

ContractAddressEtherscan
LoanCore V30x89bc08BA00f135d608bc335f6B33D7a9ABCC98aFView
LoanCore V20x81b2F8Fc75Bab64A6b144aa6d2fAa127B4Fa7fD9View
RepaymentController V30x74241e1A9c021643289476426B9B70229Ab40D53View
RepaymentController V20xb39dAB85FA05C381767FF992cCDE4c94619993d4View

Vault Factory Contracts

ContractAddressEtherscan
VaultFactory V30x269363665Dbb1582b143099a3cb467E98a476D55View
VaultFactory V20x6e9B4c2f6Bd57b7b924d29b5dcfCa1273Ecc94A2View
VaultFactory ApeStaking0x666faa632E5f7bA20a7FCe36596A6736f87133BeView

Promissory Note Contracts

ContractAddressEtherscan
LenderNote V30x92ED78b41537C902Ad287608d8535bb6780A7618View
LenderNote V20x349A026A43FFA8e2Ab4c4e59FCAa93F87Bd8DdeEView
BorrowerNote V20x337104A4f06260Ff327d6734C555A0f5d8F863aaView

Supported Loan Tokens

TokenAddressDecimals
USDC0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB486
WETH0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc218
DAI0x6b175474e89094c44da98b954eedeac495271d0f18
USDT0xdac17f958d2ee523a2206206994597c13d831ec76

3. Finding Your Assets On-Chain

Finding Your Vault Address

Your vaults are NFTs owned by your wallet. To find them:

Method 1: Check VaultFactory Events

  1. Go to the VaultFactory contract on Etherscan (V2 or V3)
  2. Click "Events" tab
  3. Filter for VaultCreated events
  4. Look for events where the to address matches your wallet

Method 2: Query VaultFactory Directly

  1. Go to VaultFactory on Etherscan > Read Contract
  2. Use tokenOfOwnerByIndex:
    • owner: Your wallet address
    • index: Start with 0, increment to find all vaults
  3. Use instanceAt with the token ID to get the vault address

Finding Your Loan IDs

For Borrowers (V2 Loans)

  1. Go to BorrowerNote V2 on Etherscan
  2. Read Contract > tokenOfOwnerByIndex:
    • owner: Your wallet address
    • index: 0 (or higher if you have multiple)
  3. The returned value is your loan ID

For Lenders (V2 and V3 Loans)

  1. Go to the appropriate LenderNote contract
  2. Read Contract > tokenOfOwnerByIndex:
    • owner: Your wallet address
    • index: 0 (or higher)
  3. The returned value is your loan ID

Checking Loan Status

  1. Go to the appropriate LoanCore contract (V2 or V3)
  2. Read Contract > getLoan:
    • loanId: Your loan ID
  3. Check the state field in the response:
    • 0 = DUMMY (placeholder)
    • 1 = Active
    • 2 = Repaid
    • 3 = Defaulted

4. Loan Operations (Borrowers)

Check Amount Owed (V2 Loans)

  1. Go to RepaymentController V2
  2. Read Contract > amountToCloseLoan:
    • loanId: Your loan ID
  3. Returns the total amount (principal + interest) required to repay

Repay a Loan

Repaying a loan requires two steps: approving the token spend, then calling repay.

Step 1: Approve Token Spend

  1. Go to the loan token contract (e.g., USDC, WETH) on Etherscan
  2. Write Contract > approve:
    • spender: RepaymentController address
      • V3: 0x74241e1A9c021643289476426B9B70229Ab40D53
      • V2: 0xb39dAB85FA05C381767FF992cCDE4c94619993d4
    • amount: Total amount owed (in smallest units)

Important: For amounts, multiply by 10^decimals. Examples:

  • 100 USDC = 100000000 (100 × 10^6)
  • 1 WETH = 1000000000000000000 (1 × 10^18)

Step 2: Repay the Loan

For V3 Loans:

  1. Go to RepaymentController V3
  2. Write Contract > repay:
    • loanId: Your loan ID
  3. Click Write and confirm

For V2 Loans:

  1. Go to RepaymentController V2
  2. Write Contract > repay or closeLoan:
    • loanId: Your loan ID
  3. Click Write and confirm

After repayment, your collateral vault will be returned to you.


5. Loan Operations (Lenders)

Check if a Loan Has Defaulted

  1. Go to LoanCore V3 or V2 on Etherscan
  2. Read Contract > getLoan:
    • loanId: Your loan ID
  3. Check:
    • state: Should be 1 (Active)
    • startDate + terms.durationSecs: Calculate the due date
    • Current time must be past due date + 10-minute grace period

Grace Period: V3 loans have a 10-minute grace period after the due date before default can be claimed.

Claim Collateral on Default

Only the lender can claim collateral after a loan defaults.

For V3 Loans:

  1. Go to RepaymentController V3
  2. Write Contract > claim:
    • loanId: Your loan ID
  3. Click Write and confirm

The collateral vault NFT will be transferred to your wallet.

For V2 Loans:

  1. Go to RepaymentController V2
  2. Write Contract > claim:
    • loanId: Your loan ID
    • currentInstallmentPeriod: 0 (for non-installment loans)
  3. Click Write and confirm

6. Vault Withdrawals

After you own a vault (either as the original creator or after claiming defaulted collateral), you can withdraw the assets inside.

Step 1: Enable Withdrawals (Required)

Important: You must enable withdrawals before you can withdraw any assets. This is a one-time operation per vault.

  1. Find your vault address
  2. Go to your vault address on Etherscan
  3. Write Contract > enableWithdraw
  4. Click Write and confirm

After enabling, the vault cannot be used as collateral again.

Step 2: Withdraw Assets

Withdraw ERC721 NFTs

  1. Go to your vault address on Etherscan
  2. Write Contract > withdrawERC721:
    • token: NFT contract address
    • tokenId: Token ID of the NFT
    • to: Your wallet address
  3. Click Write and confirm

Withdraw ERC20 Tokens

  1. Go to your vault address on Etherscan
  2. Write Contract > withdrawERC20:
    • token: ERC20 token contract address
    • to: Your wallet address
  3. Click Write and confirm

Withdraw ETH

  1. Go to your vault address on Etherscan
  2. Write Contract > withdrawETH:
    • to: Your wallet address
  3. Click Write and confirm

Special Asset Withdrawals

CryptoPunks

Punks use a non-standard interface:

  1. Go to your vault address on Etherscan
  2. Write Contract > withdrawPunk:
    • punks: 0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb
    • punkIndex: Your punk's index number
    • to: Your wallet address
  3. Click Write and confirm

7. APE Staking Operations

If your vault contains BAYC, MAYC, or BAKC NFTs with staked APE, you can claim rewards and withdraw staked APE through the vault's call function.

Contact support for assistance with APE staking withdrawals as they require encoded function calls.


8. Canceling Offers

If you have outstanding loan offers you want to cancel:

  1. Find your offer's nonce (from your transaction history or stored offer data)
  2. Go to the appropriate LoanCore contract
  3. Write Contract > cancelNonce:
    • nonce: The nonce of the offer to cancel (uint160)
  4. Click Write and confirm

This invalidates the offer signature, preventing it from being used.


9. Troubleshooting

Common Errors

ErrorCauseSolution
RC_InvalidStateLoan is not in the expected stateCheck loan state with getLoan
RC_OnlyLenderCaller is not the lenderUse the wallet that owns the LenderNote
LC_NotExpiredTrying to claim before loan expiresWait until after due date + grace period
AV_WithdrawsDisabledWithdrawals not enabledCall enableWithdraw first
AV_MissingAuthorizationNot the vault ownerVerify you own the vault NFT
Insufficient allowanceToken not approvedApprove token spend first

Verification Checklist

Before executing any transaction:

  • Verify you're on Ethereum Mainnet (Chain ID: 1)
  • Double-check all contract addresses match this guide
  • Verify the function parameters are correct
  • For token amounts, ensure you've used the correct decimals
  • Test with read functions before write operations
  • Have sufficient ETH for gas fees

Last updated: January 2025