Endpoints

🔐 — requires authentication 🪙 — cost of calling in request tokens (see Rate Limits)

Companies

GET /v1/companies

🔐 🪙 1

Fetches all companies registered on the platform.

Parameters:

  • id: Uuid (optional) — filters output by company ID

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Company]

Example output
{
  "result": [
    {
      "created_at": "2024-01-01T18:44:33.846999Z",
      "id": "bdd68c99-65fe-4500-baae-5bc09b4af183",
      "is_lp": true,
      "legal_name": "Example company",
      "short_name": "EXMPL"
    },
    {
      "created_at": "2024-02-01 18:44:51.817012Z",
      "id": "af13119d-4ed1-4718-aea3-fecee4764837",
      "is_lp": false,
      "legal_name": "Another company",
      "short_name": "ANTHR"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_companies(self, id: Optional[str] = None,
                  page: Optional[Dict] = None) -> ApiPage[Company]
SDK examples
f# iterate over companies
for company in paginate(client.get_companies):
    ...

# load all companies into a list (eagerly request all pages)
companies = list(paginate(client.get_companies))

# fetch company metadata by id
company_id = "bdd68c99-65fe-4500-baae-5bc09b4af183"
company = client.get_companies(id=company_id).result[0]

Portfolio

GET /v1/portfolio/assets

🔐 🪙 1

Fetches current asset balances for the authenticated user.

Parameters:

  • pool: Uuid (optional) — filters output by settlement pool; if not specified, a summary across all settlement pools is returned

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Asset]

Example output
{
  "result": [
    {
      "asset": "USDC",
      "company": "bdd68c99-65fe-4500-baae-5bc09b4af183",
      "pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "qty": "2103.191818"
    }
  ]
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_portfolio_assets(self, pool: Optional[str] = None,
                         page: Optional[Dict] = None) -> ApiPage[Asset]
SDK examples
# iterate over all assets
for assets in paginate(client.get_portfolio_assets):
    ...

# load all assets in a specific pool into a list (eagerly request all pages)
pool_id = "cdfbea44-7e75-4688-a3ea-e8d097ae7ede"
assets = list(paginate(client.get_portfolio_assets, pool=pool_id))

GET /v1/portfolio/positions

🔐 🪙 1

Fetches current position balances for the authenticated user.

Parameters:

  • pool: Uuid (optional) — filters output by settlement pool; if not specified, a summary across all settlement pools is returned

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Position]

Example output
{
  "result": [
    {
      "avg_entry_price": "65215.000000000000",
      "company": "af13119d-4ed1-4718-aea3-fecee4764837",
      "instrument": {
        "expiry": "2024-04-05T08:00:00Z",
        "instrument_type": "dated_future",
        "settlement_asset": "USDC",
        "underlying": "BTC"
      },
      "pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "qty": "1",
      "taker_qty": "0",
      "updated_at": "2024-04-02T23:16:52.344386Z"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_portfolio_positions(self, pool: Optional[str] = None,
                            page: Optional[Dict] = None) -> ApiPage[Position]
SDK examples
# iterate over positions in a specific settlement pool
pool_id = "cdfbea44-7e75-4688-a3ea-e8d097ae7ede"
for positions in paginate(client.get_portfolio_positions, pool=pool_id):
    ...

# load all your positions into a list (eagerly request all pages)
positions = list(paginate(client.get_portfolio_positions))

GET /v1/portfolio/positions/aggregated

🔐 🪙 10

Fetches aggregated positions for the authenticated user.

Parameters:

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[AggregatedPosition]

Example output
{
  "result": [
    {
      "iv": "0",
      "notional": "65833.1739032583",
      "position_info": {
        "avg_entry_price": "65215",
        "company": "af13119d-4ed1-4718-aea3-fecee4764837",
        "instrument": {
          "expiry": "2024-04-05T08:00:00Z",
          "instrument_type": "dated_future",
          "settlement_asset": "USDC",
          "underlying": "BTC"
        },
        "pool_location": "00000000-0000-0000-0000-000000000000",
        "qty": "1",
        "taker_qty": "0",
        "updated_at": "2024-04-02T23:16:52.344386Z"
      },
      "price": "65896.65104296",
      "sum_delta": "1",
      "sum_gamma": "0",
      "sum_rho": "0",
      "sum_theta": "0",
      "sum_vega": "0",
      "underlying_price": "65833.1739032583",
      "upnl": "681.65104296"
    }
  ],
  "pagination": {
    "next_page": null
  },
}

Python SDK:

def get_portfolio_aggregated_positions(self, page: Optional[Dict] = None) \
    -> ApiPage[AggregatedPosition]
SDK examples
# iterate over your company's aggregated positions
for positions in paginate(client.get_portfolio_aggregated_positions):
    ...

# load all your aggregated positions into a list (eagerly request all pages)
positions = list(paginate(client.get_portfolio_aggregated_positions))

GET /v1/portfolio/trades

🔐 🪙 1

Fetches trades for the authenticated user.

Parameters:

  • pool: Uuid (optional) — filters output by settlement pool

  • id: Uuid (optional) — filters output by trade ID

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Trade]

Example output
{
  "result": [
    {
      "company": "af13119d-4ed1-4718-aea3-fecee4764837",
      "created_at": "2024-04-02T23:16:52.344386Z",
      "id": "01efd105-07d7-43d9-9f51-886af0aa8b25",
      "instrument": {
        "expiry": "2024-04-05T08:00:00Z",
        "instrument_type": "dated_future",
        "settlement_asset": "USDC",
        "underlying": "BTC"
      },
      "pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "price": "65215",
      "qty": "1",
      "role": "maker",
      "side": "buy",
      "source_quote": "adb18efb-aee3-4c0f-9e96-082c2849601d",
      "source_rfq": "564eeecb-7466-4af4-b833-907835d6e83b",
      "source_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
      "trade_type": "trade"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_portfolio_trades(self, pool: Optional[str] = None, id: Optional[str] = None,
                         page: Optional[Dict] = None) -> ApiPage[Trade]
SDK examples
# iterate over trades in a specific settlement pool
pool_id = "cdfbea44-7e75-4688-a3ea-e8d097ae7ede"
for trade in paginate(client.get_portfolio_trades, pool=pool_id):
    ...

# fetch a trade by id
trade_id = "01efd105-07d7-43d9-9f51-886af0aa8b25"
trade = client.get_portfolio_trades(id=trade_id).result[0]

GET /v1/portfolio/summary

🔐 🪙 10

Fetches the aggregated summary of the authenticated user's positions: balance, uPNL and the Greeks (risk).

Parameters: None.

Output type: ApiSingle[PortfolioSummary]

Example output
{
  "result": {
    "sum_balance": "1169.5439289533",
    "sum_delta": "1",
    "sum_dollar_delta": "65660.2180115883",
    "sum_dollar_gamma": "0",
    "sum_gamma": "0",
    "sum_notional": "65660.2180115883",
    "sum_rho": "0",
    "sum_theta": "0",
    "sum_upnl": "529.6761819533",
    "sum_vega": "0"
  }
}

Python SDK:

def get_portfolio_summary(self) -> ApiSingle[PortfolioSummary]
SDK examples
summary = client.get_portfolio_summary().result

Quotes

GET /v1/quotes, GET /v1/quotes/sent and GET /v1/quotes/received

🔐 🪙 1

Fetches quotes sent or received by the authenticated user.

Parameters:

  • id: Uuid (optional) — filters output by quote ID

  • limit: int (optional, max=1,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Quote]

Example output
{
  "result": [
    {
      "aggregated_ask": null,
      "aggregated_bid": "65215",
      "clearing_events": [
        {
          "created_at": "2024-04-02T22:52:46.609140Z",
          "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
          "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
          "status": "pending_pool_creation",
          "taker_side": "sell"
        },
        {
          "created_at": "2024-04-02T22:55:34.122263Z",
          "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
          "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
          "status": "pending_taker_deposit_approval",
          "taker_side": null
        }
      ],
      "clearing_status": "pending_taker_deposit_approval",
      "client_quote_id": "my quote 2",
      "creator_params": {
        "margin_mode": "simple",
        "params": {
          "asset_params": {},
          "auto_liquidation": true,
          "default_asset_param": {
            "futures_initial_margin": "0.02",
            "futures_leverage": "20000",
            "futures_maintenance_margin": "0.01",
            "option_initial_margin": "0.15",
            "option_initial_margin_min": "0.1",
            "option_maintenance_margin": "0.075"
          },
          "liquidation_penalty": "0.1"
        }
      },
      "expires_at": "2024-04-03T10:49:20.685499Z",
      "maker_company": "af13119d-4ed1-4718-aea3-fecee4764837",
      "new_pool_name": "API test pool",
      "other_params": {
        "margin_mode": "simple",
        "params": {
          "asset_params": {},
          "auto_liquidation": true,
          "default_asset_param": {
            "futures_initial_margin": "0.02",
            "futures_leverage": "20000",
            "futures_maintenance_margin": "0.01",
            "option_initial_margin": "0.15",
            "option_initial_margin_min": "0.1",
            "option_maintenance_margin": "0.075"
          },
          "liquidation_penalty": "0.1"
        }
      },
      "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
      "per_leg_quotes": [
        {
          "ask": null,
          "bid": "65215",
          "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade"
        }
      ],
      "pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "target_rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_quotes(self, id: Optional[str] = None,
               page: Optional[Dict] = None) -> ApiPage[Quote]

def get_quotes_sent(self, id: Optional[str] = None,
                    page: Optional[Dict] = None) -> ApiPage[Quote]
    
def get_quotes_received(self, id: Optional[str] = None,
                        page: Optional[Dict] = None) -> ApiPage[Quote]
SDK examples
# iterate over all of your company's sent quotes
for quote in paginate(client.get_quotes_sent):
    ...

# fetch a received quote by id
quote_id = "5368f58e-f385-44cc-a9e5-2e8ea51913bb"
quote = client.get_quotes_received(id=quote_id).result[0]

POST /v1/quotes/new

🔐 🪙 20

Used to submit a quote in response to a particular RFQ as a maker.

JSON payload keys:

  • rfq_id: Uuid — ID of the target RFQ

  • expires_at: DateTimeRFC3339 — expiration time

  • leg_quotes: List[LegQuote] — quotes for individual RFQ legs

  • pool_strategy: PoolStrategy — reuse an existing pool or create a new one

  • client_quote_id: str (optional, max length: 50 characters) — arbitrary string for your internal reference

Example input
{
  "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
  "expires_at": "2024-04-03T10:45:24.967356Z",
  "leg_quotes": [
    {
      "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
      "bid": "65220"
    }
  ],
  "pool_strategy": {
    "strategy": "create_new",
    "name": "API test pool",
    "creator_params": {
      "margin_mode": "simple",
      "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": true,
        "asset_params": {},
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_maintenance_margin": "0.01",
          "futures_leverage": "20000",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        }
      }
    },
    "other_params": {
      "margin_mode": "simple",
      "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": true,
        "asset_params": {},
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_maintenance_margin": "0.01",
          "futures_leverage": "20000",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        }
      }
    }
  },
  "client_quote_id": "my quote"
}

Output type: ApiSingle[Quote]

Example output
{
  "result": {
    "aggregated_ask": null,
    "aggregated_bid": "65220",
    "clearing_events": [],
    "clearing_status": null,
    "client_quote_id": "my quote",
    "creator_params": {
      "margin_mode": "simple",
      "params": {
        "asset_params": {},
        "auto_liquidation": true,
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_leverage": "20000",
          "futures_maintenance_margin": "0.01",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        },
        "liquidation_penalty": "0.1"
      }
    },
    "expires_at": "2024-04-03T10:45:24.967356Z",
    "maker_company": "af13119d-4ed1-4718-aea3-fecee4764837",
    "new_pool_name": "API test pool",
    "other_params": {
      "margin_mode": "simple",
      "params": {
        "asset_params": {},
        "auto_liquidation": true,
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_leverage": "20000",
          "futures_maintenance_margin": "0.01",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        },
        "liquidation_penalty": "0.1"
      }
    },
    "parent_quote_id": "37dac6e5-8f91-4cef-9e1e-53042e30991a",
    "per_leg_quotes": [
      {
        "ask": null,
        "bid": "65220",
        "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade"
      }
    ],
    "pool_location": null,
    "target_rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b"
  }
}

Python SDK:

def create_quote(self, rfq_id: UUIDv4, expires_at: DateTimeRFC3339,
                 leg_quotes: List[LegQuote], pool_strategy: PoolStrategy,
                 client_quote_id: Optional[str] = None) -> ApiSingle[Quote]
SDK examples
margin_params = {
    "margin_mode": MarginMode.SIMPLE,
    "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": True,
        "asset_params": {},
        "default_asset_param": {
            "futures_initial_margin": "0.02",
            "futures_maintenance_margin": "0.01",
            "futures_leverage": "20000",
            "option_initial_margin": "0.15",
            "option_initial_margin_min": "0.1",
            "option_maintenance_margin": "0.075",
        },
    }
}
new_quote = maker_client.create_quote(
    rfq_id="564eeecb-7466-4af4-b833-907835d6e83b",
    expires_at="2024-04-03T10:45:24.967356Z",
    client_quote_id="my quote",
    leg_quotes=[
        {
            "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
            "bid": "65220"
        }
    ],
    pool_strategy={
        "strategy": PoolStrategyType.CREATE_NEW,
        "name": "API test pool",
        "creator_params": margin_params,
        "other_params": margin_params
    }
).result

POST /v1/quotes/cancel

🔐 🪙 20

Cancels a previously created quote.

JSON payload keys:

  • id: Uuid — ID of the quote to cancel

Example input
{
  "id": "37dac6e5-8f91-4cef-9e1e-53042e30991a"
}

Output type: ApiSingle[bool]

Example output
{
  "result": true
}

Python SDK:

def cancel_quote(self, id: UUIDv4) -> ApiSingle[bool]
SDK example
client.cancel_quote(id="3025fca3-114e-4476-a993-93286a7dd43f")

POST /v1/quotes/cancel_all

🔐 🪙 20

Cancels all of the authenticated user's outstanding quotes.

Output type: ApiSingle[bool]

Example output
{
  "result": true
}

Python SDK:

def cancel_all_quotes(self) -> ApiSingle[bool]
SDK examples
client.cancel_all_quotes()

POST /v1/quotes/replace

🔐 🪙 20

Used to cancel an existing quote and submit a new one for the same particular RFQ.

JSON payload keys:

  • parent_quote_id: Uuid — ID of the existing quote to cancel

  • rfq_id: Uuid — ID of the target RFQ

  • expires_at: DateTimeRFC3339 — expiration time

  • leg_quotes: List[LegQuote] — quotes for individual RFQ legs

  • pool_strategy: PoolStrategy — reuse an existing pool or create a new one

  • client_quote_id: str (optional) — arbitrary string for your internal reference

Example input
{
  "parent_quote_id": "37dac6e5-8f91-4cef-9e1e-53042e30991a",
  "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
  "expires_at": "2024-04-03T10:49:20.685499Z",
  "leg_quotes": [
    {
      "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
      "bid": "65215"
    }
  ],
  "pool_strategy": {
    "strategy": "create_new",
    "name": "API test pool",
    "creator_params": {
      "margin_mode": "simple",
      "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": true,
        "asset_params": {},
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_maintenance_margin": "0.01",
          "futures_leverage": "20000",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        }
      }
    },
    "other_params": {
      "margin_mode": "simple",
      "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": true,
        "asset_params": {},
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_maintenance_margin": "0.01",
          "futures_leverage": "20000",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        }
      }
    }
  },
  "client_quote_id": "my quote 2"
}

