curl --request POST \
--url https://api.grainfinance.co/v1/customers/{customerId}/hedges/quote \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-Customer-IP: <x-customer-ip>' \
--data '
{
"fromCurrency": "MXN",
"toCurrency": "USD",
"toCurrencyAmount": 1560,
"externalMarkupPct": 1,
"endAt": "2023-02-23"
}
'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"fixedSide": "toCurrencyAmount",
"fromCurrency": "MXN",
"toCurrency": "USD",
"fromCurrencyAmount": 32161.8,
"toCurrencyAmount": 1560,
"quote": 20.6165,
"endAt": "2023-04-15",
"settlementAt": "2023-04-18",
"validUntilTs": 1659625098,
"initialCollateralPercentage": 5,
"externalMarkupPct": 1
}Quote
Generates a real-time rate proposal for a new hedge associated with the specified customer. Once accepted, this proposal becomes a confirmed hedge.
curl --request POST \
--url https://api.grainfinance.co/v1/customers/{customerId}/hedges/quote \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'X-Customer-IP: <x-customer-ip>' \
--data '
{
"fromCurrency": "MXN",
"toCurrency": "USD",
"toCurrencyAmount": 1560,
"externalMarkupPct": 1,
"endAt": "2023-02-23"
}
'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"fixedSide": "toCurrencyAmount",
"fromCurrency": "MXN",
"toCurrency": "USD",
"fromCurrencyAmount": 32161.8,
"toCurrencyAmount": 1560,
"quote": 20.6165,
"endAt": "2023-04-15",
"settlementAt": "2023-04-18",
"validUntilTs": 1659625098,
"initialCollateralPercentage": 5,
"externalMarkupPct": 1
}Authorizations
Basic authentication using the partner API keys from https://console.grainfinance.co/keys
Headers
Path Parameters
Body
Information required by Grain in order to generate a hedge proposal.
Specifies the amount to hedge in the toCurrency. When provided, this sets fixedSide to toCurrencyAmount, and the fromCurrencyAmount is derived as: fromCurrencyAmount = toCurrencyAmount × quote. Exactly one of toCurrencyAmount or fromCurrencyAmount may be provided. Alternatively, neither may be provided to defer amount specification to the Accept call.
1560
Specifies the amount to hedge in the fromCurrency. When provided, this sets fixedSide to fromCurrencyAmount, and the toCurrencyAmount is derived as: toCurrencyAmount = fromCurrencyAmount / quote. Exactly one of toCurrencyAmount or fromCurrencyAmount may be provided. Alternatively, neither may be provided to defer amount specification to the Accept call.
Response
Hedge Proposal Created
Indicates which currency amount was fixed (specified) when creating the quote.
When fixedSide is toCurrencyAmount, the toCurrencyAmount was specified and fromCurrencyAmount was calculated.
When fixedSide is fromCurrencyAmount, the fromCurrencyAmount was specified and toCurrencyAmount was calculated.
Only present if an amount was provided at quote time.
toCurrencyAmount, fromCurrencyAmount "toCurrencyAmount"