When to use this
- You’re adding the SDK to a project for the first time and want to verify the flow before pointing it at production.
- You’re writing CI tests that should not depend on network connectivity or mainnet balances.
- You’re reproducing a bug a user reported and need a deterministic environment.
Fork mainnet for end-to-end tests
Velora’s contracts (Augustus router, Delta, AugustusRFQ) deploy to production networks only; there’s no testnet deployment. The standard pattern is to fork mainnet (or your target chain) and impersonate a funded account.Tenderly
Tenderly Virtual TestNets (forks) are the most widely used option: a hosted fork with a public RPC, a block explorer, and unlimited faucet, so you don’t run a node locally and your whole team can share one environment. Create a fork in the Tenderly dashboard (or via the API), then point the SDK at its RPC URL:tenderly_setBalance / tenderly_setErc20Balance RPC methods (or the dashboard), so you don’t need a real whale address. Because the RPC is hosted, the same fork works from CI without spinning up a node.
Anvil (Foundry)
Hardhat
The SDK’s own tests use a Hardhat fork seeded via thePROVIDER_URL env var. The same approach works for your integration:
PROVIDER_URL=https://mainnet... npx hardhat test. The Velora SDK exposes overrides for impersonation via your provider; see the SDK’s own hardhat config for a reference.
Forking only spoofs the chain state. Quotes still come from the real Velora
API. Account-specific endpoints (allowance lookups against the impersonated
address) work because the fork’s RPC returns the impersonated account’s
storage.
Mock the fetcher in unit tests
For unit tests that shouldn’t touch the network, pass a customFetcherFunction that returns canned responses. The contract caller is still real, but no HTTP request leaves your process.
Debugging tips
- Check
partner. A missing or unknown partner key surfaces as400on quote/order endpoints. Confirm it’s set on every SDK call and matches the partner registered with Velora. - Confirm
chainIdmatches the connected wallet. Mismatched chains throw on signing, because the EIP-712 domain includeschainId. - Log raw fetcher calls. Wrap your fetcher to log
{url, method, status, durationMs}while developing. The SDK’s internal retries and partner-fee resolution can issue requests you don’t expect. - Watch Delta status transitions. A Delta order goes
OPEN→ACCEPTED→EXECUTED(orCANCELLED/EXPIRED). If it sticks atOPENfor more than a minute, the auction likely returned no fill. Cancel and re-quote. - Verify the spender. For Delta the user approves
getDeltaContract(). For Market Swaps the user approvesgetSpender()(TokenTransferProxy). Approving the wrong contract is the most common cause ofINSUFFICIENT_ALLOWANCE.
Related pages
- Troubleshooting: known failure modes per endpoint.
- Configure providers — fetcher and caller setup.