Output type: ApiSingle[Quote]

Example output
{
  "result": {
    "aggregated_ask": null,
    "aggregated_bid": "65215",
    "clearing_events": [],
    "clearing_status": null,
    "client_quote_id": "my quote 2",
    "creator_params": {
      "margin_mode": "simple",
      "params": {
        "asset_params": {},
        "auto_liquidation": true,
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_leverage": "20000",
          "futures_maintenance_margin": "0.01",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        },
        "liquidation_penalty": "0.1"
      }
    },
    "expires_at": "2024-04-03T10:49:20.685499Z",
    "maker_company": "af13119d-4ed1-4718-aea3-fecee4764837",
    "new_pool_name": "API test pool",
    "other_params": {
      "margin_mode": "simple",
      "params": {
        "asset_params": {},
        "auto_liquidation": true,
        "default_asset_param": {
          "futures_initial_margin": "0.02",
          "futures_leverage": "20000",
          "futures_maintenance_margin": "0.01",
          "option_initial_margin": "0.15",
          "option_initial_margin_min": "0.1",
          "option_maintenance_margin": "0.075"
        },
        "liquidation_penalty": "0.1"
      }
    },
    "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
    "per_leg_quotes": [
      {
        "ask": null,
        "bid": "65215",
        "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade"
      }
    ],
    "pool_location": null,
    "target_rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b"
  }
}

