Inspiration
A trucker can have a $3,000 freight invoice and still come up short on a $745 diesel bill. In our sample load, fuel is due on day 5 and freight pays on day 28. We built FreightOS to answer a practical question: what’s the cheapest way to pay the fuel vendor and keep enough cash for the road?
How we built it
We built a Python optimizer that compares cash, early invoice payments, bank credit, and a Kamino reserve across six fuel budgets informed by recorded Gemini oil-market data. The interface shows who pays each part, when the money arrives, and what it costs. A Rust program on Solana enforces the approved reserve payment.
Challenges
Invoice terms have to be chosen before the final fuel bill is known. We kept those terms fixed across all six budgets while allowing the reserve draw to change. We also had to account for vault rounding so the vendor would receive the exact approved amount.
What we learned
Paying a fee can save money. On our sample load, accepting a $5 fee to collect a customer surcharge early reduced modeled funding costs from $13.45 to $8.49. We then demonstrated the payment at test scale on Solana Devnet: the customer and carrier co-signed one transaction, and the fuel vendor received exactly 7.45 test USDC
Built With
- circle-usdc
- css
- gemini-prediction-markets
- html
- javascript
- kamino-lending
- kamino-vaults
- litesvm
- mixed-integer-optimization
- orca-whirlpools
- pytest
- python
- rust
- solana
- solana-devnet
- solana-rpc
- spl-token