New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ydm/dola

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ydm/dola

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Dola

Що се рекло от три наречници,
що се рекло и се извършило...

Dola is a cryptocurrency trading library that provides:

  • exchanges integration (via github.com/thrasher-corp/gocryptotrader),
  • event-driven strategies,
  • utilities and more.

Exchanges

Dola expects to find a configuration file at ~/.dola/config.json. See an example here.

NB: Dola needs just the exchanges section.

Strategies

Each strategy is an implementation of the following interface. Dola has the responsibility of invoking all of the Strategy methods. Strategy.On* methods are invoked whenever there is new data from one of the registered exchanges. If you need a strategy that supports just one exchange (out of many), take a look at DedicatedStrategy.

type Strategy interface {
	Init(k *Keep, e exchange.IBotExchange) error
	OnFunding(k *Keep, e exchange.IBotExchange, x stream.FundingData) error
	OnPrice(k *Keep, e exchange.IBotExchange, x ticker.Price) error
	OnKline(k *Keep, e exchange.IBotExchange, x stream.KlineData) error
	OnOrderBook(k *Keep, e exchange.IBotExchange, x orderbook.Base) error
	OnOrder(k *Keep, e exchange.IBotExchange, x order.Detail) error
	OnModify(k *Keep, e exchange.IBotExchange, x order.Modify) error
	OnBalanceChange(k *Keep, e exchange.IBotExchange, x account.Change) error
	OnUnrecognized(k *Keep, e exchange.IBotExchange, x interface{}) error
	Deinit(k *Keep, e exchange.IBotExchange) error
}

Example

package main

import (
	"context"
	"github.com/ydm/dola"
)

func main() {
	keep, _ := dola.NewKeepBuilder().Build()
	keep.Root.Add("verbose", dola.VerboseStrategy{})
	keep.Run(context.Background())
}

Augment config

keep, _ := dola.NewKeepBuilder().Augment(func (c *config.Config) erro {
    doSomething(c)
}).Build()

Use custom exchanges

creator := func() (exchange.IBotExchange, error) {
  return NewCustomExchange()
}
keep, _ := dola.NewKeepBuilder().CustomExchange(name, creator).Build()

FAQs

Package last updated on 28 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc