Search the Community
Showing results for tags 'pathfinding'.
Found 4 results
Minimum search term is 4 characters long. Can't find what you want? Click here for the custom google search instead.
-
Hi, I'm trying to create a path for 4 IOU this way: UYU->CLP->ARS->USD using ripple-lib v1.8.0. To accomplish that path I created the following offeres: Sell: 5000 CLP by 100 UYU (with address: rsQnJoxohQX947GGUMvom1bLM1TA6haQui), here is an screenshot of the offer on http://ripplerm.github.io/ripple-wallet/ The tx on testnet: https://testnet.xrpl.org/transactions/0F43789AAEDD00DE391AB9C6AE68E7816F2664F6D9C5FAF8C09E8A72408B0544/raw { "tx": { "Account": "rsQnJoxohQX947GGUMvom1bLM1TA6haQui", "Fee": "12", "Flags": 2148007936, "LastLedgerSequence": 12245620, "Sequence": 7265737, "SigningPubKey": "02CBEC578B218CB81A122303974050E42EDD998275B15A122DBEA54982EABF0B9E", "TakerGets": { "currency": "CLP", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5000" }, "TakerPays": { "currency": "UYU", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "100.0000000000001" }, "TransactionType": "OfferCreate", "TxnSignature": "3045022100992D0F29B13545B4DF0B658A3A30EB93A3CB8CD3E50D5013804FCF5FADD5FB040220334ABF952C6BD34E6916551E45E340156561E8032639F82A8FEA8F91E667540D" }, "meta": { "AffectedNodes": [ { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "C0FDF86D019412AA2E85346CD8133A6F16768503A9D86DD853071AFD498D0002", "NewFields": { "ExchangeRate": "53071AFD498D0002", "RootIndex": "C0FDF86D019412AA2E85346CD8133A6F16768503A9D86DD853071AFD498D0002", "TakerGetsCurrency": "000000000000000000000000434C500000000000", "TakerGetsIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A", "TakerPaysCurrency": "0000000000000000000000005559550000000000", "TakerPaysIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A" } } }, { "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "E0F7EE8AC234BE35D643853C2B121E7B48B571BB563C142C38BBA5AD1330F98A", "NewFields": { "Account": "rsQnJoxohQX947GGUMvom1bLM1TA6haQui", "BookDirectory": "C0FDF86D019412AA2E85346CD8133A6F16768503A9D86DD853071AFD498D0002", "Flags": 131072, "Sequence": 7265737, "TakerGets": { "currency": "CLP", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5000" }, "TakerPays": { "currency": "UYU", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "100.0000000000001" } } } }, { "ModifiedNode": { "FinalFields": { "Account": "rsQnJoxohQX947GGUMvom1bLM1TA6haQui", "Balance": "119999496", "Flags": 8388608, "OwnerCount": 5, "Sequence": 7265738 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "EB1C6C904638FD10CB6020345045D9D1DA75C2F1EE577DD0C5FA26BEB9213D2A", "PreviousFields": { "Balance": "119999508", "OwnerCount": 4, "Sequence": 7265737 }, "PreviousTxnID": "04DC23330FE70D07934B821161BACEC3E1E3078677427DF3051DAB7938745930", "PreviousTxnLgrSeq": 12245413 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rsQnJoxohQX947GGUMvom1bLM1TA6haQui", "RootIndex": "EE83190D48E5479A3B59A5ECB73BD76A459487B9C5A2CC3DFF4F92F88D665DC3" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "EE83190D48E5479A3B59A5ECB73BD76A459487B9C5A2CC3DFF4F92F88D665DC3" } } ], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "hash": "0F43789AAEDD00DE391AB9C6AE68E7816F2664F6D9C5FAF8C09E8A72408B0544", "ledger_index": 12245619, "date": "2020-11-11T22:55:10Z" } Sell: 8000 ARS by 5000 CLP (with address: rEX4LtGJubaUcMWCJULcy4NVxGT9ZEMVRq), here is an screenshot of the offer on http://ripplerm.github.io/ripple-wallet/ The tx on testnet: https://testnet.xrpl.org/transactions/8CD581061AD57FA40FB580D078766D41C4A92756E6CE3EE49966A45CB3E6F40A/raw { "tx": { "Account": "rEX4LtGJubaUcMWCJULcy4NVxGT9ZEMVRq", "Fee": "12", "Flags": 2148007936, "LastLedgerSequence": 12245642, "Sequence": 7126215, "SigningPubKey": "02D2594FDCF4A62BF8780455364769F6810329233B4BAF5B7D1E613B1B88980812", "TakerGets": { "currency": "ARS", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "8000" }, "TakerPays": { "currency": "CLP", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5000.000000000001" }, "TransactionType": "OfferCreate", "TxnSignature": "3044022025250CBDF565A467C08AECF1CEC73A572233CD085D3045ED6CE44903DB8064BE022056ED4218E7BE08AF77109AC56670767FDCCDFFC217C99383E46173AF24B47022" }, "meta": { "AffectedNodes": [ { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rEX4LtGJubaUcMWCJULcy4NVxGT9ZEMVRq", "RootIndex": "1B9332CB284B16FFE7A5F58EC3133004A049C4D63B4D3140F5E5276B7E409C72" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "1B9332CB284B16FFE7A5F58EC3133004A049C4D63B4D3140F5E5276B7E409C72" } }, { "ModifiedNode": { "FinalFields": { "Account": "rEX4LtGJubaUcMWCJULcy4NVxGT9ZEMVRq", "Balance": "79999124", "Flags": 8388608, "OwnerCount": 5, "Sequence": 7126216 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "8FB206B8915A9504A943FD939488082316AF6F85BEEAF2401059662A9E2C6B19", "PreviousFields": { "Balance": "79999136", "OwnerCount": 4, "Sequence": 7126215 }, "PreviousTxnID": "67BA898A2ECC5F587973D47A438616EDE7693868627DF6D14ECDB044DADD62BA", "PreviousTxnLgrSeq": 12245380 } }, { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "A4960CBBB60160A06DD873FA9629DC22CB8781EE4BCD0AA45416345785D8A001", "NewFields": { "ExchangeRate": "5416345785D8A001", "RootIndex": "A4960CBBB60160A06DD873FA9629DC22CB8781EE4BCD0AA45416345785D8A001", "TakerGetsCurrency": "0000000000000000000000004152530000000000", "TakerGetsIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A", "TakerPaysCurrency": "000000000000000000000000434C500000000000", "TakerPaysIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A" } } }, { "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "EC8435729935A26745760261118A237CB38D0C5782601C56479663EA82DF3623", "NewFields": { "Account": "rEX4LtGJubaUcMWCJULcy4NVxGT9ZEMVRq", "BookDirectory": "A4960CBBB60160A06DD873FA9629DC22CB8781EE4BCD0AA45416345785D8A001", "Flags": 131072, "Sequence": 7126215, "TakerGets": { "currency": "ARS", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "8000" }, "TakerPays": { "currency": "CLP", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5000.000000000001" } } } } ], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "hash": "8CD581061AD57FA40FB580D078766D41C4A92756E6CE3EE49966A45CB3E6F40A", "ledger_index": 12245641, "date": "2020-11-11T22:56:31Z" } Sell: 5 USD by 8000 ARS (with address: rMeYY1MGvsv9YovNFSD1bR9EaAtCTFKYNh), here is an screenshot of the offer on http://ripplerm.github.io/ripple-wallet/ The tx on testnet: https://testnet.xrpl.org/transactions/E87E282CAE3989CCF36694E327BF82016DA4EFFECDFD1F8CB64A4561FDD69969/raw { "tx": { "Account": "rMeYY1MGvsv9YovNFSD1bR9EaAtCTFKYNh", "Fee": "12", "Flags": 2148007936, "LastLedgerSequence": 12245661, "Sequence": 7055527, "SigningPubKey": "0397C70210BB7464D7BEB9187B416E74530416768B02A8ABFE73906CB27A4FE5C9", "TakerGets": { "currency": "USD", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5" }, "TakerPays": { "currency": "ARS", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "8000.000000000001" }, "TransactionType": "OfferCreate", "TxnSignature": "304402202C2E6B76E897B391B25A77542C55B7AF55165BC346BE6134A8B603FB0E97257402200D80D678790BF93ACA09FC350885F2090ECBACD493B4E97EEFDC0CEC4FE27A5A" }, "meta": { "AffectedNodes": [ { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rMeYY1MGvsv9YovNFSD1bR9EaAtCTFKYNh", "RootIndex": "039B927C180774CE50549BFA87B49635A84402CE2143A3F38AA0134BD4E04FAC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "039B927C180774CE50549BFA87B49635A84402CE2143A3F38AA0134BD4E04FAC" } }, { "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "11CA3B97C3B2258AF2209A87C64710BA688117A0E15E17306B04128452C7CE4D", "NewFields": { "Account": "rMeYY1MGvsv9YovNFSD1bR9EaAtCTFKYNh", "BookDirectory": "32EA6194D35BB1DB2FCCA06A4522813361A56149DAADC2E75805AF3107A40000", "Flags": 131072, "Sequence": 7055527, "TakerGets": { "currency": "USD", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "5" }, "TakerPays": { "currency": "ARS", "issuer": "rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH", "value": "8000.000000000001" } } } }, { "ModifiedNode": { "FinalFields": { "Account": "rMeYY1MGvsv9YovNFSD1bR9EaAtCTFKYNh", "Balance": "64996484", "Flags": 8388608, "OwnerCount": 5, "Sequence": 7055528 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "2B9FA17B8E855741FFD6687FD12534AEE177FDE5AA7129B3FBD9D1CF57D6AE99", "PreviousFields": { "Balance": "64996496", "OwnerCount": 4, "Sequence": 7055527 }, "PreviousTxnID": "580F78BF077788E84460F2341600C3C9BF7DDF6FE2A0D0FD559858D9AA2EB024", "PreviousTxnLgrSeq": 12245348 } }, { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "32EA6194D35BB1DB2FCCA06A4522813361A56149DAADC2E75805AF3107A40000", "NewFields": { "ExchangeRate": "5805AF3107A40000", "RootIndex": "32EA6194D35BB1DB2FCCA06A4522813361A56149DAADC2E75805AF3107A40000", "TakerGetsCurrency": "0000000000000000000000005553440000000000", "TakerGetsIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A", "TakerPaysCurrency": "0000000000000000000000004152530000000000", "TakerPaysIssuer": "DC596C88BCDE4E818D416FCDEEBF2C8656BADC9A" } } } ], "TransactionIndex": 5, "TransactionResult": "tesSUCCESS" }, "hash": "E87E282CAE3989CCF36694E327BF82016DA4EFFECDFD1F8CB64A4561FDD69969", "ledger_index": 12245660, "date": "2020-11-11T22:57:41Z" } All the IOU are from the same gateway: rMaa8VLBTjwTJWA2kSme4Sqgphhr6Lr6FH. All the addresses involved in this example have trustlines with the gateway for the four IOU (UYU, CLP, ARS, USD) and all have a balance with the gateway of $100K and a limit of $1Billion for each IOU (you can check it on http://ripplerm.github.io/ripple-wallet/ using testnet), this is the address used to find the path (rKSSpinGrMMPAuKBPH7Qpyxq2cMjpSgdqi): After calling RippleAPI.getPaths with this paramter { "source": { "address": "rKSSpinGrMMPAuKBPH7Qpyxq2cMjpSgdqi", "amount": { "currency": "UYU", "value": "100" } }, "destination": { "address": "rKSSpinGrMMPAuKBPH7Qpyxq2cMjpSgdqi", "amount": { "currency": "USD" } } } I was expecting 5 USD, since we can follow this path: 100UYU->5000CLP->8000ARS->5USD, but got If instead of USD I set ARS or CLP in destination.amount.currency get the expected results of 8000ARS and 5000CLP respectively. I also double check all the address involved have enough money on their trustlines with the gateway. I So, why I cannot reach the path up to USD?
- 6 replies
-
- ripple-lib
- pathfinding
-
(and 2 more)
Tagged with:
-
Noob question hour #6 Recent ledgers have ~2.2 k trading pairs. I wonder if there is any limit for the length of the path a payment may take. If one were to supply a custom path of 50, 100, 500 "hops", when does rippled outright refuses such payments. Or will it just freeze, if VM lacks memory to process such path? Also, https://ripple.com/build/paths/ has an interesting illustration regarding likelihood of success of certain paths. Why is rippling through two issuers unlikely to work?
-
I'm trying to send Gatehub USD from my account to another. The other party has more USD trust lines including USD:Gatehub, USD:Bitstamp etc. I tried with gatehub.net and a desktop wallet, both try to automatically convert Gatehub USD to Bitstamp's because it's currently "profitable" (e.g. the USD/USD ratio is far from 1). I guess this is ripple's feature of pathfinding. Is there any way of bypassing this? The other party really wants USD:Gatehub and if they get USD:Bitstamp, they'll need to convert it back which will likely be loss.
-
- trust lines
- pathfinding
-
(and 1 more)
Tagged with:
-
I am falling down the rabbit hole, trying to build a complete traversable map of all relationships that exist on RCL. Disclaimer: am not a techy person. Expect misnomers and facepalms down the way. Hence it is in Off-topic subforum and not in Technical discussion. I was trying to build a list of Gateway<-wallets->gateway to be able to query the wallets that satisfy certain criteria. And after many sleepless nights of digging into ripple-lib and nodejs I finally managed to get a complete lists of wallets that trust chosen gateway and all their trustlines. For ~4k of those wallets, it took a nice dozen of MBs in a json file. Traversing through the contents is an adventure of its own. And since a similar list of gatehub or bistamp would probably take GBs and the power my poor PC can't sustain, I decided to look elsewhere. So I found a concept of graph database, which seems perfect for the task. But me being me - I may have completely miscalculated this one as well. Maybe you have been dealing with the same problem, or are knowledgeable in neo4j and willing to help. So here are my questions. RippleCharts (when you put the address in account explorer) represents each address as a node and trustlines appear to be a relationship between the nodes. So is relationship/trustline a place that stores all details re: currency and balances. How will the pathfinding work then? Neo4j has a tutorial for currency arbitrage, but they represent the currencies as nodes, and relationships are rates (albeit without order size). But if wallets are nodes in case of RCL, where does it live the trustlines? I was thinking to represent each IOU as a subnodes of the issuing wallet. While it may seem to be closer to neo4j's tutorial, I still have no idea how to represent the orderbook of RCL. The raw data indicates that standing offers are Offer.Nodes of the maker-account. So should I make them subnodes too? Ripple has 300k+ wallets as of now. If I choose to spawn subnodes per issuing wallet node, it will take the total node count into tens of millions - and there is no way my laptop could churn the query in under 3.5 seconds... Then there is a completely separate case of Rippling flag and the whole mechanic. I honestly have no idea how to make that work, especially in case of IOU.noRippleflagOn-IOU.noRippleflagUndefined pair, where Rippling itself can happen only in one direction (from noRipple to Ripple), provided the balances are lower than the limits in trustline. TL;DR How would you represent RCL data in a graph database? 1. Are wallets - nodes; trustlines - edges (or relationships in neo4j terms)? 2.Are wallets' offers - edges or nodes as well? 3.What is Rippling - an edge, a node, an edge/node property? How can it be represented to mimic the behaviour it has on RCL? How can I specify path block, or that path is only available in one direction? 4. Where would you put the fee associated with transferring IOUs? Where would you put the order-size constraint (i.e. only a set_amount can traverse through this edge/node)? ... I guess XRP will be in upper two digits by the time I manage to find an answer at least to one of the questions above. Thank you, whoever is reading this now. And I'm sorry if I have wasted your time.