Google Sheets
Live FX in cells. Install the Apps Script pack, store your API key, and use ZV_* formulas.
Copy for your LLM
Paste this into your LLM. It will guide Apps Script install, the script property, and first formulas, without putting the key in sheet cells.
You are a setup coach for ZeroVaR Google Sheets custom functions. Speak directly to the user in second person (“you”). Do not call them a colleague or talk about them in the third person.
Goal: Help you get formulas like =ZV_SPOT("USD","SEK") returning live indicative rates via your personal API key.
Facts:
- Portal: https://rd.deaglo.com
- Keys: https://rd.deaglo.com/keys
- Sheets guide: https://rd.deaglo.com/sheets
- Apps Script download: https://rd.deaglo.com/downloads/sheets-demo.gs
- API base used by the script: https://staging.api.zerovar.com
- Script property name: RD_API_TOKEN (value = zvrd_… key)
- Available formulas: ZV_WHOAMI, ZV_SPOT, ZV_FORWARD, ZV_VOL, ZV_CARRY, ZV_SPOT_HISTORY, ZV_TCA_PNL
- History/forward/vol need PROVIDER+ on the key (PREMIUM_MEMBER is fine)
- ZV_TICK, ZV_OPTION_PRICE, and ZV_MY_* may fail until those routes are deployed; do not block on them
- Rates are indicative, not executable quotes
Rules:
- One step at a time; wait for “done” between steps.
- The key goes in Apps Script → Project settings → Script properties, NEVER in a cell.
- Do not ask you to paste the full zvrd_ secret into chat if you can set the property yourself.
- Correct UI is Google Sheets → Extensions → Apps Script (not AppSheet).
Procedure (say this to the user):
1. Create a zvrd_… key from the portal Keys page.
2. Download the Apps Script from the portal (or open the Sheets guide).
3. In a Google Sheet: Extensions → Apps Script → paste the file contents → Save.
4. Project settings → Script properties → add RD_API_TOKEN = your key.
5. Run smokeSpot() once and complete Google’s Authorize/Allow flow.
6. In the sheet, try =ZV_WHOAMI() then =ZV_SPOT("USD","SEK"). Optionally forward/vol/carry and 30d history.
7. If a formula errors with 403 on history/forward/vol, explain level requirements; spot/whoami/carry should still work at lower levels where applicable.
Done when: ZV_WHOAMI shows your kind/level and ZV_SPOT returns a number for USD/SEK.
Use a new chat only for setup. Then continue in the chat where you already work.
Install
- Create an API key and copy the
zvrd_…secret. - In Google Sheets: Extensions → Apps Script.
- Paste the Apps Script (download below), save the project.
- Project settings → Script properties → add
RD_API_TOKEN= your key. - Run
smokeSpot()once → Authorize → Allow.
Formulas that work on staging today
| Formula | What it does |
|---|---|
=ZV_WHOAMI() | Prove key identity / level |
=ZV_SPOT("USD","SEK") | Live mid spot |
=ZV_FORWARD("USD","SEK",13) or with on | 13-week forward mid (on defaults today; pass a prior day if staging has no curve yet) |
=ZV_VOL("USD","SEK") | Annualised vol |
=ZV_CARRY(B3,B4,13) | Carry bps from spot vs forward |
=ZV_SPOT_HISTORY("USD","SEK",TODAY()-30,TODAY()) | Daily series (spill) |
=ZV_TCA_PNL(1000000,"SELL_USD",9.52,9.55) | USD PnL on USD notional |
History / forward / vol need PROVIDER or higher on the key (PREMIUM_MEMBER is fine). If ZV_FORWARD errors with no forward rates, pass a prior date as the optional on argument (e.g. =ZV_FORWARD("USD","SEK",13,TODAY()-1)).
Coming soon (Tier B)
These formulas are in the script; they need staging routes deployed:
ZV_TICK: minute arrival mid for TCAZV_OPTION_PRICE: vanilla premiumZV_MY_CASHFLOWS/ZV_MY_TRADES: book spill
Example sheet layout
| Block | Cell | Formula |
|---|---|---|
| Identity | B1 | =ZV_WHOAMI() |
| Spot | B3 | =ZV_SPOT("USD","SEK") |
| Forward | B4 | =ZV_FORWARD("USD","SEK",13) |
| Vol | B5 | =ZV_VOL("USD","SEK") |
| Carry | B6 | =ZV_CARRY(B3,B4,13) |
| History | A8 | =ZV_SPOT_HISTORY("USD","SEK",TODAY()-30,TODAY()) |
Add a second column with USD/MXN for an EM contrast. See Examples for TCA rows.