Add Robinhood Chain swap support - #483
Conversation
37d5a13 to
de63cfe
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
05bee10 to
703f05f
Compare
Map the robinhood plugin id to each provider's chain code so quotes can route to and from the chain. Every provider in the repo was probed against its own live discovery endpoint; six carry the chain: SideShift 'robinhood' native ETH and bridged WETH LI.FI 'out' cross-chain into 4663 Rango 'ROBINHOOD' chain enabled, tokens indexed ChangeNow 'hood' native ETH, USDG, CASHCAT, tokenized stocks Swapuz 'ROBINHOOD' native ETH, USDG, CASHCAT, PONS, PIPEDOG LetsExchange 'ROBINHOOD' CASHCAT and ARROW only, no native ETH ChangeNow's native-ETH pair was inactive when the chain was first mapped and now fills. LetsExchange is mapped despite carrying no native ETH: the map is chain-level while fill availability is per-pair and dynamic, and `chainCodeTickerMap` is built from the live API filtered to mapped chain codes, so an unmapped chain can never surface its tokens at all. Godex, Exolix, n.exchange and ChangeHero were probed and carry nothing on this chain, so they stay null. Changelly and Xgram could not be probed.
703f05f to
876a757
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 876a757. Configure here.
| 'qtum', | ||
| 'ravencoin', | ||
| 'ripple', | ||
| 'robinhood', |
There was a problem hiding this comment.
Swapter omits robinhood mapping
Low Severity
Adding robinhood to the plugin-id list updated every generated map and the hand-maintained changelly and nexchange files, but src/mappings/swapter.ts still jumps from ripple to rsk. That full matrix is supposed to carry an explicit null for a checked-unsupported chain so a later maintainer can tell a deliberate skip from a missed one.
Triggered by project rule: Bugbot Review Rules
Reviewed by Cursor Bugbot for commit 876a757. Configure here.
Reverts the #483 merge (d5861b9) so 2.54.0 publishes the LI.FI slippage change on its own. Robinhood re-lands by reverting this commit. Also restores the 'added: Swapter swap provider' entry to the 2.53.0 section, which #483 had moved up into Unreleased even though 2.53.0 is the version that shipped it.







CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
Companion PRs for the same chain (this PR is independent of both and passes CI standalone):
robinhoodcurrency pluginDescription
Maps the
robinhoodplugin id (Robinhood Chain, EVM chain 4663) onto each swap provider's own chain code, so quotes can route to and from the chain. No engine or plugin logic changes:lifi.ts,rango.tsand the central plugins all gate on a non-nullMAINNET_CODE_TRANSCRIPTIONlookup, so a chain the map does not know is invisible to the provider no matter what its API supports.robinhoodis added tosrc/util/edgeCurrencyPluginIds.tsviamapctl add-plugin; the six provider entries are authored inscripts/mappings/*Mappings.tsand thesrc/mappings/*.tsfiles are regenerated withnpm run mapctl update-mappings.Two of those generated files are hand-added here rather than regenerated.
updateMappingsinscripts/mapctl.tsiterates the synchronizer list, andchangellyhas a mapping file but no synchronizer whilenexchangeis hand-maintained with no source file at all, so the generator can never write either one. Both were missing exactly therobinhoodkey against every sibling, whichdocs/CHAIN_MAPPING_SYNCHRONIZERS.mdsays must be an explicitnullso a later maintainer can tell a deliberate exclusion from a missed one. Making the sweep iterate the authored mapping files instead is left as follow-up work.robinhood/v2/pair/btc-bitcoin/eth-robinhoodand/v2/pair/eth-arbitrum/eth-robinhoodboth quote, in both directionsout/v1/quoteroutes cross-chain into 4663. The key really is the stringout, which is what/v1/chainsreturns for this chainROBINHOODhoodROBINHOODrate/quotes 0.05 ETH into 0.04940 ETH on the chain, min 0.03402ROBINHOODinfoquotes 0.1 ETH into 1154.42 CASHCAT, min 0.06Two providers are mapped without a fillable native-ETH pair at the time of mapping, on the same reasoning: the map is chain-level while fill availability is per-pair and dynamic.
changenow.tsrebuildschainCodeTickerMaphourly fromexchange/currencies?active=truefiltered to the chain codes the map knows, so an unmapped chain could never appear even once a pair activates. ChangeNow proved the point: the pair it was mapped ahead of fills today with no further change. LetsExchange is the same bet on tokens rather than gas, and costs a declined quote meanwhile, sincecheckWhitelistedMainnetCodesraises a plainSwapCurrencyErrorfor a pair the provider cannot serve.Every provider in the repo was probed against its own live discovery endpoint, not against documentation. ChangeHero, Exolix, Godex and n.exchange carry nothing on this chain and stay
null. SwapKit's chain code appeared in an earlier sweep but is absent from its keyed provider list. Changelly and Xgram could not be probed: Changelly's API is request-signed, and the available Xgram key returns 401.Two providers advertise the chain but are deliberately left unmapped: LetsExchange carries only CASHCAT and ARROW there (no native ETH, so it cannot deliver gas), and SwapKit's
HOODcode turns up in the provider sweep with no tradeable asset behind it.Testing
npm run test(56 passing),tsc, andverify-repo.shall pass.Exercised end to end on the iOS simulator with this branch served into the app, which is what the mapping is for. An exchange of 529.16 S from My Sonic to a Robinhood Chain wallet quoted 0.006243 ETH "Powered by LI.FI" and executed to the success scene;
eth_getBalancefor the receiving address then returned 6248511112300593 wei and the wallet rendered0.006248511112300593 ETH.That balance unblocked the send that the chain integration could not previously test: 0.001 ETH sent from the funded wallet is transaction
0x70e4950b5991c9419eff70ea2478c7ae55c5c58adcc3da237d5889394f8fdf62,successin block 35308086.The route was pinned to LI.FI/Rango for the test by disabling competitors locally, because SideShift is geo-blocked from this host's egress; its mapping is verified against its live pair endpoint instead.
One unrelated gap this surfaced: Edge's rates server has no entry for
robinhood, so ETH on the chain prices at$0everywhere, and on the exchange scene that zero destination value trips the "High Price Impact" banner. Cosmetic, fixed where rates are configured rather than here.Design doc:
src/docs/robinhood-chain.md, section 7.Asana: https://app.asana.com/0/1215088146871429/1217382370104887
Note
Low Risk
Additive mapping data verified against live provider APIs; mis-mapping would mainly affect quote availability rather than altering existing swap execution paths.
Overview
Adds
robinhoodas an Edge currency plugin id and wires Robinhood Chain (EVM 4663) into swap routing through chain-code mappings only—no quote or engine logic changes. Providers only see a chain when theirsrc/mappings/*.tsentry is non-null.Enabled on six partners with each provider’s own identifier: SideShift (
robinhood), LI.FI (out), Rango (ROBINHOOD), ChangeNow (hood), Swapuz (ROBINHOOD), and LetsExchange (ROBINHOOD). Authoritative entries live inscripts/mappings/*Mappings.ts; mostsrc/mappings/*.tsfiles are regenerated, withchangellyandnexchangeupdated by hand to setrobinhood→nulllike the other unsupported providers.Every other swap partner in the repo gets an explicit
robinhood→nullmapping so the chain stays invisible where APIs do not support it. CHANGELOG records Robinhood Chain swaps via those six integrations.Reviewed by Cursor Bugbot for commit 876a757. Bugbot is set up for automated code reviews on this repo. Configure here.