Skip to main content
POST
/
v2
/
earn
/
deposit
Python (SDK)
from compass_api_sdk import CompassAPI, models


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.earn.earn_deposit(owner="0xe5310C39a8A8f16E6126ee6B1006bf6eD58B3A49", chain=models.Chain.BASE, market={
        "type": "VAULT",
        "vault_address": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
    }, amount="0.01", gas_sponsorship=False)

    # Handle response
    print(res)
{
  "transaction": {
    "chainId": "<string>",
    "data": "<string>",
    "from": "<string>",
    "gas": "<string>",
    "to": "<string>",
    "value": "<string>",
    "nonce": "<string>",
    "maxFeePerGas": "<string>",
    "maxPriorityFeePerGas": "<string>"
  },
  "eip_712": {
    "domain": {
      "chainId": 123,
      "verifyingContract": "<string>"
    },
    "types": {
      "EIP712Domain": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ],
      "SafeTx": [
        {
          "name": "<string>",
          "type": "<string>"
        }
      ]
    },
    "primaryType": "<string>",
    "message": {
      "to": "<string>",
      "value": "<string>",
      "operation": 0,
      "safeTxGas": "<string>",
      "baseGas": "<string>",
      "gasPrice": "<string>",
      "gasToken": "<string>",
      "refundReceiver": "<string>",
      "nonce": "<string>"
    }
  }
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json
owner
string
required

The owner's wallet address.

chain
enum<string>
required

Blockchain network

Available options:
base,
ethereum,
arbitrum
market
object
required

The earn market.

  • VaultDeposit
  • AaveDeposit
amount
required

Amount of underlying asset to deposit. For VAULT, this is the vault’s underlying token; for AAVE, this is the Aave reserve asset (the token you supply). Provide as a decimal string in token units (not wei); must be > 0.

Required range: x > 0
Examples:

0.1

1

100.001

gas_sponsorship
boolean
default:false

Optionally request gas sponsorship. If set to true, EIP-712 signature data will be returned that must be signed by the owner and submitted to the /sponsor_gas endpoint.

Response

Successful Response

transaction
object | null
required
eip_712
object | null
required

Response containing EIP-712 typed data for Safe transaction signing.