Python SDK:

def replace_quote(self, parent_quote_id: UUIDv4, rfq_id: UUIDv4,
                  expires_at: DateTimeRFC3339, leg_quotes: List[LegQuote],
                  pool_strategy: PoolStrategy,
                  client_quote_id: Optional[str] = None) -> ApiSingle[Quote]
SDK examples
margin_params = {
    "margin_mode": MarginMode.SIMPLE,
    "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": True,
        "asset_params": {},
        "default_asset_param": {
            "futures_initial_margin": "0.02",
            "futures_maintenance_margin": "0.01",
            "futures_leverage": "20000",
            "option_initial_margin": "0.15",
            "option_initial_margin_min": "0.1",
            "option_maintenance_margin": "0.075",
        },
    }
}
new_quote = maker_client.replace_quote(
    parent_quote_id="37dac6e5-8f91-4cef-9e1e-53042e30991a",
    rfq_id="564eeecb-7466-4af4-b833-907835d6e83b",
    expires_at="2024-04-03T10:49:20.685499Z",
    client_quote_id="my quote 2",
    leg_quotes=[
        {
            "target_rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
            "bid": "65215"
        }
    ],
    pool_strategy={
        "strategy": PoolStrategyType.CREATE_NEW,
        "name": "API test pool",
        "creator_params": margin_params,
        "other_params": margin_params
    }
).result

