After sharing your historical business transactions and creating your customers, you can start hedging transactions. At Grain, hedging is a two-step process — get a quote, then accept it.Documentation Index
Fetch the complete documentation index at: https://docs.grainfinance.co/llms.txt
Use this file to discover all available pages before exploring further.
1. Get a quote
First, get a quote for your cross-currency business transaction. The quote can be used to display a product price to your customers in a local currency. Grain offers two methods for pulling quotes:a. Real-time quote
Pull an online quote on demand for a specific due date, with a default expiration of 5 minutes. Get the local currency price using the get quote endpoint:b. Offline quotes
Retrieve quotes for all operational currencies and supported tenors in a single call. You’ll receive a complete quote table, which allows offline quote selection based on each transaction’s currency pair, due date, and corresponding tenor. This approach eliminates the need to call Grain individually for each transaction and reduces system load. The table’s expiration time is configurable, with a default of 1 hour. Retrieve bulk offline quotes using the offline quote endpoint:2. Accept the quote
In this step, you will accept a quote you received in the previous step and create the hedge. a. Accept real-time quote — if you used the “Get Real-time quote” call, send the quote ID received in that call (ashedgeProposalId) using the accept quote endpoint: