Skip to main content
POST
/
v2
/
global_markets_perps
/
deposit
/
sponsor_prepare
Python (SDK)
from compass_api_sdk import CompassAPI


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

    res = compass_api.global_markets_perps.global_markets_perps_deposit_sponsor_prepare(owner="0x06A9aF046187895AcFc7258450B15397CAc67400", amount_raw=100000000, deadline=1747097383, signature="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", sender="0x4A83b4413CF41C3244027e1590E35a0F48403F0c")

    # Handle response
    print(res)
import { CompassApiSDK } from "@compass-labs/api-sdk";

const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});

async function run() {
const result = await compassApiSDK.globalMarketsPerps.globalMarketsPerpsDepositSponsorPrepare({
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
amountRaw: 100000000,
deadline: 1747097383,
signature: "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
sender: "0x4A83b4413CF41C3244027e1590E35a0F48403F0c",
});

console.log(result);
}

run();
curl --request POST \
--url https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
"amount_raw": 100000000,
"deadline": 1747097383,
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"sender": "0x4A83b4413CF41C3244027e1590E35a0F48403F0c"
}
'
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
owner: '0x06A9aF046187895AcFc7258450B15397CAc67400',
amount_raw: 100000000,
deadline: 1747097383,
signature: '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
sender: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
})
};

fetch('https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'owner' => '0x06A9aF046187895AcFc7258450B15397CAc67400',
'amount_raw' => 100000000,
'deadline' => 1747097383,
'signature' => '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
'sender' => '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare"

payload := strings.NewReader("{\n \"owner\": \"0x06A9aF046187895AcFc7258450B15397CAc67400\",\n \"amount_raw\": 100000000,\n \"deadline\": 1747097383,\n \"signature\": \"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"sender\": \"0x4A83b4413CF41C3244027e1590E35a0F48403F0c\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"owner\": \"0x06A9aF046187895AcFc7258450B15397CAc67400\",\n \"amount_raw\": 100000000,\n \"deadline\": 1747097383,\n \"signature\": \"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"sender\": \"0x4A83b4413CF41C3244027e1590E35a0F48403F0c\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.compasslabs.ai/v2/global_markets_perps/deposit/sponsor_prepare")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"owner\": \"0x06A9aF046187895AcFc7258450B15397CAc67400\",\n \"amount_raw\": 100000000,\n \"deadline\": 1747097383,\n \"signature\": \"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n \"sender\": \"0x4A83b4413CF41C3244027e1590E35a0F48403F0c\"\n}"

response = http.request(request)
puts response.read_body
{
  "transaction": {
    "chainId": "0xa4b1",
    "data": "0x...",
    "from": "0x4A83b4413CF41C3244027e1590E35a0F48403F0c",
    "gas": "0x30d40",
    "maxFeePerGas": "0x59682f00",
    "maxPriorityFeePerGas": "0x3b9aca00",
    "nonce": "0x5",
    "to": "0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7",
    "value": "0x0"
  }
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Take a user's signed EIP-2612 USDC permit and build an Arbitrum tx that calls Bridge2.batchedDepositWithPermit.

The customer broadcasts the returned tx from their own sponsor wallet — Compass does not hold gas keys (non-custodial).

owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The user's EOA address on Arbitrum (the permit signer).

Example:

"0x06A9aF046187895AcFc7258450B15397CAc67400"

amount_raw
integer
default:100000000
required

USDC amount in raw 6-decimal units, as returned by /deposit.

Example:

100000000

deadline
integer
default:1747097383
required

Permit deadline (unix seconds), as returned in the permit.message from /deposit.

Example:

1747097383

signature
string
default:0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
required

The user's EIP-2612 permit signature (65-byte hex, 0x-prefixed or raw).

Example:

"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

sender
string
default:0x4A83b4413CF41C3244027e1590E35a0F48403F0c
required

Sponsor wallet address that will broadcast the returned tx (used for from and nonce).

Example:

"0x4A83b4413CF41C3244027e1590E35a0F48403F0c"

Response

Successful Response

Fully-encoded Arbitrum tx that completes a HL Bridge2 deposit.

Broadcast transaction from the sender wallet supplied in the request. After the receipt confirms, verify a USDC Transfer event was emitted — Bridge2 can silently no-op without reverting.

transaction
UnsignedTransaction · object
required

Unsigned Arbitrum tx calling Bridge2.batchedDepositWithPermit. Sign and broadcast from sender.

Example:
{
"chainId": "0x2105",
"data": "0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000675f4a3d",
"from": "0x4A83b4413CF41C3244027e1590E35a0F48403F0c",
"gas": "0x7a120",
"maxFeePerGas": "0x59682f00",
"maxPriorityFeePerGas": "0x3b9aca00",
"nonce": "0x5",
"to": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
"value": "0x0"
}