Skip to content

feat(dapp): pay naira from sui through linq when it pays more than weave - #160

Open
0xDeon wants to merge 1 commit into
mainfrom
feat/linq-on-sui
Open

0xDeon wants to merge 1 commit into
mainfrom
feat/linq-on-sui

Conversation

@0xDeon

@0xDeon 0xDeon commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

What

A naira cash-out from Sui now compares Weave and Linq and places the order with whichever pays more.

  • Order route: gets Weave's quote and Linq's rate. If Linq pays more (an exact offer wins ties within 0.5%), it:
    • maps the bank by name to Linq's NIP code,
    • confirms with Linq's lookup that the holder matches the one Weave named,
    • places a Sui USDC order with manualDeposit, refunding to the user's own wallet.
  • Linq client: a Sui order is refused unless it comes back with chain sui, coin usdc, a 0x + 64-hex address, and exactly the USDC requested.
  • Fallback: if any Linq step fails or can't be confirmed, the cash-out goes to Weave as before. That includes an order whose locked naira comes in below Weave's offer. Unknown or mismatched Linq orders are reported.
  • Status: order status comes from Linq's /b2b/status, read with the Stellar flow's status rules. A Linq order stays waiting until this app has sent the deposit, so an unknown status can't block the deposit.
  • Quote route: shows Linq's naira when Linq wins.
  • Card: for a Linq order, the review and receipt show the exact amount with no "≈", since Linq locks the naira.
  • Migration 016: adds the provider column to weave_orders, defaulting to weave.

Other chains

Chain What changes
Stellar Nothing. Its naira still goes through its own Linq flow, and this route still refuses Stellar naira.
Solana, Avalanche Nothing. Linq isn't asked.
NEAR, Monad Nothing. Cash-outs are still closed.
Non-NGN currencies, any chain Nothing. Linq isn't asked.

Not yet verified

No real Sui order has been placed with Linq yet. The response checks follow Linq's docs and the shape of its Stellar orders. A ~$1 test on the preview comes before merging.

Checks

  • tsc and eslint are clean.
  • Full suite: 8246 of 8247 tests pass. The one failure, route-rate-limit > api/agents/compete, hit a 30s timeout under load and passes when run alone.

A Sui naira cash-out now asks both Weave and Linq. When Linq pays more, the
order is placed with Linq at the naira it locks, held to a Sui address, USDC
and exactly the amount asked, with Linq's lookup naming the same holder.
Any Linq step that can't be confirmed leaves the cash-out with Weave.
@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for useintent ready!

Name Link
🔨 Latest commit 483f2cf
🔍 Latest deploy log https://app.netlify.com/projects/useintent/deploys/6aee188979cee9020f76e8db
😎 Deploy Preview https://deploy-preview-160--useintent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for useintentadapp ready!

Name Link
🔨 Latest commit 483f2cf
🔍 Latest deploy log https://app.netlify.com/projects/useintentadapp/deploys/6aee18891a3566feaebd9749
😎 Deploy Preview https://deploy-preview-160--useintentadapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant