Install Dependencies
bash pip install compass-api-sdk python-dotenv web3
Set Environment Variables
.env
file in your project root: bash # .env PRIVATE_KEY="your_wallet_private_key" RPC_URL="your_ethereum_rpc_url" COMPASS_API_KEY="your_compass_api_key"
Initialize SDK, Web3, and Account
Get and sign authorization for transaction batching
Configure the AAVE looping transaction
Sign and broadcast the transaction
1 / (1 - loan_to_value/100)
. For example, with an LTV of 80%, the maximum multiplier would be 1 / (1 - 80/100) = 1 / 0.2 = 5
. This represents the theoretical maximum leverage possible at that LTV ratio.