Rubicon RFQ

Rubicon RFQ System

Subject to Change

NOTICE: The details of the Rubicon RFQ System are subject to change. Please check back regularly for updates.

The Rubicon RFQ System exists to make our market maker's liquidity more accessible for price discovery. This system is designed to facilitate aggregators and traders seeking the best price by providing real-time quotes and streamlined execution. The RFQ System will evolve over time, adapting to the needs of the market and feedback from users.

1. Authentication

To obtain an API key for authentication, clients need to create a nickname, which will be used in the tag field. Then, contact Rubicon to obtain an API key. The API key will be assigned to the tag to authenticate requests.

With a valid API key, all RFQ queries should be sent to the base URL of https://rfq.rubicon.finance while targetting the relevant endpoint, as described below. Please note, that in the authentication process we also approve a specific address that is permitted to transact with RubiconRFQ; please coordinate with the team to arrange this.

2. Querying Price Levels

To query price levels, use the following endpoint:

GET https://rfq.rubicon.finance/price-levels
  ?chainId=<int>
  &tag=<string> # "nickname" of a client
  &sellToken=<string>
  &buyToken=<string>
  &deadline=<string> # unix timestamp - a deadline of a quote, used to return orders that will be valid until it 
  --header "X-API-KEY: obtained_key"

The response will have the following structure:

{
  "status": "success|fail",
  "chainId": "100",
  "pair": {
    "base": "0x0000000000000000000000000000000000000000",
    "quote": "0x0000000000000000000000000000000000000000"
  },
  "levels": [
    {
      "qMin": "100.10",
      "q": "1000.10",
      "p": "250.50"
    }
  ]
}

Please note, quantity (q) and price (p) are in human-readable amounts represented as a float and directional based on buyToken and sellToken. The user should be aware of the decimals associated with each token to convert these quantity and price values into uint values as needed. Please also note, that qMin must be taken from each order for that leg to be included in your trade - qMin is a mandatory constraint for any given order and represents the minimum quantity required to take for that leg of the trade to be valid.

3. Sending a Quote for a Match

To match a quote with the off-chain book, use the following endpoint:

GET https://rfq.rubicon.finance/match
  ?chainId=<int>
  &tag=<string> # "nickname" of a client
  &sellToken=<string>
  &buyToken=<string>
  &sellAmt=<string>
  &buyAmt=<string>
  &deadline=<string> # unix timestamp - a deadline of a quote, used to return orders that will be valid until it
  --header "X-API-KEY: obtained_key"

4. Getting Match Response

The server response will have the following structure:

{
  "orders": [{
    "encodedOrder": "0x...",
    "signature": "0x..."
  }],
  "quantities": ["0", "...", "n"]
}

5. Executing Response Data On-Chain

To execute the response data on-chain, first, approve sell tokens to the RubiconRFQ contract. This is a very important step and approvals must be in place or else the trade will fail.

Then, call the fill function on the contract for the relevant network you are targetting. Please see below for the deployments on each chain.

The fill function signature:

function fill(Quote calldata q, Response calldata r) external {}

Where Quote is:

struct Quote {
    address sellToken;
    address buyToken;
    uint256 sellAmt;
    uint256 buyAmt;
}

And Response is:

struct Response {
    SignedOrder[] orders;
    uint256[] quantities;
}

RFQ Contract Addresses

Below are the RFQ contract addresses per network:

NetworkContract Address
OP0xf8C8308a7C89315B8395A945C32E879a1295cD20
Base0x6b6B6aA808423FBeCc9cCeb4fDefFb76a550bAe7
ARB0x9B848639D3Bed6db856b3A69e3C33FBEbD672e6b

Contact Information

For any questions or additional information, feel free to reach out:

Important Notes

The details of the system are subject to change at any time. The Rubicon Team can exclude addresses at will for any reason. This would likely be due to perceived malicious behavior. Updates and changes to the system will be communicated through our official channels and reflected on this page. This page will be updated regularly to reflect any changes to the Rubicon RFQ System. Please ensure you are referring to the latest version.