POST /v1/quotes/accept

🔐 🪙 20

Used to accept a quote and create a trade as a taker.

JSON payload keys:

  • parent_quote_id: Uuid — ID of the quote to accept

  • rfq_id: Uuid — ID of the target RFQ

  • side: TradeSide — "buy" or "sell"

Example input
{
  "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
  "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
  "side": "sell"
}

Output type: ApiSingle[QuoteAcceptResponse]

Example output
{
  "result": {
    "new_clearing_status": "pending_pool_creation",
    "pending_deposits_sum_qty": "2103.191818",
    "pending_settlement_pool": {
      "company_id": "bdd68c99-65fe-4500-baae-5bc09b4af183",
      "data": {
        "creator_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
        "creator_company_margin_usage": {
          "balance": "0",
          "company": "bdd68c99-65fe-4500-baae-5bc09b4af183",
          "margin_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "margin_usage": {
            "initial_margin": "0",
            "maintenance_margin": "0"
          },
          "max_withdrawable_amount": "0"
        },
        "other_address": "0xa0ee7a142d267c1f36714e4a8f75612f20a79720",
        "other_company_margin_usage": {
          "balance": "0",
          "company": "af13119d-4ed1-4718-aea3-fecee4764837",
          "margin_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "margin_usage": {
            "initial_margin": "0",
            "maintenance_margin": "0"
          },
          "max_withdrawable_amount": "0"
        },
        "pool_address": null,
        "pool_name": "API test pool",
        "positions": [],
        "status": "pending"
      },
      "pool_id": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede"
    }
  }
}

Python SDK:

def accept_quote(self, rfq_id: UUIDv4, parent_quote_id: UUIDv4,
                 side: TradeSide) -> ApiSingle[QuoteAcceptResponse]
SDK examples
accepted = taker_client.accept_quote(
    rfq_id="564eeecb-7466-4af4-b833-907835d6e83b",
    parent_quote_id="5368f58e-f385-44cc-a9e5-2e8ea51913bb",
    side=TradeSide.SELL,
).result

Notes On Clearing Status:

Depending on the quote parameters and prior on-chain calls, the trade can be created in one of three distinct clearing states:

  • pending_pool_creation: a new settlement pool needs to be created on-chain; to progress the trade, the taker must execute SettlementPoolFactory.createPool() on-chain, making sure to include rfq_id and parent_quote_id (see Taker Tutorial)

  • pending_taker_deposit_approval: the taker must execute ERC20.approve() on-chain with the settlement pool address as the spender and the amount greater or equal to pending_deposits_sum_qty to progress the trade

  • pending_maker_last_look: the maker is responsible for progressing the trade further by submitting a final "last look" approval

POST /v1/quotes/maker_last_look

🔐 🪙 20

Used by the maker to finalize a trade or cancel it, in response to taker acceptance. The trade must be in pending_maker_last_look clearing status.

JSON payload keys:

  • parent_quote_id: Uuid — ID of the quote

  • rfq_id: Uuid — ID of the RFQ

  • action: RequestAction — "accept" or "reject"

Example input
{
  "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
  "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
  "action": "accept"
}

Output Type: ApiSingle[MakerLastLookResponse]

Example output
{
  "result": {
    "atomic_deposit_details": {
      "creator_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
      "creator_transfer_amount": "2103.191818",
      "other_address": "0xa0ee7a142d267c1f36714e4a8f75612f20a79720",
      "other_transfer_amount": "639.867747",
      "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
      "pool_address": "0x5e5137b6a596a5d7508756c14d07f83ce8535944",
      "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b"
    },
    "new_clearing_status": "pending_maker_deposit_approval",
    "pending_deposits_sum_qty": "639.867747"
  }
}

Python SDK:

def maker_last_look(self, rfq_id: UUIDv4, parent_quote_id: UUIDv4,
                    action: RequestAction) -> ApiSingle[MakerLastLookResponse]
SDK examples
last_look = maker_client.maker_last_look(
    rfq_id="564eeecb-7466-4af4-b833-907835d6e83b",
    parent_quote_id="5368f58e-f385-44cc-a9e5-2e8ea51913bb",
    action=RequestAction.ACCEPT,
).result

Notes On Clearing Status:

Depending on the current settlement pool margin usage and prior on-chain calls, the trade can end up in one of three distinct clearing states:

  • pending_maker_deposit_approval: the maker must execute ERC20.approve() on-chain with the settlement pool address as the spender and the amount greater or equal to pending_deposits_sum_qty to progress the trade

  • pending_atomic_deposit: the maker must execute SettlementPool.depositUSDCAtomic() on-chain using the settlement pool address as the contract address and the data from atomic_deposit_details as arguments

  • success_trades_booked_into_pool: no additional deposits were necessary for initial margin and the trade has successfully cleared

RFQs

GET /v1/rfqs/sent and GET /v1/rfqs/received

🔐 🪙 10

Fetches RFQs sent or received by the authenticated user.

