在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:bcc-research/CFMMRouter.jl开源软件地址:https://github.com/bcc-research/CFMMRouter.jl开源编程语言:Julia 100.0%开源软件介绍:CFMMRouterOverviewThis package contains a fast solver for the CFMM Routing problem, as defined by Angeris et al. in Optimal Routing for Constant Function Market Makers. We partially decompose the problem to enable fast solutions when the number of CFMMs is large relative to the number of tokens. For more information, check out the documentation. Quick StartFirst, add the package locally. using Pkg; Pkg.add(url="https://github.com/bcc-research/CFMMRouter.jl") Make some swap pools. using LinearAlgebra
using CFMMRouter
equal_pool = ProductTwoCoin([1e6, 1e6], 1, [1, 2])
unequal_small_pool = ProductTwoCoin([1e3, 2e3], 1, [1, 2])
prices = ones(2) Build a Router & route. router = Router(
LinearNonnegative(prices),
[equal_pool, unequal_small_pool],
2,
)
route!(router) Check out the results. Ψ = round.(Int, netflows(router))
println("Profit: $(dot(prices, Ψ))") PerformanceThis routing algorithm scales approximately linearly in the number of swap pools for the arbitrage problem. These tests were run on a MacBook Pro with a 2.3GHz 8-Core Intel i9 processor. Several performance improvements are possible. ReferencesG Angeris, T Chitra, A Evans, and S Boyd. Optimal Routing for Constant Function Market Makers |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论