-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Manfred Touron <[email protected]>
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Package foo20_lp provides a simple implementation of a fixed price liquidity queue for swapping two types of tokens. | ||
A liquidity queue represents a queue of tokens that can be swapped for tokens of a different type at a fixed price. When a token is swapped, it is removed from its queue and a token of the other type is removed from the other queue. If there are not enough tokens in the other queue to swap with, the token is added to its queue to be swapped later when more tokens are added to the other queue. | ||
Please note that this is a simple implementation and does not handle many practical considerations that would need to be addressed in a real-world application. | ||
*/ | ||
package foo20_lp // import "gno.land/r/demo/foo20_lp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package foo20_lp | ||
|
||
func DepositFoo20() { | ||
|
||
} | ||
|
||
func DepositGnot() { | ||
|
||
} | ||
|
||
func Render(path string) string { | ||
return "Queues: ..." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package foo20_lp | ||
|
||
import "testing" | ||
|
||
func TestPackage(t *testing.T) { | ||
println("OK") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// PKGPATH: gno.land/r/demo/foo20_lp_test | ||
package foo20_lp_test | ||
|
||
import "gno.land/r/demo/foo20_lp" | ||
|
||
func main() { | ||
println("A", foo20_lp.Render("")) | ||
foo20_lp.DepositFoo20() | ||
println("B", foo20_lp.Render("")) | ||
foo20_lp.DepositGnot() | ||
println("C", foo20_lp.Render("")) | ||
} | ||
|
||
// Output: | ||
// A Queues: ... | ||
// B Queues: ... | ||
// C Queues: ... |