Parameters:

  • id: Uuid (optional) — filters output by quote ID

  • limit: int (optional, max=1,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[RFQ]

Example output
{
  "result": [
    {
      "asks": [],
      "bids": [
        {
          "additional_margin_requirements": null,
          "margin_requirements": null,
          "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
          "quote_price": "65215"
        }
      ],
      "created_at": "2024-04-02T22:42:19.816573Z",
      "qty": "1",
      "quotes_common_metadata": {
        "5368f58e-f385-44cc-a9e5-2e8ea51913bb": {
          "clearing_events": [
            {
              "created_at": "2024-04-02T22:52:46.609140Z",
              "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
              "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
              "status": "pending_pool_creation",
              "taker_side": "sell"
            },
            {
              "created_at": "2024-04-02T22:55:34.122263Z",
              "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
              "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
              "status": "pending_taker_deposit_approval",
              "taker_side": null
            }
          ],
          "clearing_status": "pending_taker_deposit_approval",
          "creator_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "expires_at": "2024-04-03T10:49:20.685499Z",
          "maker_company": "af13119d-4ed1-4718-aea3-fecee4764837",
          "new_pool_name": "API test pool",
          "other_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
          "pool_creator_company": "bdd68c99-65fe-4500-baae-5bc09b4af183",
          "pool_creator_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
          "pool_other_company": "af13119d-4ed1-4718-aea3-fecee4764837",
          "pool_other_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          }
        }
      },
      "rfq_expires_at": "2024-04-03T10:42:19.795911Z",
      "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
      "rfq_legs": [
        {
          "instrument": {
            "expiry": "2024-04-05T08:00:00Z",
            "instrument_type": "dated_future",
            "settlement_asset": "USDC",
            "underlying": "BTC"
          },
          "qty": "1",
          "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
          "rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
          "side": "buy"
        }
      ],
      "rfq_status": "closed",
      "structure": {
        "legs": [
          {
            "instrument": {
              "expiry": "2024-04-05T08:00:00Z",
              "instrument_type": "dated_future",
              "settlement_asset": "USDC",
              "underlying": "BTC"
            },
            "ratio": 1,
            "side": "buy"
          }
        ]
      },
      "structure_price": null,
      "taker_company": "bdd68c99-65fe-4500-baae-5bc09b4af183"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_rfqs_sent(self, id: Optional[str] = None,
                  page: Optional[Dict] = None) -> ApiPage[RFQ]

def get_rfqs_received(self, id: Optional[str] = None,
                      page: Optional[Dict] = None) -> ApiPage[RFQ]
SDK examples
# iterate over all of your company's sent RFQs
for quote in paginate(client.get_rfqs_sent):
    ...

# fetch a received RFQ by id
rfq_id = "27581879-bc89-4134-87e9-7d9b1bfec396"
quote = client.get_rfqs_received(id=rfq_id).result[0]

POST /v1/rfqs/new

🔐 🪙 20

Used to create a new RFQ as a taker.

JSON payload keys:

  • structure: Structure — what is being traded

  • qty: DecimalStr — quantity in units of the structure (multiplied by ratio per leg)

  • expires_at: DateTimeRFC3339 — expiration time

  • target_companies: List of Uuid — specific companies that will see the request

Example input
{
  "structure": {
    "legs": [
      {
        "instrument": {
          "instrument_type": "dated_future",
          "underlying": "BTC",
          "settlement_asset": "USDC",
          "expiry": "2024-04-05T08:00:00Z"
        },
        "ratio": 1,
        "side": "buy"
      }
    ]
  },
  "qty": "1",
  "expires_at": "2024-04-03T10:42:19.795911Z",
  "target_companies": [
    "af13119d-4ed1-4718-aea3-fecee4764837"
  ]
}

Output type: ApiSingle[RFQ]

Example output
{
  "result": {
    "asks": [],
    "bids": [],
    "created_at": "2024-04-02T22:42:19.816573Z",
    "qty": "1",
    "quotes_common_metadata": {},
    "rfq_expires_at": "2024-04-03T10:42:19.795911Z",
    "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
    "rfq_legs": [
      {
        "instrument": {
          "expiry": "2024-04-05T08:00:00Z",
          "instrument_type": "dated_future",
          "settlement_asset": "USDC",
          "underlying": "BTC"
        },
        "qty": "1",
        "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
        "rfq_leg_id": "635976ac-d5ea-4f44-b25a-2de18cc0cade",
        "side": "buy"
      }
    ],
    "rfq_status": "open",
    "structure": {
      "legs": [
        {
          "instrument": {
            "expiry": "2024-04-05T08:00:00Z",
            "instrument_type": "dated_future",
            "settlement_asset": "USDC",
            "underlying": "BTC"
          },
          "ratio": 1,
          "side": "buy"
        }
      ]
    },
    "structure_price": {
      "delta": "1",
      "gamma": "0",
      "native_price": "1",
      "price": "65806.226554946",
      "rho": "0",
      "theta": "0",
      "timestamp": "2024-04-02T22:42:19.836190673Z",
      "vega": "0"
    },
    "taker_company": "bdd68c99-65fe-4500-baae-5bc09b4af183"
  }
}

Python SDK:

def create_rfq(self, structure: Structure, qty: StrDecimal,
               expires_at: DateTimeRFC3339,
               target_companies: List[UUIDv4]) -> ApiSingle[RFQ]
SDK examples
structure = {"legs": [
    {
        "instrument": {
            "instrument_type": InstrumentType.DATED_FUTURE,
            "underlying": "BTC",
            "settlement_asset": "USDC",
            "expiry": "2024-04-05T08:00:00Z"
        },
        "ratio": 1,
        "side": TradeSide.BUY
    }
]}

# send to one company
target_companies = ["af13119d-4ed1-4718-aea3-fecee4764837"]
new_rfq = client.create_rfq(
    structure=structure,
    qty="1",
    expires_at="2024-04-03T10:42:19.795911Z",
    target_companies=target_companies
).result

# send to all companies
my_company_id = client.get_status().result["auth"]["company_id"]
target_companies = [c["id"] for c in paginate(client.get_companies)
                    if c["id"] != my_company_id]
new_rfq = client.create_rfq(
    structure=structure,
    qty="1",
    expires_at="2024-04-03T10:42:19.795911Z",
    target_companies=target_companies
).result

POST /v1/rfqs/cancel

🔐 🪙 20

Cancels a previously created RFQ.

JSON payload keys:

  • id: Uuid — ID of the RFQ to cancel

Example input
{
  "id": "564eeecb-7466-4af4-b833-907835d6e83b"
}

Output type: ApiSingle[bool]

Example output
{
  "result": true
}

Python SDK:

def cancel_rfq(self, id: UUIDv4) -> ApiSingle[bool]
SDK examples
client.cancel_rfq(id="3025fca3-114e-4476-a993-93286a7dd43f")

Settlement Pools

GET /v1/settlement_pools

🔐 🪙 10

Fetches settlement pools related to the currently authenticated user.

Parameters:

  • id: Uuid (optional) — filters output by settlement pool ID

  • limit: int (optional, max=1,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[SettlementPoolItem]

Example output
{
  "result": [
    {
      "company_id": "bdd68c99-65fe-4500-baae-5bc09b4af183",
      "data": {
        "creator_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
        "creator_company_margin_usage": {
          "balance": "0",
          "company": "bdd68c99-65fe-4500-baae-5bc09b4af183",
          "margin_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "margin_usage": {
            "initial_margin": "0",
            "maintenance_margin": "0"
          },
          "max_withdrawable_amount": "0"
        },
        "other_address": "0xa0ee7a142d267c1f36714e4a8f75612f20a79720",
        "other_company_margin_usage": {
          "balance": "0",
          "company": "af13119d-4ed1-4718-aea3-fecee4764837",
          "margin_params": {
            "margin_mode": "simple",
            "params": {
              "asset_params": {},
              "auto_liquidation": true,
              "default_asset_param": {
                "futures_initial_margin": "0.02",
                "futures_leverage": "20000",
                "futures_maintenance_margin": "0.01",
                "option_initial_margin": "0.15",
                "option_initial_margin_min": "0.1",
                "option_maintenance_margin": "0.075"
              },
              "liquidation_penalty": "0.1"
            }
          },
          "margin_usage": {
            "initial_margin": "0",
            "maintenance_margin": "0"
          },
          "max_withdrawable_amount": "0"
        },
        "pool_address": "0x5e5137b6a596a5d7508756c14d07f83ce8535944",
        "pool_name": "API test pool",
        "positions": [],
        "status": "open"
      },
      "pool_id": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_settlement_pools(self, id: Optional[str] = None,
                         page: Optional[Dict] = None) -> ApiPage[SettlementPoolItem]
SDK examples
# iterate over settlement pools
for pool in paginate(client.get_settlement_pools):
    ...

# load all settlement pools into a list (eagerly request all pages)
pools = list(paginate(client.get_settlement_pools))

# fetch company metadata by id
company_id = "60c84784-5516-478d-a320-ee82d7303581"
pool = client.get_settlement_pools(id=company_id).result[0]

POST /v1/settlement_pools/new

🔐 🪙 20

Creates a new settlement pool between the authenticated user and a specific counterparty.

JSON payload keys:

  • pool_name: str (max length: 50 characters) — name for the new settlement pool

  • company_other: Uuid — counterparty company ID

  • creator_params: MarginParams — margin parameters for your company

  • other_params: MarginParams — margin parameters for the counterparty

Example input
{
  "pool_name": "Test pool",
  "company_other": "af13119d-4ed1-4718-aea3-fecee4764837",
  "creator_params": {
    "margin_mode": "simple",
    "params": {
      "liquidation_penalty": "0.1",
      "auto_liquidation": true,
      "asset_params": {},
      "default_asset_param": {
        "futures_initial_margin": "0.02",
        "futures_maintenance_margin": "0.01",
        "futures_leverage": "20000",
        "option_initial_margin": "0.15",
        "option_initial_margin_min": "0.1",
        "option_maintenance_margin": "0.075"
      }
    }
  },
  "other_params": {
    "margin_mode": "simple",
    "params": {
      "liquidation_penalty": "0.1",
      "auto_liquidation": true,
      "asset_params": {},
      "default_asset_param": {
        "futures_initial_margin": "0.02",
        "futures_maintenance_margin": "0.01",
        "futures_leverage": "20000",
        "option_initial_margin": "0.15",
        "option_initial_margin_min": "0.1",
        "option_maintenance_margin": "0.075"
      }
    }
  }
}

Output type: ApiSingle[SettlementPool]

Example output
{
  "result": {
    "company_id": "bdd68c99-65fe-4500-baae-5bc09b4af183",
    "data": {
      "creator_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
      "creator_company_margin_usage": {
        "balance": "0",
        "company": "bdd68c99-65fe-4500-baae-5bc09b4af183",
        "margin_params": {
          "margin_mode": "simple",
          "params": {
            "asset_params": {},
            "auto_liquidation": true,
            "default_asset_param": {
              "futures_initial_margin": "0.02",
              "futures_leverage": "20000",
              "futures_maintenance_margin": "0.01",
              "option_initial_margin": "0.15",
              "option_initial_margin_min": "0.1",
              "option_maintenance_margin": "0.075"
            },
            "liquidation_penalty": "0.1"
          }
        },
        "margin_usage": {
          "initial_margin": "0",
          "maintenance_margin": "0"
        },
        "max_withdrawable_amount": "0"
      },
      "other_address": "0xa0ee7a142d267c1f36714e4a8f75612f20a79720",
      "other_company_margin_usage": {
        "balance": "0",
        "company": "af13119d-4ed1-4718-aea3-fecee4764837",
        "margin_params": {
          "margin_mode": "simple",
          "params": {
            "asset_params": {},
            "auto_liquidation": true,
            "default_asset_param": {
              "futures_initial_margin": "0.02",
              "futures_leverage": "20000",
              "futures_maintenance_margin": "0.01",
              "option_initial_margin": "0.15",
              "option_initial_margin_min": "0.1",
              "option_maintenance_margin": "0.075"
            },
            "liquidation_penalty": "0.1"
          }
        },
        "margin_usage": {
          "initial_margin": "0",
          "maintenance_margin": "0"
        },
        "max_withdrawable_amount": "0"
      },
      "pool_address": null,
      "pool_name": "Test pool",
      "positions": [],
      "status": "pending"
    },
    "pool_id": "06783112-1acf-4aee-b14b-1b742091a8ab"
  }
}

Python SDK:

def create_settlement_pool(self, pool_name: str, company_other: UUIDv4,
                           creator_params: MarginParams,
                           other_params: MarginParams) -> ApiSingle[SettlementPool]
SDK examples
margin_params = {
    "margin_mode": MarginMode.SIMPLE,
    "params": {
        "liquidation_penalty": "0.1",
        "auto_liquidation": True,
        "asset_params": {},
        "default_asset_param": {
            "futures_initial_margin": "0.02",
            "futures_maintenance_margin": "0.01",
            "futures_leverage": "20000",
            "option_initial_margin": "0.15",
            "option_initial_margin_min": "0.1",
            "option_maintenance_margin": "0.075",
        },
    }
}
client.create_settlement_pool(
    pool_name="Test pool",
    company_other="af13119d-4ed1-4718-aea3-fecee4764837",
    creator_params=margin_params,
    other_params=margin_params,
)

Transfers

GET /v1/transfers

🔐 🪙 1

Fetches transfers for the authenticated user.

Parameters:

  • pool: Uuid (optional) — filters output by settlement pool

  • id: Uuid (optional) — filters output by transfer ID

  • limit: int (optional, max=10,000) — used for pagination

  • offset: int (optional) — used for pagination

Output type: ApiPage[Transfer]

Example output
{
  "result": [
    {
      "asset": "USDC",
      "company": "af13119d-4ed1-4718-aea3-fecee4764837",
      "created_at": "2024-04-02T23:16:52.344386Z",
      "id": "1b9eeb56-1c61-4512-aad4-424736826714",
      "oracle_request_id": null,
      "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
      "qty": "0.00000000082679",
      "reference_instrument": null,
      "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
      "status": "confirmed",
      "target_pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "transfer_type": "deposit"
    },
    {
      "asset": "USDC",
      "company": "af13119d-4ed1-4718-aea3-fecee4764837",
      "created_at": "2024-04-02T23:02:21.418980Z",
      "id": "0ab57115-bbac-4e1b-9e9e-685dfd44dd89",
      "oracle_request_id": null,
      "parent_quote_id": "5368f58e-f385-44cc-a9e5-2e8ea51913bb",
      "qty": "639.86774699917321",
      "reference_instrument": null,
      "rfq_id": "564eeecb-7466-4af4-b833-907835d6e83b",
      "status": "confirmed",
      "target_pool_location": "cdfbea44-7e75-4688-a3ea-e8d097ae7ede",
      "transfer_type": "deposit"
    }
  ],
  "pagination": {
    "next_page": null
  }
}

Python SDK:

def get_transfers(self, pool: Optional[str] = None, id: Optional[str] = None,
                            page: Optional[Dict] = None) -> ApiPage[Transfer]
SDK examples
# iterate over all of your company's transfers
for transfer in paginate(client.get_transfers):
    ...

# fetch a transfer by id
transfer_id = "0ab57115-bbac-4e1b-9e9e-685dfd44dd89"
transfer = client.get_transfers(id=transfer_id).result[0]

POST /v1/transfers/new

🔐 🪙 20

Initiates a new deposit or withdrawal.

JSON payload keys:

  • asset: str — asset to transfer (must be USDC)

  • qty: StrDecimal — transfer amount

  • target_pool_location: Uuid — settlement pool ID

  • transfer_type: TransferType — deposit or withdrawal

Example input
{
  "asset": "USDC",
  "qty": "10000",
  "target_pool_location": "49dc28fd-c1b1-494b-908c-4eecfa0a3934",
  "transfer_type": "deposit"
}

Output type: ApiSingle[Transfer]

Example output
{
  "result": {
    "asset": "USDC",
    "company": "f58b3d2f-b5a6-488d-b8a9-dc2b1f782be8",
    "created_at": "2024-04-18T06:45:44.391006Z",
    "id": "f5e972eb-1197-4594-a3cd-94304fb5a978",
    "oracle_request_id": null,
    "parent_quote_id": null,
    "qty": "10000",
    "reference_instrument": null,
    "rfq_id": null,
    "status": "pending",
    "target_pool_location": "49dc28fd-c1b1-494b-908c-4eecfa0a3934",
    "transfer_type": "deposit"
  }
}

Python SDK:

def create_transfer(self, asset: AssetToken, qty: StrDecimal,
                        target_pool_location: UUIDv4,
                        transfer_type: TransferType) -> ApiSingle[Transfer]
SDK examples
transfer = client.create_transfer(
    asset="USDC",
    qty="10000",
    target_pool_location=pool['pool_id'],
    transfer_type=TransferType.DEPOSIT,
).result

from variational import PollingHelper
poller = PollingHelper(api_client)
transfer = poller.wait_for_transfer(transfer['id'])

POST /v1/transfers/permit/template

🔐 🪙 1

Generates a ERC-2612 spending permit message. To take effect, it needs to be signed by the company wallet's private key and submitted via POST /v1/transfers/permit.

JSON payload keys:

  • pool_address: H160 — address of the settlement pool

  • allowance: Allowance — unit and value of the spending allowance

  • seconds_until_expiry: int (default: 60) — for how long the permit will be effective

Example input
{
  "pool_address": "0xb1be60448b947528298a2200f27a8abc3964097b",
  "allowance": {
    "type": "decimal",
    "value": "10000"
  },
  "seconds_until_expiry": 3600
}

Output type: ApiSingle[dict]

Example output
{
  "result": {
    "domain": {
      "chainId": "0xa4b1",
      "name": "TestUSDC",
      "verifyingContract": "0xd985d4707ee37295652545513822835b28a9189c",
      "version": "1"
    },
    "message": {
      "deadline": 1713459016,
      "nonce": 0,
      "owner": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
      "spender": "0xb1be60448b947528298a2200f27a8abc3964097b",
      "value": 10000000000
    },
    "primaryType": "Permit",
    "types": {
      "EIP712Domain": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "version",
          "type": "string"
        },
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "Permit": [
        {
          "name": "owner",
          "type": "address"
        },
        {
          "name": "spender",
          "type": "address"
        },
        {
          "name": "value",
          "type": "uint256"
        },
        {
          "name": "nonce",
          "type": "uint256"
        },
        {
          "name": "deadline",
          "type": "uint256"
        }
      ]
    }
  }
}

Python SDK:

def generate_transfer_permit(self, pool_address: H160, allowance: Allowance,
                             seconds_until_expiry: Optional[int] = None) \
                             -> ApiSingle[dict]
SDK examples
msg = self.client.generate_transfer_permit(
    pool_address="0xb1be60448b947528298a2200f27a8abc3964097b",
    allowance={
        "type": AllowanceType.DECIMAL,
        "value": "10000"
    },
    seconds_until_expiry=3600
).result

# or use the helper to generate, sign and submit the permit
from variational import TransferPermitHelper

permits = TransferPermitHelper(client=client, private_key=WALLET_PK)
permits.sign_and_submit_decimal(
    pool_address="0xb1be60448b947528298a2200f27a8abc3964097b",
    allowance=str(10000)
)

POST /v1/transfers/permit

🔐 🪙 20

Submits a signed ERC-2612 spending permit on-chain, allowing transfer of the signer's funds into the settlement pool.

JSON payload keys:

  • message: dict — permit in EIP-712 format generated by /v1/transfers/permit/template

  • signature: str — produced using message and the company wallet's private key

Example input
{
  "message": {
    "domain": {
      "chainId": 42161,
      "name": "TestUSDC",
      "verifyingContract": "0xd985d4707ee37295652545513822835b28a9189c",
      "version": "1"
    },
    "message": {
      "deadline": 1713459016,
      "nonce": 0,
      "owner": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
      "spender": "0xb1be60448b947528298a2200f27a8abc3964097b",
      "value": 10000000000
    },
    "primaryType": "Permit",
    "types": {
      "EIP712Domain": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "version",
          "type": "string"
        },
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "Permit": [
        {
          "name": "owner",
          "type": "address"
        },
        {
          "name": "spender",
          "type": "address"
        },
        {
          "name": "value",
          "type": "uint256"
        },
        {
          "name": "nonce",
          "type": "uint256"
        },
        {
          "name": "deadline",
          "type": "uint256"
        }
      ]
    }
  },
  "signature": "ada7c1b898baf4880c9978ccc1ee38aab685c87b66fd8feff5caf5fc1c07e41106ec04e064e001e6a3064e50b1a9a49f375da04745e347be4d93036b076a099e1c"
}

Output type: ApiSingle[bool]

Example output
true

Python SDK:

def submit_transfer_permit(self, message: dict, signature: str) -> ApiSingle[bool]
SDK examples
msg = self.client.generate_transfer_permit(
    pool_address="0xb1be60448b947528298a2200f27a8abc3964097b",
    allowance={
        "type": AllowanceType.DECIMAL,
        "value": "10000"
    },
    seconds_until_expiry=3600
).result
# produce_signature() is not provided
signature = produce_signature(msg, WALLET_PK)
client.submit_transfer_permit(message=msg, signature=signature)

# or use the helper to generate, sign and submit the permit
from variational import TransferPermitHelper

permits = TransferPermitHelper(client=client, private_key=WALLET_PK)
permits.sign_and_submit_decimal(
    pool_address="0xb1be60448b947528298a2200f27a8abc3964097b",
    allowance=str(10000)
)

Utility

GET /v1/status

Returns current authentication information and server time in milliseconds. This endpoint can be used to check connectivity liveness and measure latency.

Output type: ApiSingle[Status]

Example output
{
  "result": {
    "auth": null,
    "server_timestamp_ms": 1707156691716
  }
}

Python SDK:

def get_status(self) -> ApiSingle[Status]
SDK examples
status = client.get_status().result

GET /v1/metadata/supported_assets

Returns tokens supported by the platform, their metadata, and funding rate parameters.

Parameters:

  • verified: boolean (optional) — ensures only verified assets are returned

Output type: ApiSingle[Dict[AssetToken, List[SupportedAssetDetails]]]

Example output
{
  "result":
  {
    "BTC":
    [
      {
        "asset": "BTC",
        "asset_name": "BTC",
        "is_dex": false,
        "last_updated_at": "2024-03-07T00:03:20.836Z",
        "precision": 8,
        "variational_funding_rate_params":
        {
          "extreme_slope": "0.0000001",
          "extreme_threshold": "0.9",
          "high_slope": "0.00000003",
          "high_threshold": "0.7",
          "min_imbalance_dollars": "10000",
          "normal_slope": "0.00000001",
          "normal_threshold": "0.5"
        }
      }
    ],
    "ETH":
    [
      {
        "asset": "ETH",
        "asset_name": "ETH",
        "is_dex": false,
        "last_updated_at": "2024-03-07T00:03:20.831Z",
        "precision": 8,
        "variational_funding_rate_params":
        {
          "extreme_slope": "0.0000001",
          "extreme_threshold": "0.9",
          "high_slope": "0.00000003",
          "high_threshold": "0.7",
          "min_imbalance_dollars": "10000",
          "normal_slope": "0.00000001",
          "normal_threshold": "0.5"
        }
      }
    ]
  }
}

Python SDK:

def get_supported_assets(self, verified: Optional[bool] = False,
                         page: Optional[Dict] = None) \
                            -> ApiSingle[Dict[AssetToken, List[SupportedAssetDetails]]]
SDK examples
all_supported_assets = client.get_supported_assets().result
verified_supported_assets = client.get_supported_assets(verified=True).result

Last updated