Overview
CAMP’s public API consists of 3 main endpoints. We offer the ability to stream indicative quotes, perform a formal RFQ and finally submitting of signed orders.
Addresses on Ethereum mainnet
USDca: 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3
CAMP Minting contract: 0x2CC440b721d2CaFd6D64908D6d8C4aCC57F8Afc3
These addresses are the production USDca and minting contract. Care should be taken using them as real value will be transferred.
Server location
CAMP's infrastructure is hosted on AWS Asia Pacific (Hong Kong) region, ap-east-1. Low latency with our infrastructure is necessary to algorithmically mint or redeem with CAMP as quotes are valid for limited time.
Indicative quote endpoint
This endpoint continuously updates at 0.25s intervals. It provides up to date information on mint/redeem pricing and size limits at the current instant.
Your request
key
Possible values
Description
pair
stETH/USDca
the only pair collateral/USDca pair accepted
Our response
key
Possible values
Description
pair
stETH/USDca
the only pair collateral/USDca pair accepted
mint
array of mapping [{size: 2, price: 1545.32},…]
indicative price of minting stETH for USDca by size
redeem
array of mapping [{size: 2, price: 1545.33},…]
indicative price of redeeming USDca for stETH by size
size
2,4,8,16,32…
size of base asset. (stETH)
price
1800.21
Price to buy/sell each stETH in USDca, before gas
gas
6.4718
Estimated gas cost of the tx.
max-mint
100000
maximum size of USDca you can mint in an order
max-redeem
100000
maximum size of USDca you redeem mint in an order
remaining-mint
80000
remaining USDca amount you can mint this block
remaining-redeem
80000
remaining USDca amount you can redeem this block
Note: Table fields in Purple are yet to be implemented.
Remaining mint and redeem amounts exist as CAMP’s minting contract has a configurable per block limit of mints and redeems. The value we will launch with is 100,000.
At the start of each block, the limit is refreshed to 100,000. On CAMP receiving an order, the remaining mint/redeem values are deducted by the order’s size, checked then sent on chain; executed on a first come first serve basis.
Example request
curl 'https://api2.
CAMP.fi/indicative?pair=stETH/
USDca'
Example response
Copy
RFQ Endpoint
Call the RFQ endpoint to receive a formal mint/redeem quote. Quotes are valid for 500 milliseconds upon us sending our response.
Your request
key
Possible values
Description
pair
stETH/USDca
collateral/USDca pairs we support
side
mint,redeem
size
21.2918
size of asset you will send us. stETH for mint, USDca for redeem
Our response
key
Possible values
Description
rfq_id
RFQ-B7MT6QD2JKFFC
Unique ID to be sent back to us when submitting order
pair
stETH/USDca
side
mint, redeem
size
1
size of asset you will send us. stETH for mint, USDca for redeem.
amount
1552.2695
amount of asset you will receive, before gas. USDca for mint, stETH for redeem.
collateral_asset_address
0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
The non-USDca asset in the transaction
USDca _address
0x8191DC3053Fe4564c17694cB203663d3C07B8960
Address of USDca
collateral_amount
1000000000000000000
Use this value for EIP712 signature. For mints, this is the same as size
but in 18 decimals. For redeems, this is amount
minus gas converted to stETH in 18 decimals
USDca _amount
1550198770000000000000
Use this value for EIP712 signature. For redeems, this is the same as size
but in 18 decimals. For mint, this is amount
minus gas in 18 decimals
gas
2.070727513
the gas price of this tx in USD.
Example mint request
https://api2.
CAMP.fi/rfq?pair=stETH/
USDca&side=mint&size=1
Response
Copy
Example redeem request
https://api2.
CAMP.fi/rfq?pair=stETH/
USDca&side=redeem&size=1000
Response
Copy
Orders Submission Endpointr
After receiving the RFQ response, if you wish to execute the order as quoted, sign an EIP-712 signature using the USDca_amount
and collateral_amount
values. Our system only accepts orders with matching values for the 2 fields, and if the order is submitted and received within 500 milliseconds of our previous RFQ response.
The order process has no interaction with the smart contracts as CAMP receives your orders, passes them through checks, then submits the order onchain.
Example payload
key
value
Description
signature
0xf80a44c799d13f257fa25459a9e2d36dadfea48a78f699de3f09fc3009a0e92d63b51ce85003c95cd7f4b80c271659092b898192d83fcd0dc1e3aae7483d59931b
Resulting signature from signing the order
order
See EIP712 signature ORDER_TYPE below
The order in plain json that they used to sign and create the signature
rfq_id
RFQ-5X5PFG1N782KM
rfq_id from rfq step
Copy
Response
Copy
The tx that went onchain
https://etherscan.io/tx/0xb0e5aad7c1e905b3dfe27dea73327eec6e31d89081e78e4442cd34aa5f9e41ae
EIP712 signature ORDER_TYPE
bytes32 private constant ORDER_TYPE = keccak256( "Order(uint8 order_type, uint256 expiry, uint256 nonce, address benefactor, address beneficiary, address collateral_asset, uint256 collateral_amount, uint256
USDca_amount)" );
order key
values
Notes
order_type
0 or 1
0 for mint, 1 for redeem
expiry
1697334256
Use an expiry of current time + 45s
nonce
256
Use a unique int for each order. eg timestamp
benefactor
0x796Ee28CE42BF7bd43A09aCd43FAd0aACD7C3b29
address of signer. address where the asset is taken from (stETH for mint, USDca for redeem)
beneficiary
0x796Ee28CE42BF7bd43A09aCd43FAd0aACD7C3b29
address that receives funds. (USDca for mint, stETH for redeem).
collateral_asset
0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
stETH address
collateral_amount
2369467000000000
Amount of stETH in 18 decimals. Use the exact value provided in RFQ
USDca_amount
1645047190000000000
Amount of USDca in 18 decimals. Use the exact value provided in RFQ
Example raw order (before signing)
Copy
Our response
We will either respond with a tx hash, where your order passed our checks and is sent to the blockchain or a failure message with a reason for failure.
The most common failure reasons include an invalid EIP-712 signature, submitting an order after the quote has expired or not having sufficient assets in your address for the mint or redeem.
Last updated